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.

Advanced widgetshttp://www.zetcode.com/wxpython/advanced/close = wx.BitmapButton(header, -1, wx.Bitmap('icons/fileclose.png', wx.BITMAP_TYPE_PNG),style=wx.NO_BORDER)close.SetBackgroundColour('#6f6a59')<strong>The</strong> bitmap button style is set to wx.NO_BORDER. <strong>The</strong> background color isset to the color of the header panel. This is done in order to make the buttonappear as a part of the header.help = html.HtmlWindow(self.panelRight, -1, style=wx.NO_BORDER)help.LoadPage('help.html')We create a wx.html.HtmlWindow widget on the right panel. We have ourhtml code in a separate file. This time we call the LoadPage() method toobtain the html code.self.panelLeft.SetFocus()We set focus on the left panel. We can launch the help window with the F1key. In order to control a window with a keyboard, it must have the focus. Ifwe did not set the focus, we would have to first click on the panel and onlythen we could launch the help window with the F1 key press.def OnHelp(self, event):self.splitter.SplitVertically(self.panelLeft, self.panelRight)self.panelLeft.SetFocus()To show the help window, we call the OnHelp() method. It splits the twopanels vertically. We must not forget to set the focus again, because theinitial focus is lost by splitting.<strong>The</strong> following is the html file, that we load in our application.Table of ContentsBasic statisticsAdvanced statisticsIntroducing NewtWorking with chartsPredicting valuesNeural networksGlossaryBasic StatisticsOverview of elementary concepts in statistics.Variables. Correlation. Measurement scales. Statistical significance.Distributions. Normality assumption.8 de 21 27/04/2008 1:05

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

Saved successfully!

Ooh no, something went wrong!