Hi!
I'm learning Python to do a project of ini parser/merger. I've take wxPython
for GUI interface.
I've created the code for viewing current content of ini file (color config of
a program) and my page is so full in 1024x768 that I have no place for menu.
Then I have created an other file acting as menu, with buttons. But now How to
launch other file within this "menu file"?
Here is my menu code :
class MainFrame( wx.Frame ):
def __init__( self, imageFilename ):
wx.Frame.__init__( self, None, -1 )
self.SetBackgroundColour('#EFEFEF')
self.SetPosition( (600, 15) )
self.SetClientSize( (500, 325) )
png = wx.Image(opj(imageFilename), wx.BITMAP_TYPE_PNG).ConvertToBitmap()
wx.StaticBitmap(self, 0, png, (20, 20), (225, 260))
# Les bouttons
self.button = wx.Button(self, label="See Actual Colors", size=(125,35),
pos=(350, 100))
self.Bind(wx.EVT_PAINT, self.OnPaint, self.button)
# Some other menu items....
def OnPaint(self, evt):
dc = wx.PaintDC(self)
self.PrepareDC(dc)
self.Draw(dc)
def Draw(self, dc, rgn=None, vs=None):
print 'On a trouve Cumulus'
self.SetBackgroundColour(wx.Colour(0,128,0))
dc = wx.PaintDC(self)
self.PrepareDC(dc)
dc.SetTextForeground("BLACK")
# make an interesting background...
dc.SetPen(wx.MEDIUM_GREY_PEN)
brush = wx.Brush('#000000', wx.TRANSPARENT)
dc.SetBrush(brush)
dc.SetFont(self.font2)
dc.SetTextForeground("#666666")
dc.DrawText("Cumulus main screen", 22, 11)
class MainApp( wx.App ):
def __init__( self, imageFilename=None, redirect=False ):
wx.App.__init__( self, redirect )
appFrame = MainFrame( imageFilename )
appFrame.Show()
#some more lines... before launcher
···
#------------------------------------------------------------------------------
if __name__ == '__main__':
imageFilename = 'images/station.png'
app = MainApp(imageFilename)
app.MainLoop()
#end if
Then, how to launch other(s) frame in dc context?
Thanks for your help
Jacques