Hi-
I've just started playing with wxpython (yesterday) and overall I'm damn impressed (its a billion times better than tkinter) but I can't get an image and button to show up at the same time.
any ideas whats wrong with this code?
import wx
import time
import os
app = wx.App(redirect=False)
class Frame(wx.Frame):
def __init__(self, image):
wx.Frame.__init__(self, None, title="myGuts", size=(350,200), style=wx.DEFAULT_FRAME_STYLE)
temp = image.ConvertToBitmap()
size = 1125, 675
wx.Button(panel, -1, "Button1", pos=(300,500))
self.bmp = wx.StaticBitmap(self, bitmap=temp)
self.SetClientSize(size)
class MyGuts(wx.App):
def OnInit(self):
image = wx.Image('moo.png', wx.BITMAP_TYPE_PNG)
w, h = image.GetWidth(), image.GetHeight()
scaledImage = image.Scale(w*.2, h*.2)
self.frame = Frame(scaledImage)
self.frame.Show()
self.frame.CentreOnScreen()
self.frame.SetBackgroundColour('black')
return True
class Screenshooter():
def __init__(self):
currentTimeFile = strftime("%d%m%H%M%S%Y")
os.system('screencapture -x' + str(currentTimeFile) + '.png')
image1 = Image.open("moo.png")
return currentTimeFile
def main():
app = MyGuts()
app.MainLoop()
if __name__ == '__main__':
main()
thanks