>>> visual.version
(4, 'beta25')
[chris@localhost Desktop]$ uname -a
Linux localhost 2.6.17-5mdv #1 SMP Wed Sep 13 14:32:31 EDT 2006 i686
Intel(R) Pentium(R) M processor 1600MHz GNU/Linux
The following code for generating a menu item displays the Add text but
does not display the menu items unless the button line is uncommented;
from visual.controls import *
w = 400
d = display(x=w, y= 0, width = w, height=w, range = 1.5)
c = controls(x = 0, y = 0, width = w , height = w, range= 60)
m1 = menu(pos=(0,0,0), height=7, width=25, text='Add')
m1.items.append(('Cube', lambda: addcube())) # specify menu item title
and action to perform
m1.items.append(('Sphere', lambda: addsphere())) # specify menu item
title and action to perform
m1.items.append(('Cylinder', lambda: addcylinder())) # specify menu item
title and action to perform
# bl = button(pos=(40,40), height=10, width=10, text='OK',
action=lambda: donowt)
while 1:
rate(100)
c.interact()
|