WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-27-2011, 04:16 PM
kevin kevin is offline
Member
 
Join Date: Jun 2011
Posts: 18
Timer events within a Tkinter class

Hi all,

Is it possible to have a Vizard timer event occur within a Tkinter application? I seem to be running into a problem with the Tkinter main loop dominating the program execution, so Vizard's normal functionality temporarily halts in the background. In other words, a timer event created using vizact.ontimer() will not execute within the Tkinter application. Is there a way around this?
Reply With Quote
  #2  
Old 07-28-2011, 09:34 AM
kevin kevin is offline
Member
 
Join Date: Jun 2011
Posts: 18
Found the answer here: http://forum.worldviz.com/showthread...hlight=tkinter
Reply With Quote
  #3  
Old 07-29-2011, 12:10 PM
kevin kevin is offline
Member
 
Join Date: Jun 2011
Posts: 18
Ran into another problem. Having Vizard embedded in the Tkinter frame works fine, and Vizard picks up mouse events. However, it does not pick up keyboard events. Here is the relevant code:

Code:
class InputSetup(Tkinter.Frame):
	def __init__(self,master=None):
		Tkinter.Frame.__init__(self,master,width=800,height=600)
		self.pack()
		
		viz.go(viz.EMBEDDED,window=self.winfo_id())
		viz.clearcolor(0.95,0.95,0.95)

		viz.callback(viz.MOUSEDOWN_EVENT,self.record_input)
		viz.callback(viz.KEYDOWN_EVENT,self.record_input)
		
		self.after(1,self.update_vizard)
		
	def update_vizard(self):
		viz.updateframe()
		self.after(1,self.update_vizard)
		
	def set_selected_variable(self,value):
		print value
		
	def record_input(self,e):
		self.set_selected_variable(e)
I've also tried updating Vizard's input monitoring directly using
Code:
viz.update(viz.UPDATE_INPUT)
with no luck.

Is there anything I'm overlooking that I need to manually ensure is updated?
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Publishing and exe that uses Tkinter kevin Vizard 1 06-09-2011 03:02 PM
Tkinter Question mizutani_jun Vizard 0 02-24-2011 04:16 PM
Question about Vizard Expiration Timer Rate mizutani_jun Vizard 2 02-23-2011 09:13 PM
tkinter window focus John P Vizard 4 08-31-2009 05:51 AM
Timer speed Jerry Vizard 1 12-08-2006 11:01 AM


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


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