def create_main_box(window, configpath, tlp_config_items) -> Gtk.Box: notebook = Gtk.Notebook() notebook.set_tab_pos(Gtk.PositionType.TOP) settingsbox = create_settings_box(window, configpath, tlp_config_items) configbox = create_config_box(tlp_config_items) contentbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12) contentbox.set_margin_top(18) contentbox.set_margin_bottom(18) contentbox.set_margin_left(18) contentbox.set_margin_right(18) contentbox.pack_start(settingsbox, False, False, 0) contentbox.pack_start(configbox, True, True, 0) configlabel = Gtk.Label('TLP config') configlabel.set_hexpand(True) statlabel = Gtk.Label('TLP stat') statlabel.set_hexpand(True) statbox = create_stat_box() notebook.append_page(contentbox, configlabel) notebook.append_page(statbox, statlabel) mainbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) mainbox.pack_start(notebook, True, True, 0) return mainbox
def create_main_box(window) -> Gtk.Box: notebook = Gtk.Notebook() notebook.set_tab_pos(Gtk.PositionType.TOP) fileentry = Gtk.Label(settings.tlpconfigfile) fileentry.set_alignment(0, 0.5) menubox = create_menu_box(window, fileentry) settingsbox = create_settings_box(window, fileentry) configbox = create_config_box(window) contentbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12) contentbox.set_margin_top(18) contentbox.set_margin_bottom(18) contentbox.set_margin_left(18) contentbox.set_margin_right(18) contentbox.pack_start(settingsbox, False, False, 0) contentbox.pack_start(configbox, True, True, 0) configlabel = Gtk.Label(language.MT_('Configuration')) configlabel.set_hexpand(True) statlabel = Gtk.Label(language.MT_('Statistics')) statlabel.set_hexpand(True) statbox = create_stat_box() notebook.append_page(contentbox, configlabel) notebook.append_page(statbox, statlabel) mainbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) mainbox.pack_start(menubox, False, False, 0) mainbox.pack_start(notebook, True, True, 0) return mainbox