[wxPython] Bugs Loading Resources

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Bugs Loading Resources

Calcott, Brett
I'm trying to get the resource loading working & (apart from low
documentation) I am having some problems. I understand that the resource
stuff is fairly new, but any hints would be appreciated.

In the following code the panel comes up embedded ok, but the window will
never close.


----------------------------------------------------------cut---------------
----------------------------
from wxPython.wx import *

## Create a new frame class, derived from the wxPython Frame.
class MyFrame(wxFrame):

    def __init__(self, parent, id, title):
        # First, call the base class' __init__ method to create the frame
        wxFrame.__init__(self, parent, id, title,
                         wxPoint(100, 100), wxSize(160, 100))

        panel = wxPanel(self, -1, (0,0))
        panel.LoadFromResource(self, "dialog1")
     
        self.SetClientSize(panel.GetClientSize())
       

class MyApp(wxApp):
    def OnInit(self):
        frame = MyFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

wxResourceParseFile("test.wxr")
app = MyApp(0)
app.MainLoop()
------------------------------------------------cut-------------------------
---------------------

What I really want is just a app with the main window being a dialog loaded
from the resource, but wxPython doesn't like having a dialog as the main
window, so from here I want to lock the main window size to the panel. again
any hints would be good.

Where is the source for the dialog editor by the way??
Its got an annoying bug: After trying to change the resource id - the
properties window will never close.


Brett


This communication is confidential and may be legally privileged.  If you have received it by mistake you must not use, disclose, copy or retain it.  Please immediately notify us by return email and then delete the emails.  Views expressed in this communication may not be those of The National Bank of New Zealand Limited.

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users