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

Method __init__

examples/gtk2.py:76–108  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74
75class Gtk2Example:
76 def __init__(self):
77 self.browser = None
78 self.menubar_height = 0
79 self.exiting = False
80
81 self.main_window = gtk.Window(gtk.WINDOW_TOPLEVEL)
82 self.main_window.connect('focus-in-event', self.on_focus_in)
83 self.main_window.connect('configure-event', self.on_configure)
84 self.main_window.connect('destroy', self.on_exit)
85 self.main_window.set_size_request(width=800, height=600)
86 self.main_window.set_title('GTK 2 example (PyGTK)')
87 icon = os.path.join(os.path.dirname(__file__), "resources", "gtk.png")
88 if os.path.exists(icon):
89 self.main_window.set_icon_from_file(icon)
90 self.main_window.realize()
91
92 self.vbox = gtk.VBox(False, 0)
93 self.vbox.connect('size-allocate', self.on_vbox_size_allocate)
94 self.menubar = self.create_menu()
95 self.menubar.connect('size-allocate', self.on_menubar_size_allocate)
96 self.vbox.pack_start(self.menubar, False, False, 0)
97 self.main_window.add(self.vbox)
98
99 # On Linux must show window first before embedding browser
100 # (Issue #347).
101 self.vbox.show()
102 self.main_window.show()
103 self.embed_browser()
104
105 self.vbox.get_window().focus()
106 self.main_window.get_window().focus()
107 if g_message_loop == MESSAGE_LOOP_TIMER:
108 gobject.timeout_add(10, self.on_timer)
109
110 def embed_browser(self):
111 windowInfo = cef.WindowInfo()

Callers

nothing calls this directly

Calls 2

create_menuMethod · 0.95
embed_browserMethod · 0.95

Tested by

no test coverage detected