MCPcopy Create free account
hub / github.com/cztomczak/cefpython / _InitComponents

Method _InitComponents

src/cefpython3.wx/examples/sample3.py:20–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 self._InitEventHandlers()
19
20 def _InitComponents(self):
21 self.tabs = fnb.FlatNotebook(self, wx.ID_ANY,
22 agwStyle=fnb.FNB_NODRAG|fnb.FNB_X_ON_TAB)
23 # You also have to set the wx.WANTS_CHARS style for
24 # all parent panels/controls, if it's deeply embedded.
25 self.tabs.SetWindowStyleFlag(wx.WANTS_CHARS)
26
27 ctrl1 = chrome.ChromeCtrl(self.tabs, useTimer=True,
28 url="wikipedia.org")
29 ctrl1.GetNavigationBar().GetUrlCtrl().SetEditable(False)
30 ctrl1.GetNavigationBar().GetBackButton().SetBitmapLabel(
31 wx.Bitmap(os.path.join(os.path.dirname(os.path.abspath(__file__)),
32 "back.png"), wx.BITMAP_TYPE_PNG))
33 ctrl1.GetNavigationBar().GetForwardButton().SetBitmapLabel(
34 wx.Bitmap(os.path.join(os.path.dirname(os.path.abspath(__file__)),
35 "forward.png"), wx.BITMAP_TYPE_PNG))
36 ctrl1.GetNavigationBar().GetReloadButton().SetBitmapLabel(
37 wx.Bitmap(os.path.join(os.path.dirname(os.path.abspath(__file__)),
38 "reload_page.png"), wx.BITMAP_TYPE_PNG))
39
40 self.tabs.AddPage(ctrl1, "Wikipedia")
41
42 ctrl2 = chrome.ChromeCtrl(self.tabs, useTimer=True, url="google.com",
43 hasNavBar=False)
44 self.tabs.AddPage(ctrl2, "Google")
45
46 ctrl3 = chrome.ChromeCtrl(self.tabs, useTimer=True, url="greenpeace.org")
47 ctrl3.SetNavigationBar(CustomNavigationBar(ctrl3))
48 self.tabs.AddPage(ctrl3, "Greenpeace")
49
50 def _LayoutComponents(self):
51 sizer = wx.BoxSizer(wx.HORIZONTAL)

Callers 1

__init__Method · 0.95

Calls 7

GetNavigationBarMethod · 0.95
SetNavigationBarMethod · 0.95
CustomNavigationBarClass · 0.85
GetUrlCtrlMethod · 0.80
GetBackButtonMethod · 0.80
GetForwardButtonMethod · 0.80
GetReloadButtonMethod · 0.80

Tested by

no test coverage detected