wxPython on RedHat 7.3 (GNOME 1.4 I think???)

Sean sean at activeprime.com
Fri Jan 17 12:33:32 EST 2003


Cliff Wells <LogiplexSoftware at earthlink.net> wrote in message news:<mailman.1042492466.10176.python-list at python.org>...
> On Mon, 2003-01-13 at 13:00, Sean wrote:
> > Cliff, 
> > 
> >   Thanks for the pointer.  That got rid of the text showing up as
> > boxes.  The other problem I was having was a wxStaticText control
> > object in my frame's toolbar keeps disapearing whenever I resize the
> > frame.  It comes back if I give focus to another window and then
> > switch back, but refreshing the frame (or toolbar) on resize events
> > does not seem to help.
> 
> Do you have a small piece of code you could post (or send me) so I can
> take a look?
> 
> Also, please don't top-post.  It makes the conversation difficult to
> follow for others who might be interested.
> 
> 
> > Cliff Wells <LogiplexSoftware at earthlink.net> wrote in message news:<mailman.1042235066.17749.python-list at python.org>...
> > > 
> > > This is usually a problem only seen on GNOME2, but you might try running
> > > the demo with
> > > 
> > > env LANG='C' python demo.py
> > > 
> > > to see if that helps.  I assume by "weird visibility" errors you are
> > > referring to fonts?  For instance, fonts display as small boxes rather
> > > than text?  If not, please clarify.


Here is a sample program that creates a small frame and adds a toolbar
with 2 wxStaticText controls.  Under both KDE and Gnome (on both
redhat 7.3 and 8.0) the static text will disappear anytime you resize
the frame.  The only way to get it back is to give focus to another
window, and then focus to the frame.


from wxPython.wx import *

ID_ABOUT = 101
ID_EXIT  = 102

class MyFrame(wxFrame):
    def __init__(self, parent, ID, title):
        wxFrame.__init__(self, parent, ID, title,
                         wxDefaultPosition, wxSize(400, 250))


        self.toolBar =
self.CreateToolBar(wxTB_HORIZONTAL|wxTB_3DBUTTONS, NewId(), "ToolBar")

        #add state combo boxs
        id = NewId()
        self.toolBar.AddControl(wxStaticText(self.toolBar, id, "Static
Text 1: "))

        id = NewId()
        self.toolBar.AddControl(wxStaticText(self.toolBar, id, "Static
Text 2: "))


        self.toolBar.Realize()



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

app = MyApp(0)
app.MainLoop()




More information about the Python-list mailing list