From: Herman, R. <he...@un...> - 2008-07-13 15:48:57
|
Hi, I have several control panels, but I do not want them showing at the same time. Is there a way to hide them. I tried several display attribute calls but they did not seem to work. Also, if I close one manually, everything closes. Thanks Russell Herman Editor-in-Chief The Journal of Teaching Effectiveness, http://www.uncw.edu/cte/et/, JE...@un... Center for Teaching Excellence, and Professor Department of Mathematics and Statistics UNC Wilmington, Wilmington, NC 28403 he...@un... |
From: Bruce S. <Bru...@nc...> - 2008-07-13 19:57:02
|
What's missing in the documentation is that a controls window has an attribute "display" which is the display within which those controls are displayed. The following code displays a sphere in an ordinary window plus two controls windows (with no loop to make the controls active). Clicking in the ordinary window makes the second controls window visible, then invisible. from visual.controls import * sphere() c1 = controls(x=500, y=0) toggle() c2 = controls(x=500, y=400) button(text="Press") slider(pos=(-80,-80), axis=(0,100)) scene.mouse.getclick() c2.display.visible = 0 scene.mouse.getclick() c2.display.visible = 1 There is a bug I don't understand. After the second click, which makes the second control panel visible again, the text is missing from the button. If you also want users to be able to kill a controls window without killing the application, you need to say c2.display.exit = 0 # default is 1 (true), which kills the application Bruce Sherwood Herman, Russ wrote: > Hi, > > I have several control panels, but I do not want them showing at the same time. Is there a way to hide them. I tried several display attribute calls but they did not seem to work. Also, if I close one manually, everything closes. > > Thanks > > Russell Herman > > Editor-in-Chief > The Journal of Teaching Effectiveness, > http://www.uncw.edu/cte/et/, JE...@un... > Center for Teaching Excellence, and > > Professor > Department of Mathematics and Statistics > UNC Wilmington, Wilmington, NC 28403 > he...@un... > > |
From: Herman, R. <he...@un...> - 2008-07-13 21:40:31
|
Hi, The display attribute was what I needed. I first tried toggling the visible attribute. The bug you mentioned first gave buttons with no text, but further use made the buttons disappear entirely. I ended up using the exit function. I rewrote the control panels as part of functions which could be called to delete one panel and add the other. Toggling this way gave me what I wanted the user to see. Thanks. Russell Herman Editor-in-Chief The Journal of Teaching Effectiveness, http://www.uncw.edu/cte/et/, JE...@un... Center for Teaching Excellence, and Professor Department of Mathematics and Statistics UNC Wilmington, Wilmington, NC 28403 he...@un... -----Original Message----- From: vis...@li... on behalf of Bruce Sherwood Sent: Sun 7/13/2008 3:57 PM To: vis...@li... Subject: Re: [Visualpython-users] Mulitple Control Panels What's missing in the documentation is that a controls window has an attribute "display" which is the display within which those controls are displayed. The following code displays a sphere in an ordinary window plus two controls windows (with no loop to make the controls active). Clicking in the ordinary window makes the second controls window visible, then invisible. from visual.controls import * sphere() c1 = controls(x=500, y=0) toggle() c2 = controls(x=500, y=400) button(text="Press") slider(pos=(-80,-80), axis=(0,100)) scene.mouse.getclick() c2.display.visible = 0 scene.mouse.getclick() c2.display.visible = 1 There is a bug I don't understand. After the second click, which makes the second control panel visible again, the text is missing from the button. If you also want users to be able to kill a controls window without killing the application, you need to say c2.display.exit = 0 # default is 1 (true), which kills the application Bruce Sherwood Herman, Russ wrote: > Hi, > > I have several control panels, but I do not want them showing at the same time. Is there a way to hide them. I tried several display attribute calls but they did not seem to work. Also, if I close one manually, everything closes. > > Thanks > > Russell Herman > > Editor-in-Chief > The Journal of Teaching Effectiveness, > http://www.uncw.edu/cte/et/, JE...@un... > Center for Teaching Excellence, and > > Professor > Department of Mathematics and Statistics > UNC Wilmington, Wilmington, NC 28403 > he...@un... > > ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Visualpython-users mailing list Vis...@li... https://lists.sourceforge.net/lists/listinfo/visualpython-users |