From: Kooshesh, S. A <KOO...@do...> - 2005-11-18 19:17:23
|
Here is a snippet I used: class Acquire(model.Background): def on_initialize(self, event): .... self.parent =3D self.GetParent()=20 ..... ----------------------------------------------- "A human being is a part of the whole called by us universe, a part limited in time and space. He experiences himself, his thoughts and feeling as something separated from the rest, a kind of optical delusion of his consciousness. This delusion is a kind of prison for us, restricting us to our personal desires and to affection for a few persons nearest to us. Our task must be to free ourselves from this prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty." Albert Einstein ------------------------------------------------ ****************************************** Sayed Arian Sterling Kooshesh Computer Applications Technician District 2/IDOT 819 Depot Ave Dixon, IL 61021 koo...@do... (815) 284-5494 -----Original Message----- From: pyt...@li... [mailto:pyt...@li...] On Behalf Of kim...@ya... Sent: Friday, November 18, 2005 1:10 PM To: pyt...@li... Subject: [Pythoncard-users] Window tracking Hi list, Does anybody know if there's an easy way for a ChildWindow to "track" the position of the parent window? For the very least, when opening a child-window, I like it to at least get close to where the parent window is. Thanks, -- John -- John Henry ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=3D7628&alloc_id=3D16845&op=3Dclick _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: <kim...@ya...> - 2005-11-18 22:30:19
|
Hi there, thanks for the reply. I am afraid that's not what I am looking for. I know how to get the parent. My question was how do I position the child window so that it opens up over the parent. For instance, under Windows XP, if I am using 2 monitors, if I don't do anything, the parent window might end up on one side and the child window will end up somewhere on the other side. What I am looking for is something like: a) Get the parents coordinate b) Set the child coordinate to be some kind of a function of the parent c) Set up an event handler so that whenever the parent window moves, change the child windows coordinate to follow the parent. I know how to do these things in C - just don't know how to use do it in PythonCard. Regards, -- John --- "Kooshesh, Sayed A" <KOO...@do...> wrote: > Here is a snippet I used: > > class Acquire(model.Background): > > def on_initialize(self, event): > .... > self.parent = self.GetParent() > ..... > > ----------------------------------------------- > "A human being is a part of the whole called by us > universe, a part > limited in time and space. He experiences himself, > his thoughts and > feeling as something separated from the rest, a kind > of optical delusion > of his consciousness. This delusion is a kind of > prison for us, > restricting us to our personal desires and to > affection for a few > persons nearest to us. Our task must be to free > ourselves from this > prison by widening our circle of compassion to > embrace all living > creatures and the whole of nature in its beauty." > Albert Einstein > ------------------------------------------------ > > ****************************************** > Sayed Arian Sterling Kooshesh > Computer Applications Technician > District 2/IDOT > 819 Depot Ave > Dixon, IL 61021 > koo...@do... > (815) 284-5494 > > -----Original Message----- > From: pyt...@li... > [mailto:pyt...@li...] > On Behalf Of > kim...@ya... > Sent: Friday, November 18, 2005 1:10 PM > To: pyt...@li... > Subject: [Pythoncard-users] Window tracking > > Hi list, > > Does anybody know if there's an easy way for a > ChildWindow to "track" > the position of the parent window? For the very > least, when opening a > child-window, I like it to at least get close to > where the parent window > is. > > Thanks, > > -- > John > > -- > John Henry > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today > Register for a JBoss Training Course. Free > Certification Exam for All > Training Attendees Through End of 2005. For more > info visit: > http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today > Register for a JBoss Training Course. Free > Certification Exam > for All Training Attendees Through End of 2005. For > more info visit: > http://ads.osdn.com/?ad_idv28&alloc_id845&op=click > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- John Henry |
From: Alex T. <al...@tw...> - 2005-11-18 23:00:55
|
kim...@ya... wrote: >Hi there, thanks for the reply. > >I am afraid that's not what I am looking for. I know >how to get the parent. My question was how do I >position the child window so that it opens up over the >parent. For instance, under Windows XP, if I am >using 2 monitors, if I don't do anything, the parent >window might end up on one side and the child window >will end up somewhere on the other side. > >What I am looking for is something like: > >a) Get the parents coordinate >b) Set the child coordinate to be some kind of a >function of the parent >c) Set up an event handler so that whenever the parent >window moves, change the child windows coordinate to >follow the parent. > >I know how to do these things in C - just don't know >how to use do it in PythonCard. > > > Both the parent and child window are just windows, so you can use any of the functions for a wxWindow. So, in the child's on_initialize(), you can do something like: self.Centre() which will centre the child window over its parent. Or you can do self.parent = self.GetParent() bx,by, dx, dy = self.parent.GetRect() self.Move( (bx, by+dy) ) to move the origin of the child to the bottom left of the parent. Or .... lots of things like that. In the parent window, you can add something like self.childWindow = model.childWindow(self, MyChild) and have handlers > def on_size(self, event): > print "size" > bx,by, dx, dy = self.GetRect() > self.childWindow.Move( (bx, by+dy) ) > pass > > def on_move(self, event): > print "move" > bx,by, dx, dy = self.GetRect() > self.childWindow.Move( (bx, by+dy) ) > pass of course, you ought to check that the child window exists, etc. :-) -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.2/170 - Release Date: 15/11/2005 |
From: <kim...@ya...> - 2005-11-19 00:40:15
|
Thanks, --- Alex Tweedly <al...@tw...> wrote: > kim...@ya... wrote: > > >Hi there, thanks for the reply. > > > >I am afraid that's not what I am looking for. I > know > >how to get the parent. My question was how do I > >position the child window so that it opens up over > the > >parent. For instance, under Windows XP, if I am > >using 2 monitors, if I don't do anything, the > parent > >window might end up on one side and the child > window > >will end up somewhere on the other side. > > > >What I am looking for is something like: > > > >a) Get the parents coordinate > >b) Set the child coordinate to be some kind of a > >function of the parent > >c) Set up an event handler so that whenever the > parent > >window moves, change the child windows coordinate > to > >follow the parent. > > > >I know how to do these things in C - just don't > know > >how to use do it in PythonCard. > > > > > > > Both the parent and child window are just windows, > so you can use any of > the functions for a wxWindow. > So, in the child's on_initialize(), you can do > something like: > > self.Centre() > which will centre the child window over its parent. > > Or you can do > self.parent = self.GetParent() > bx,by, dx, dy = self.parent.GetRect() > self.Move( (bx, by+dy) ) > to move the origin of the child to the bottom left > of the parent. > > Or .... lots of things like that. > > In the parent window, you can add something like > > self.childWindow = model.childWindow(self, > MyChild) > > and have handlers > > > def on_size(self, event): > > print "size" > > bx,by, dx, dy = self.GetRect() > > self.childWindow.Move( (bx, by+dy) ) > > pass > > > > def on_move(self, event): > > print "move" > > bx,by, dx, dy = self.GetRect() > > self.childWindow.Move( (bx, by+dy) ) > > pass > > of course, you ought to check that the child window > exists, etc. :-) > > > -- > Alex Tweedly http://www.tweedly.net > > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.362 / Virus Database: 267.13.2/170 - > Release Date: 15/11/2005 > > -- John Henry |