From: Kevin A. <al...@se...> - 2006-07-12 00:59:55
|
On Jul 11, 2006, at 3:57 PM, Martin wrote: > I was astonished by the simplicity of the turtle, and is the =20 > perfect base to learn PythonCard UI, because you can see right away =20= > what your code is doing, however, im trying to connect an external =20 > dialog to "remote control" the turtle, but it seems that the events =20= > are not reaching the main loop, what can i do? > (The example code was not changed in any way) > adj: code > > in the embebedd PyCrust: > > import turtleMover as tm > dlg =3D tm.MyDialog(None,t) #t is the default turtle > tm.visible =3D True > > The dialog appears, it's usable, but nothing happens :( > what i did wrong? what is missing? > how can i process the events of the custom dialog in the already =20 > running turtle example? > I dont know if the rsrc and the events code are ok. > > i need so much help :P (a poor n00b trying to learn) > > Thanks in advance > > --- > Mart=EDn Ren=E9 Vilugr=F3n > http://maul3r.blogspot.com > Patagonia Argentina > <turtleMover.py> > <turtleMover.rsrc.py> Your problem here is that you're trying to use a modal dialog. You =20 can get a result from the dialog, but if you want the experience to =20 be interactive, rather than using a dialog, just change your code so =20 that it is a child window instead and it won't be modal. You can make =20= references to the main window turtle from your child window. Create =20 the child window and keep a reference to it in the main window =20 on_initialize event handler. There are multiple samples that use =20 child windows. If you have a problem getting this to work I'm sure =20 someone on the list can provide the needed code tweaks. ka= |