lundi 23 février 2015

onbutton click, display an image(wxpython)

I have a panel with a View button. Every time I'm going to click that button I want an image(fetch from a directory) to appear beside that button(maybe a frame for the image). And since the directory has a new image added every day, if I'm going to click again the button it will automatically display the new image added. How will I do that? Am using wxpython for the gui.


Code:



class ViewerData(wx.Frame):

def __init__(self, *args, **kw):
super(ViewerData, self).__init__(*args, **kw)

self.InitUI()

def InitUI(self):

pnl = wx.Panel(self)
cbtn = wx.Button(pnl, label='View', pos=(30, 150))

cbtn.Bind(wx.EVT_BUTTON, self.OnView)

self.SetSize((500, 400))
self.SetTitle('wx.Button')
self.Centre()
self.Show(True)

def OnView(self, e):

self.Close(False)

Aucun commentaire:

Enregistrer un commentaire