hbox.pack_start(sb1, False, False) hbox.pack_start(sb2, False, False) for i in range(10): testmb = ompButton(None, 'aa', 'bb') vbox.pack_start(testmb, False, False) print i # Add scrolled window. scrolled_window = ScrolledWindow() category_box.pack_start(vvbox, False, False) vvbox.pack_start(scrolled_window, False, False) vvbox.pack_start(hbox, False, False) scrolled_window.add_child(vbox) scrolled_window.set_size_request(160, 540) # Add statusbar. statusbar = Statusbar(36) application.main_box.pack_start(statusbar.status_event_box, False) application.add_move_window_event(statusbar.status_event_box) application.add_toggle_window_event(statusbar.status_event_box) # Run. application.run()
application.set_menu_callback(lambda button: menu.show(get_widget_root_coordinate(button))) # Add navigatebar. navigatebar = Navigatebar( [("navigatebar/nav_recommend.png", "导航1", None), ("navigatebar/nav_repo.png", "导航2", None), ("navigatebar/nav_update.png", "导航3", None), ("navigatebar/nav_uninstall.png", "导航4", None), ("navigatebar/nav_download.png", "导航5", None), ("navigatebar/nav_repo.png", "导航6", None), ("navigatebar/nav_update.png", "导航7", None), ("navigatebar/nav_uninstall.png", "导航8", None), ] ) application.main_box.pack_start(navigatebar.nav_event_box, False) application.add_move_window_event(navigatebar.nav_event_box) application.add_toggle_window_event(navigatebar.nav_event_box) # Add body box. body_box = gtk.HBox() application.main_box.pack_start(body_box, True, True) # Add categorybar. # Note if you add list in categorybar make sure height is multiples of list length. # Otherwise last one item will heighter than Otherwise items. category_box = gtk.HBox() body_box.add(category_box) categorybar = Categorybar([ ("categorybar/word.png", "测试分类", lambda : Tooltip("测试分类", 600, 400)), ("categorybar/win.png", "测试分类", None), ("categorybar/web.png", "测试分类", None),