import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "title", size=(200,10))
self.CreateStatusBar()
imgpath = "C:\\1.jpg"
image = wx.Image( imgpath , wx.BITMAP_TYPE_ANY).ConvertToBitmap()
image1 = wx.StaticBitmap( self, wx.ID_ANY, image )
button1 = wx.Button( self, wx.ID_ANY, "test")
root_layout = wx.BoxSizer( wx.HORIZONTAL )
root_layout.Add( image1 )
root_layout.Add( button1 )
root_layout.Fit( self )
class myApp(wx.App):
def OnInit( self ):
frame = MyFrame()
frame.Show(True)
return True
def OnClose( evt ):
wx.Exit()
def main():
app = myApp()
app.MainLoop()
if __name__ == '__main__':
main()
aW1wb3J0IHd4CgpjbGFzcyBNeUZyYW1lKHd4LkZyYW1lKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICB3eC5GcmFtZS5fX2luaXRfXyhzZWxmLCBOb25lLCB3eC5JRF9BTlksICJ0aXRsZSIsIHNpemU9KDIwMCwxMCkpCiAgICAgICAgc2VsZi5DcmVhdGVTdGF0dXNCYXIoKQoKICAgICAgICBpbWdwYXRoID0gIkM6XFwxLmpwZyIKICAgICAgICBpbWFnZSA9IHd4LkltYWdlKCBpbWdwYXRoICwgd3guQklUTUFQX1RZUEVfQU5ZKS5Db252ZXJ0VG9CaXRtYXAoKQogICAgICAgIGltYWdlMSA9IHd4LlN0YXRpY0JpdG1hcCggc2VsZiwgd3guSURfQU5ZLCBpbWFnZSApCiAgICAgICAgYnV0dG9uMSA9IHd4LkJ1dHRvbiggc2VsZiwgd3guSURfQU5ZLCAidGVzdCIpCgogICAgICAgIHJvb3RfbGF5b3V0ID0gd3guQm94U2l6ZXIoIHd4LkhPUklaT05UQUwgKQogICAgICAgIHJvb3RfbGF5b3V0LkFkZCggaW1hZ2UxICkKICAgICAgICByb290X2xheW91dC5BZGQoIGJ1dHRvbjEgKQogICAgICAgIHJvb3RfbGF5b3V0LkZpdCggc2VsZiApCiAgICAgICAgCmNsYXNzIG15QXBwKHd4LkFwcCk6CiAgICBkZWYgT25Jbml0KCBzZWxmICk6CiAgICAgICAgZnJhbWUgPSBNeUZyYW1lKCkKICAgICAgICBmcmFtZS5TaG93KFRydWUpCiAgICAgICAgcmV0dXJuIFRydWUKICAgIGRlZiBPbkNsb3NlKCBldnQgKToKICAgICAgICB3eC5FeGl0KCkKCmRlZiBtYWluKCk6CiAgICBhcHAgPSBteUFwcCgpCiAgICBhcHAuTWFpbkxvb3AoKQoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIG1haW4oKQ==