From: <bra...@om...> - 2005-03-30 23:04:11
|
I have a question about this approach. It does work, but I don't understand it as well as I'd like and I worry that it depends too much on timing. When does the child window's on_initialize run? What if on a really fast computer it runs before the childWindow.id_emp is bound? pyt...@li... wrote on 03/21/2005 03:55:47 PM: > Hi Brad, > > You need to put the raise method in a method of the childWindow. > I'm on XP, and calling the childWindow's raise method from the > originating method as above never works for me. > > i.e. > > def on_empMultiColumnList_itemActivated(self, event): > #Do stuff to derive id_emp > childWindow = model.childWindow(self, empDetail.bgEmpDetail) > childWindow.id_emp = id_emp > > > and in empDetail - > > class bgEmpDetail(model.Background): > def on_initialise(self, event): > #This will need explaining > self.popuulateFields(self.id_emp) > self.Raise() > > See, what happens is that when a child window is created, the method > that created finishes before the child window's on_initialise gets > called. > > At the mo, my thing with childWindow.id_emp = id_emp is the only way > of passing other parameters to the on_initialise() method. > > So, you can pass the parameters in, and then your child windows > initialisation can act on them. > > And, sticking Raise() in the child windows init method fixed your > problem for me. > > > I hope it helps. If it's confusing at all, let me know and I'll try > and explanify further. > > > Regards, > > Liam Clarke > > > > On Mon, 21 Mar 2005 11:11:40 -0600, bra...@om... > <bra...@om...> wrote: > > > > The Raise method for a child window seems not to work on the Mac, but does > > work under Windows. On the Mac, the child window starts to pop in front of > > the parent window, but then it withdraws behind. From looking at message > > watcher, It's almost as if the second click in my doubleclick is bringing > > the parent window forward. > > > > Is there something else I should be doing other than Raise(), or is this a > > bug? > > > > Here is the method runs when I doubleclick my multicolumnlist: > > > > def on_empMultiColumnList_itemActivated(self, event): > > """When an entry is double clicked""" > > indexClicked = event.m_itemIndex > > base = self.components > > rows = base.empMultiColumnList.GetSelectedItems() > > if len(rows) == 0: > > return > > print rows > > id_emp = rows[0][0] > > empDetail.id_emp = id_emp > > self.detailWindow = > > model.childWindow(self,empDetail.bgEmpDetail) > > self.detailWindow.populateFields(id_emp) > > self.detailWindow.Raise() > > > > > > I'm running PythonCard .81, wxPython 2.5.4.1, Python 2.3, Mac OS 10.3.8. > > > > > -- > 'There is only one basic human right, and that is to do as you damn > well please. > And with it comes the only basic human duty, to take the consequences. > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users |