Wx Python : Status Bar Does Not Show Menu Messages -
i starting out wx python , can't status bar display text menu items.i read statusbar messages can set setstatustext()
want texts displayed. using ubuntu 14.04/wxpython 2.8/python 2.7.6. please help. in advance.
import wx class test(wx.frame): def __init__(self,parent,id): wx.frame.__init__(self,parent,id,"frame aka window",size = (300,200)) panel = wx.panel(self) self.status=self.createstatusbar() #self.status.setstatustext("something") menubar=wx.menubar() first=wx.menu() second=wx.menu() first.append(wx.newid(),"new window","this new window") first.append(wx.newid(),"open...","open new window") menubar.append(first,"file") menubar.append(second,"edit") self.setmenubar(menubar) if __name__=='__main__': app=wx.pysimpleapp() frame=test(none,id=-1) frame.show() app.mainloop()
your code worked fine on windows8 wxpython 3.0. try code:
import wx class test( wx.frame ): def __init__( self, parent ): wx.frame.__init__ ( self, parent, id = wx.id_any, title = "frame aka window", pos = wx.defaultposition, size = wx.size( 300,200 ), style = wx.default_frame_style ) self.panel = wx.panel(self) self.status = self.createstatusbar( 1, 0, wx.id_any ) self.menu = wx.menubar( 0 ) self.first = wx.menu() self.new = wx.menuitem( self.first, wx.id_any, "new window", u"this new window", wx.item_normal ) self.first.appenditem( self.new ) self.open = wx.menuitem( self.first, wx.id_any, "open", u"open new window", wx.item_normal ) self.first.appenditem( self.open ) self.menu.append( self.first, "file" ) self.second = wx.menu() self.menu.append( self.second, "menu" ) self.setmenubar( self.menu ) self.centre( wx.both ) if __name__=='__main__': app=wx.app() frame=test(none) frame.show() app.mainloop()
Comments
Post a Comment