royer11 moril
asked on
wxpython use wx.StaticBitmap, how to change image from event?
Hi,when I created a StaticBitmap, and a combobox. I had the idea that, as I would to change the image in StaticBitmap, from another event.
From combobox.
my code of StaticBitmap
event of combobox
From combobox.
my code of StaticBitmap
self.m_bitmap1 = wx.StaticBitmap(self, wx.ID_LOGO, wx.Bitmap(u"example.png", wx.BITMAP_TYPE_ANY),
wx.DefaultPosition, wx.DefaultSize, 0)
self.m_bitmap1.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVEBORDER))
self.m_bitmap1.SetToolTip(u"logo of example")
bSizer6.Add(self.m_bitmap1, 0, wx.ALIGN_CENTER | wx.ALL, 5)
event of combobox
def option_combo(self, event):
selection = self.comboBox_Dir.GetSelection()
if selection == 0:
pass # change image in StaticBitmap
#print(selection)
#event.Skip()
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.