Hi all,
I'm pretty new to (wx)Python so plz. don't shoot me if I've missed
something obvious ;). I have a panel inside a frame, on which a Button
and a StaticText is placed:
self.panel = wx.Panel(self,-1)
self.button = wx.Button(self. panel,-1,"Klikkerdekli k")
self.button.Set Position((200,4 0))
self.Bind(wx.EV T_BUTTON, self.VeranderLa bel, self.button)
self.text1 = wx.StaticText(s elf.panel, -1, "Dikke Henk en gekke
Greetje", size=(100,50), pos=(15,20), style=wx.RAISED _BORDER)
and via the even handler I try to give StaticText a different style:
def VeranderLabel(s elf, event):
if self.text1.GetW indowStyle() == wx.SUNKEN_BORDE R:
self.text1.SetW indowStyle(wx.R AISED_BORDER)
self.text1.Refr esh()
self.text1.Upda te()
else:
self.text1.SetW indowStyle(wx.S UNKEN_BORDER)
self.text1.Refr esh()
self.text1.Upda te()
Although the style is indeed updated (checked by printing style to
console) the appearance of the StaticText stays the same. What am I
missing here?
Thanks in advance.
- Kees
I'm pretty new to (wx)Python so plz. don't shoot me if I've missed
something obvious ;). I have a panel inside a frame, on which a Button
and a StaticText is placed:
self.panel = wx.Panel(self,-1)
self.button = wx.Button(self. panel,-1,"Klikkerdekli k")
self.button.Set Position((200,4 0))
self.Bind(wx.EV T_BUTTON, self.VeranderLa bel, self.button)
self.text1 = wx.StaticText(s elf.panel, -1, "Dikke Henk en gekke
Greetje", size=(100,50), pos=(15,20), style=wx.RAISED _BORDER)
and via the even handler I try to give StaticText a different style:
def VeranderLabel(s elf, event):
if self.text1.GetW indowStyle() == wx.SUNKEN_BORDE R:
self.text1.SetW indowStyle(wx.R AISED_BORDER)
self.text1.Refr esh()
self.text1.Upda te()
else:
self.text1.SetW indowStyle(wx.S UNKEN_BORDER)
self.text1.Refr esh()
self.text1.Upda te()
Although the style is indeed updated (checked by printing style to
console) the appearance of the StaticText stays the same. What am I
missing here?
Thanks in advance.
- Kees
Comment