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... > > |