473,414 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Fw: Message vtkUser

Hello everyone,

my student had the following problem with a python program featuring
multiple vtkTkRenderWidget calls. See below...

Can anyone suggest a workaround?

Best regards,

Michel

Michel Audette, Ph.D.,
Research Fellow, Surgical Simulation,
Surgical Assist Technology Group,
AIST,
Namiki 1-2,
Tsukuba, Japan,
305-8564.
--------------------------------------------------------
"If you think you can do it, you're right.
If you think you can't do it, you're still right."
- Henry Ford

I have some problems with management of many vtkTkRenderWidget.

I am developing GUI for surgical software in Python Language.
Each window of this GUI have one vtkTkRenderWidget to show 3D Objects
(One of them used the vtksliceWidget develop by Atamai).
I succeed to show one objects in one of these windows.
But if I try to open another one I get this error:

File "/usr/local/lib/python2.2/lib-tk/Tkinter.py", line 1316, in __call__
return apply(self.func, args)
File "selection.py", line 64, in <lambda>
command = lambda:
File "functionclass.py", line 550, in entranceTriplan
self.show2(self.triplan)
File "functionclass.py", line 164, in show2
self.affichageTriplan("exemple.mnc")
File "functionclass.py", line 584, in affichageTriplan
self.viewer1 = vtkSliceWidget.vtkSliceWidget(self.triplan.frame1,
width=256,height=256)
File "/home/athinnes/atamai/examples/vtkSliceWidget.py", line 108, in
__init__
Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw)
File "/usr/local/lib/python2.2/lib-tk/Tkinter.py", line 1780, in
__init__
self.tk.call(
TclError: invalid command name "vtkTkRenderWidget"

This following is a simplify version of the software architecture without
using vtkSliceWidget .
Each module corresponding to one part of the interface:

################################################## ####################
#testfunc.py

from Tkinter import *
from vtkTkRenderWidget import *
import triplantest
import bouton
import render

class Functions:

def __init__(self, myParent):
print "functions class created"
# If you comment the self.render line. The button will open the
triplantest window
self.render = render.Render(self, myParent)

self.bouton = bouton.Bouton(self)
self.triplan = triplantest.Triplan(self)

## Procedure: show
# this procedure is call to show on the screen the windows winname
def show(self, winname):
winname.deiconify()
self.affichageTriplan()

## Procedure: affichageTriplan
# This procedure setup the slice image inside triplan interface

def affichageTriplan(self):

self.renderWidget = vtkTkRenderWidget(self.triplan.frame1)
self.renderWidget.pack(expand='true',fill='both')
if __name__ == '__main__':

root = Tk()
function = Functions(root)
function.triplan.withdraw()
root.mainloop()

################################################## #####################
#render.py

from vtkTkRenderWidget import *
from vtkpython import *
from Tkinter import *

class Render:

def __init__(self, myFunctions, myParentFunction):

self.functions = myFunctions
myParentFunction.title("test vtkTkRenderWidget")

self.viewer = Frame(myParentFunction, borderwidth = 2, relief =
"ridge")
self.renderWidget = vtkTkRenderWidget(self.viewer)

self.viewer.pack(expand='true',fill='both')
self.renderWidget.pack(expand='true',fill='both')

################################################## #######################
#
#triplantest.py

from Tkinter import *

class Triplan(Tk):
def __init__(self, myFct):
Tk.__init__(self)

self.functions = myFct
self.title("Frame for vtkSliceWidget")

self.mainframe = Frame(self)
self.frame1 = Frame(self.mainframe, relief="ridge", borderwidth=2)

self.frame1.pack(expand='true',fill='both')
self.mainframe.pack(expand='true',fill='both')

################################################## #############
#bouton.py

from Tkinter import *
class Bouton(Tk):

def __init__(self, myFunctions):
Tk.__init__(self)
self.functions = myFunctions
self.title("Click On Button")
self.frame = Frame(self)
self.bouton = Button(self.frame, text = "click \nhere",
command = lambda:
self.functions.show(self.functions.triplan)
)

self.frame.pack(expand='true',fill='both')
self.bouton.pack(expand='true',fill='both')

################################################## ####################3

If you run "python testfunc.py" you will see the error. It's the same I
have in the full software.

Somebody have any idea why it's not working and how to solve it?
It seams, vtkTkRenderWidget cannot be call twice. But I don't know how to
solve it.

Thank you for your attention
Best regards
Alexandre Thinnes
Je dois avoir un probleme de mail avec l'AIST.
Il semble que l'adresse qui envois les mails ne soit pas celle qui les
recois. >_<

Accédez au courrier électronique de La Poste : www.laposte.net ;
3615 LAPOSTENET (0,34?/mn) ; tél : 08 92 68 13 50 (0,34?/mn)


Jul 18 '05 #1
0 1072

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Timothy Madden | last post by:
Hy all In my application I'll receive XML text in the HTTP-message body in a particular format that only my application understands My script will be requested by the client with HTTP POST and...
8
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
2
by: Microsoft News | last post by:
What I have is a message box that pops up. It is another browser window. The code is a general function that you pass message, title and a key to. The box works great except, that if you are on a...
0
by: ronscottlangham | last post by:
I am working on a custom WCF EndpoingBehavior that will modify the messages coming in and out of my Service. I am having an error related to the modification of the message in the...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
3
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this...
0
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"...
2
by: bernd | last post by:
Hi netties, posted this in a different group already, which seems to be inappropriate. I create a message queue with msgget(), sent a 5-byte message to it with msgsnd() and try to receive the...
2
by: forums_mp | last post by:
Facing a design problem here and I'm not sure how to solve this. The system consists of bi-directional communication between a subject communicating with two (at least for now ) listeners. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.