13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>wxPython</strong> widgetshttp://www.zetcode.com/wxpython/widgets/def ToggleGreen(self, event):red = self.colour.Red()blue = self.colour.Blue()if self.colour.Green():self.colour.Set(red, 0, blue)else:self.colour.Set(red, 255, blue)self.panel.SetBackgroundColour(self.colour)def ToggleBlue(self, event):red = self.colour.Red()green = self.colour.Green()if self.colour.Blue():self.colour.Set(red, green, 0)else:self.colour.Set(red, green, 255)self.panel.SetBackgroundColour(self.colour)app = wx.App()ToggleButtons(None, -1, 'togglebuttons.py')app.MainLoop()wx.BitmapButtonA bitmap button is a button, that displays a bitmap. A bitmapbutton can have three other states. Selected, focused anddisplayed. We can set a specific bitmap for those states. A videoplayer is a nice example, where bitmap buttons are used. We cansee play, pause, next, previous and volume bitmap buttons there.So we create a skeleton of a video player in our next example.Figure: Player.py4 de 29 27/04/2008 1:04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!