source: sasview/src/sans/guiframe/documentation_window.py @ c3437260

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since c3437260 was c3437260, checked in by Peter Parker, 9 years ago

Refs #221 - Add extra help menu item if wxPython 2.9 or higher is present. This button just opens up a viewer on the index.html page of the Sphinx documentation. Note the slight implementation detail of using os.environ to track whether or not run.py has been used to run SasView? 'in-place'. In this case the documentation is in a different place relative to the main sansview.py entry point of the program.

  • Property mode set to 100644
File size: 688 bytes
Line 
1import wx
2from wx import Frame
3
4wx_supports_html2 = float(wx.__version__[:3]) >= 2.9
5if wx_supports_html2:
6    import wx.html2 as html
7else:
8    import wx.html as html
9
10class DocumentationWindow(Frame):
11    def __init__(self, parent, id, path, title='Help', size=(850, 540)):
12        Frame.__init__(self, parent, id, title, size=size)
13
14        if wx_supports_html2:
15            # Complete HTML/CSS support!
16            self.view = html.WebView.New(self)
17            self.view.LoadURL("file://" + path)
18        else:
19            # This ain't gonna be pretty...
20            self.view = html.HtmlWindow(self, -1, style=wx.NO_BORDER)
21            self.view.LoadPage(path)
Note: See TracBrowser for help on using the repository browser.