WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 07-13-2009, 10:00 AM
lilio lilio is offline
Member
 
Join Date: May 2009
Posts: 11
Hi,

thanks for your answer. But this does not work.

For example:

I've got this class:

Code:
import viz

class Button(object):
	
	def createButton(self, position, name):
		name = viz.add(viz.BUTTON)
		name.translate(position[0], position[1])
		return name

and this start.py

Code:
import viz
import button

viz.go()


button = button.Button()

button.createButton([0.2,0.5], 'testbutton')

def onButton(obj,state):
	if obj == button.testbutton:
		print 'test'

viz.callback(viz.BUTTON_EVENT,onButton)
So I want to create a button with the name testbutton. And afterthat I want to check if the testbutton is clicked.

In my example, the button got the name 'testbutton'.

But then, I've got the error message: 'Button' object has no attribute 'testbutton'


What is wrong??

Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple objects durf Vizard 1 04-10-2009 01:42 PM
Lightwave objects rotation problem hosier Vizard 6 02-13-2009 12:04 PM
simply overlapping objects chris Vizard 3 04-28-2008 12:39 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 11:01 AM
putting objects on the screen jargon Vizard 7 05-24-2005 11:31 AM


All times are GMT -7. The time now is 05:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC