When I run the program togglebutton.py found at http://zetcode.com/wxpython/widgets/#togglebutton the toggle buttons
don't change the color of the panel... it just stays black. The
SetBackgroundColour function does nothing.
I'm running 32 bit 2.7 python on 64 bit windows 7. Any ideas why this
simple program doesn't work for me?
Also I'd like to know if there is a way to reference a toggle button
(widget) using only its ID number. I'm creating a program with 13 x
13 = 169 toggle buttons (one for each starting hand in Texas Hold'em
Poker) and I want to make a reset button that turns all the toggle
buttons off. Do I really have to create 169 generated names bound to
self?
When I run the program togglebutton.py found at http://zetcode.com/wxpython/widgets/#togglebutton the toggle buttons
don't change the color of the panel... it just stays black. The
SetBackgroundColour function does nothing.
If you call self.panel.Refresh() after self.panel.SetBackgroundColour(self.colour) the panel won't stay black.
I'm running 32 bit 2.7 python on 64 bit windows 7. Any ideas why this
simple program doesn't work for me?
Also I'd like to know if there is a way to reference a toggle button
(widget) using only its ID number. I'm creating a program with 13 x
13 = 169 toggle buttons (one for each starting hand in Texas Hold'em
Poker) and I want to make a reset button that turns all the toggle
buttons off. Do I really have to create 169 generated names bound to
self?
But if you are going to keep all those ids somewhere you might as well keep the references to toggle buttons in stead. You don have to assign them to self, you could put them in a list of lists for example and assign that list to self.
self.toggle_buttons = [
[wx.ToggleButton(...) for col in range(13)]
for row in range(13)
]
self.toggle_buttons[3][6].SetValue(True)
Toni
ยทยทยท
On Sun, 13 Nov 2011 01:15:03 +0100, Edicted <n8god1337@gmail.com> wrote: