469,117 Members | 1,279 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,117 developers. It's quick & easy.

linking GUI apps using different Toolkits...possible?

This is more of a wxPython centric question, but not seeing reference
to this on the wx group I thought I'd try here since many here also use
wxPython toolkit. I started learning GUI development with Tkinter, and
developed a few screens as part of an application I'm building with it.
I've recently been trying to learn wxPython because of it's additional
widgets (the wxTreeCtrl and Drag and Drop features in particular), and
I've developed an application where there is a splitter window with a
tree on the left side. My goal is to have a user double click on an
option and call up the appropiate display on the right side. I've
already developed the appropriate screens in Tkinter, and I'd like to
use those instead of having to re-write them in wx. I'd basically like
to pack the screen into the rightmost pane, but I have not been able to
find an effective means for doing so. What I have so far is this:
class MyApp(wxApp):
"""driver class, creates a frame to store everything, puts 2
splitter windows inside, the first holding the tree display"""

def OnInit(self):
#create the frame
frame = MyFrame(NULL, -1, "Display")

#create the splitter windows
splitter = MySplitter(frame, -1)
self.p1 = wxWindow(splitter, style=sty)
self.p2 = wxWindow(splitter, style=sty)
self.p2.SetBackgroundColour("sky blue")
splitter.SplitVertically(self.p1, self.p2, 320)

#Create the tree and add the outermost parents
self.p1.myTree = MyTreeCtrl(self.p1, -1, wxDefaultPosition,
(400,400), wxTR_HAS_BUTTONS)
self.p1.root = self.p1.myTree.AddRoot("Subsystem")
self.p1.myTree.SetPyData(self.p1.root, None)
self.p1.child1 = self.p1.myTree.AppendItem(self.p1.root, "4
self.p1.child2 = self.p1.myTree.AppendItem(self.p1.root, "East
of River")

#Bind Drag and Drop methods to the tree to support drag and drop
self.p1.myTree.Bind(EVT_TREE_BEGIN_DRAG, self.OnBeginDrag)
self.p1.myTree.Bind(EVT_TREE_END_DRAG, self.OnEndDrag)
self.p1.myTree.Bind(EVT_LEFT_DCLICK, self.OnLeftDClick)

#Fill with children
headerLabels = ["TC43G", "Arming", "Outage", "Lines", "Graphs"]
for label in headerLabels:
grandchild = self.p1.myTree.AppendItem(self.p1.child1,
self.p1.myTree.SetPyData(grandchild, None)
grandchild = self.p1.myTree.AppendItem(self.p1.child2,
self.p1.myTree.SetPyData(grandchild, None)

#Expand base root to get to meat of data
return true

#When a node is double clicked, it should display the corresponding
display on the right hand side
#currently, display pops up in separate window...
def OnLeftDClick(self, event):
pt = event.GetPosition();
item, flags = self.p1.myTree.HitTest(pt)
clicked = self.p1.myTree.GetItemText(item)
if(clicked == "Arming"):
self.p2 = ACDisplay()
elif(clicked == "Graphs"):
self.p2 = Display()
elif(clicked == "Lines"):
self.p2 = OutTable()
elif(clicked == "Outage"):
self.p2 = tablesum()
Where ACDisplay, Display, OutTable, and tablesum are the classes I've
written already. It runs without errors, but what currently happens is
that the main window with the tree comes up, and when I double-click an
option the screen appears in a separate window. Is there a way to pack
it into the second pane (self.p2)?

Jul 21 '05 #1
0 983

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by mirnazim | last post: by
20 posts views Thread by Steven T. Hatton | last post: by
1 post views Thread by Peetah_junkmail | last post: by
1 post views Thread by Kay | last post: by
10 posts views Thread by Franz Steinhaeusler | last post: by
53 posts views Thread by Vicent Giner | last post: by
reply views Thread by Fred | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.