473,396 Members | 1,722 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,396 software developers and data experts.

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")
frame.Show(true)
self.SetTopWindow(frame)

#create the splitter windows
splitter = MySplitter(frame, -1)
sty = wxBORDER_SUNKEN
self.p1 = wxWindow(splitter, style=sty)
self.p2 = wxWindow(splitter, style=sty)
self.p2.SetBackgroundColour("sky blue")
splitter.SetMinimumPaneSize(100)
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
Corners")
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,
label)
self.p1.myTree.SetPyData(grandchild, None)
grandchild = self.p1.myTree.AppendItem(self.p1.child2,
label)
self.p1.myTree.SetPyData(grandchild, None)

#Expand base root to get to meat of data
self.p1.myTree.Expand(self.p1.root)
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 1106

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

Similar topics

14
by: mirnazim | last post by:
Hi, There are great Python Web Application Framework. But most of them are meant for content oriented web apps. Is there something that can ease the development of application that are not...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
1
by: Peetah_junkmail | last post by:
Hi, I'm not sure this is completely a C related question since it's more about linking problems, so don't hesitate to redirect me to a more appropriate NG. I have a set of useful functions...
1
by: Kay | last post by:
I already specified to ignore specific library: MSVCPRT.lib MSVCRT.lib LIBC.lib MSVCRTD.lib LIBCD.lib command line is like: /INCREMENTAL /NOLOGO /DLL /NODEFAULTLIB:"MSVCPRT.lib MSVCRT.lib LIBC.lib...
10
by: Franz Steinhaeusler | last post by:
Hello NG, I have a suggestion. For simplifying learning or switching between different GUI Toolkits, I could imagine to have one short clearly presented program in different GUI Toolkits. ...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
3
by: ARC | last post by:
I'm having trouble here with Access 2007 and connecting to a different database. The code below works great IF the previous back-end database connection is still present and you are trying to...
53
by: Vicent Giner | last post by:
Hello. I am new to Python. It seems a very interesting language to me. Its simplicity is very attractive. However, it is usually said that Python is not a compiled but interpreted programming...
0
by: Fred | last post by:
Is there is a better newsgroup for this question? I am having a problem linking assemblies into one using Dotfuscator Pro 4.0. The problem occurs when linking the following into one exe:...
7
by: coolsti | last post by:
I have the task to set up an application at work,using MS Access as a front end to a MySQL database. This will be done using an appropriate ODBC driver, and linking the MySQL database to Access. ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.