Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 什么';What’wx.boxsizer上的图像有问题_Image_Python 2.7_Wxpython_Boxsizer - Fatal编程技术网

Image 什么';What’wx.boxsizer上的图像有问题

Image 什么';What’wx.boxsizer上的图像有问题,image,python-2.7,wxpython,boxsizer,Image,Python 2.7,Wxpython,Boxsizer,想要一个左边有图像(可能会改变)右边有标签的boxsizer。所以我创建了这个代码,但是它有一些问题,但我不明白为什么。我是python的新手,谢谢你的理解 self.hFooterStatusImage = 'img/tick.png' self.jpg = wx.Image(self.hFooterStatusImage, wx.BITMAP_TYPE_PNG).ConvertToBitmap() self.hFooterStatusLabel = wx.StaticText(self.hP

想要一个左边有图像(可能会改变)右边有标签的boxsizer。所以我创建了这个代码,但是它有一些问题,但我不明白为什么。我是python的新手,谢谢你的理解

self.hFooterStatusImage = 'img/tick.png'
self.jpg = wx.Image(self.hFooterStatusImage, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
self.hFooterStatusLabel = wx.StaticText(self.hPanel, label = 'Ready')
self.hFooterBox = wx.BoxSizer(wx.HORIZONTAL)
self.hFooterBox.Add(self.jpg, 0, wx.ALL | wx.ALIGN_LEFT, 5)
self.hFooterBox.Add(self.hFooterStatusLabel, 0, wx.ALL | wx.ALIGN_LEFT, 5)
但我有一个错误

TypeError:wx.Window、wx.Sizer、wx.Size或(w,h)应为项目 错误:无法导入模块:musicOrganizer(文件:/../../...py)

谢谢

这就是答案:

self.hFooterImagePanel = wx.Panel(self.hPanel, wx.ID_ANY)
self.hFooterImage = wx.StaticBitmap(self.hFooterImagePanel)
self.hFooterImage.SetBitmap(wx.Bitmap("img/tick.png"))
self.hFooterStatusLabel = wx.StaticText(self.hPanel, label = 'Ready')
self.hFooterBox = wx.BoxSizer(wx.HORIZONTAL)
self.hFooterBox.Add(self.hFooterImagePanel, 0, wx.ALL | wx.ALIGN_LEFT, 5)
self.hFooterBox.Add(self.hFooterStatusLabel, 0, wx.ALL | wx.ALIGN_LEFT, 5)