![]()  | 
	
| 
		 
			 
			#1  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			Hi, 
		
		
		
		
		
		
		
		
	
	I want to create buttons within a definition. Something like that: Code: 
	def createButton(self, position, pictureOff, pictureOn, name, szene): self.Position = position self.PictureOff = pictureOff self.PictureOn = pictureOn self.Name = name self.Szene = szene name = viz.add(viz.BUTTON, scene=szene) name.translate(position[0],position[1]) name.uppicture(pictureOff) name.downpicture(pictureOn) name.setScale(12,3.6) Code: 
	createButton([0.25,0.8],'button01Off.jpg', 'button01On.jpg', 'button1', 2) But now I want to define onbuttondown events, but this does not work! If I write: Code: 
	def onButton(obj,state): if obj == viz.VizButtonLabel(5): viz.scene( 2 ) So I want to write: Code: 
	def onButton(obj,state): if obj == button1: viz.scene( 2 ) But this does not work! I get the error message: global name 'button1' is not defined. I don't know how to solve this problem. I only want to create a lot of buttons and want to set the name of the button over a parameter. And afterthat I want to check the onbuttondown event via the buttonname. Thanks for all your answers...  | 
| Thread Tools | |
| Display Modes | Rate This Thread | 
		
  | 
	
		
  | 
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| multiple objects | durf | Vizard | 1 | 04-10-2009 02:42 PM | 
| Lightwave objects rotation problem | hosier | Vizard | 6 | 02-13-2009 01:04 PM | 
| simply overlapping objects | chris | Vizard | 3 | 04-28-2008 01:39 PM | 
| Could not find plugin to load objects... | halley | Vizard | 1 | 05-30-2006 12:01 PM | 
| putting objects on the screen | jargon | Vizard | 7 | 05-24-2005 12:31 PM |