def __init__(self): gtk.Window.__init__(self) #self.set_default_size(400,300) self.connect("destroy", self.exit) self.set_border_width(3) self.password = None self.notebook = gtk.Notebook() self.add(self.notebook) self.notebook.set_tab_pos(gtk.POS_TOP) self.notebook.show_tabs = True self.notebook.show_border = False self.setup()
def __host(self): tabs = gtk.Notebook() tabs.append_page(self.__tab_databases(), gtk.Label(_("Databases (%d)"))) tabs.append_page(self.__tab_variables(), gtk.Label(_("Variables (%d)"))) tabs.append_page(self.__tab_status(), gtk.Label(_("Status (%s)"))) tabs.append_page(self.__tab_processes(), gtk.Label(_("Processes (%s)"))) tabs.append_page(self.__tab_command_statics(), gtk.Label(_("Command-Statistics (%d)"))) return tabs
def __init__(self, taskmodel, handler, configurator, prefs, layers, mach): gtk.Window.__init__(self) # global state self.curr_mach = mach self.machine_handler_id = None self.image_combo_id = None self.generating = False self.files_to_clean = [] self.selected_image = None self.selected_packages = None self.stopping = False self.model = taskmodel self.model.connect("tasklist-populated", self.update_model) self.model.connect("image-changed", self.image_changed_string_cb) self.handler = handler self.configurator = configurator self.prefs = prefs self.layers = layers self.save_path = None self.dirty = False self.build_succeeded = False self.connect("delete-event", self.destroy_window) self.set_title("Image Creator") self.set_icon_name("applications-development") self.set_default_size(1000, 650) self.build = RunningBuild(sequential=True) self.build.connect("build-failed", self.running_build_failed_cb) self.build.connect("build-succeeded", self.running_build_succeeded_cb) self.build.connect("build-started", self.build_started_cb) self.build.connect("build-complete", self.build_complete_cb) vbox = gtk.VBox(False, 0) vbox.set_border_width(0) vbox.show() self.add(vbox) self.menu = self.create_menu() vbox.pack_start(self.menu, False) createview = self.create_build_gui() self.back = None self.cancel = None buildview = self.view_build_gui() self.nb = gtk.Notebook() self.nb.append_page(createview) self.nb.append_page(buildview) self.nb.set_current_page(0) self.nb.set_show_tabs(False) vbox.pack_start(self.nb, expand=True, fill=True)
def do_init(self): """ Constructor. @param cb: An instance of the application class. @type cb: pida.main.Application """ # main window self.win = gtk.Window() self.win.set_title('PIDA Configuration Editor') self.win.set_transient_for(self.pida.mainwindow) self.win.connect('destroy', self.cb_cancel) # top container hbox = gtk.HBox() self.win.add(hbox) self.lmodel = gtk.ListStore(str, int) self.tree = ListTree(self) hbox.pack_start(self.tree, expand=False, padding=6) vbox = gtk.VBox() hbox.pack_start(vbox) # notebook self.nb = gtk.Notebook() vbox.pack_start(self.nb, padding=4) self.nb.set_show_tabs(False) # Button Bar cb = gtk.HBox() vbox.pack_start(cb, expand=False, padding=2) # separator sep = gtk.HSeparator() cb.pack_start(sep) # cancel button self.cancel_b = gtk.Button(stock=gtk.STOCK_CANCEL) cb.pack_start(self.cancel_b, expand=False) self.cancel_b.connect('clicked', self.cb_cancel) # reset button self.reset_b = gtk.Button(stock=gtk.STOCK_UNDO) cb.pack_start(self.reset_b, expand=False) self.reset_b.connect('clicked', self.cb_reset) # apply button self.apply_b = gtk.Button(stock=gtk.STOCK_APPLY) cb.pack_start(self.apply_b, expand=False) self.apply_b.connect('clicked', self.cb_apply) # save button self.save_b = gtk.Button(stock=gtk.STOCK_SAVE) cb.pack_start(self.save_b, expand=False) self.save_b.connect('clicked', self.cb_save) self.controls = {} self.setopts() self.initialize()
def create_visual_elements(self): self.nb = gtk.Notebook() self.nb.set_show_tabs(True) self.nb.append_page(self.create_build_environment_page(), gtk.Label("Build environment")) self.nb.append_page(self.create_shared_state_page(), gtk.Label("Shared state")) self.nb.append_page(self.create_network_page(), gtk.Label("Network")) self.nb.append_page(self.create_others_page(), gtk.Label("Others")) self.nb.set_current_page(0) self.vbox.pack_start(self.nb, expand=True, fill=True) self.vbox.pack_end(gtk.HSeparator(), expand=True, fill=True) self.show_all()
def __init__(self, window): gtk.Dialog.__init__(self, _('Comments'), window, 0, (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) self.set_has_separator(False) self.set_resizable(True) self.connect('response', _close_dialog) self.set_default_response(gtk.RESPONSE_CLOSE) self.set_default_size(600, 550) notebook = gtk.Notebook() notebook.set_scrollable(True) self.set_border_width(4) notebook.set_border_width(6) self.vbox.pack_start(notebook) tag = gtk.TextTag() tag.set_property('editable', False) tag.set_property('editable-set', True) tag.set_property('family', 'Monospace') tag.set_property('family-set', True) tag.set_property('scale', 0.9) tag.set_property('scale-set', True) tag_table = gtk.TextTagTable() tag_table.add(tag) for num in range(1, window.file_handler.get_number_of_comments() + 1): page = gtk.VBox(False) page.set_border_width(8) scrolled = gtk.ScrolledWindow() scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) page.pack_start(scrolled) outbox = gtk.EventBox() scrolled.add_with_viewport(outbox) inbox = gtk.EventBox() inbox.set_border_width(6) outbox.add(inbox) name = os.path.basename(window.file_handler.get_comment_name(num)) text = window.file_handler.get_comment_text(num) if text is None: text = _('Could not read {}').format(num) text_buffer = gtk.TextBuffer(tag_table) text_buffer.set_text(encoding.to_unicode(text)) text_buffer.apply_tag(tag, *text_buffer.get_bounds()) text_view = gtk.TextView(text_buffer) inbox.add(text_view) bg_color = text_view.get_default_attributes().bg_color outbox.modify_bg(gtk.STATE_NORMAL, bg_color) tab_label = gtk.Label(encoding.to_unicode(name)) notebook.insert_page(page, tab_label) self.show_all()
def __init__(self, platform): """ MainWindow contructor Setup the menu, toolbar, flowgraph editor notebook, block selection window... """ self._platform = platform #setup window gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) vbox = gtk.VBox() self.hpaned = gtk.HPaned() self.add(vbox) #create the menu bar and toolbar self.add_accel_group(Actions.get_accel_group()) vbox.pack_start(Bars.MenuBar(), False) vbox.pack_start(Bars.Toolbar(), False) vbox.pack_start(self.hpaned) #create the notebook self.notebook = gtk.Notebook() self.page_to_be_closed = None self.current_page = None self.notebook.set_show_border(False) self.notebook.set_scrollable(True) #scroll arrows for page tabs self.notebook.connect('switch-page', self._handle_page_change) #setup containers self.flow_graph_vpaned = gtk.VPaned() #flow_graph_box.pack_start(self.scrolled_window) self.flow_graph_vpaned.pack1(self.notebook) self.hpaned.pack1(self.flow_graph_vpaned) self.btwin = BlockTreeWindow(platform, self.get_flow_graph) self.hpaned.pack2(self.btwin, False) #dont allow resize #create the reports window self.text_display = TextDisplay() #house the reports in a scrolled window self.reports_scrolled_window = gtk.ScrolledWindow() self.reports_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.reports_scrolled_window.add(self.text_display) self.reports_scrolled_window.set_size_request( -1, DEFAULT_REPORTS_WINDOW_WIDTH) self.flow_graph_vpaned.pack2(self.reports_scrolled_window, False) #dont allow resize #load preferences and show the main window Preferences.load(platform) self.resize(*Preferences.main_window_size()) self.flow_graph_vpaned.set_position( Preferences.reports_window_position()) self.hpaned.set_position(Preferences.blocks_window_position()) self.show_all() self.reports_scrolled_window.hide() self.btwin.hide()
def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_title("Notebook") self.window.connect("delete_event", self.delete_event) self.window.set_border_width(12) self.window.resize(400, 400) notebook = gtk.Notebook() notebook.append_page(gtk.Button("Contents 1"), gtk.Label("Tab 1")) notebook.append_page(gtk.Label("Contents 2"), gtk.Label("Tab 2")) self.window.add(notebook) notebook.show_all() self.window.show()
def __init__(self,activity): self.terminal_notebook = gtk.Notebook() self._create_tab({'cwd':self.sugar_bundle_path}) self._create_tab({'cwd':self.activity_playpen}) #start the debugger user interface #12/2010 note: tried threads again, very confusing results, disable for !st release #alias_cmd = 'alias go="%s/bin/ipython.py -gthread"\n'%(self.sugar_bundle_path,) go_cmd = _('go') alias_cmd = 'alias %s="%s/bin/ipython.py "\n'%(go_cmd,self.sugar_bundle_path,) self.feed_virtual_terminal(0,alias_cmd) #self.feed_virtual_terminal(0,'%s/bin/ipython.py -gthread\n'%self.sugar_bundle_path) self.feed_virtual_terminal(0,'clear\n%s/bin/ipython.py \n'%self.sugar_bundle_path)
def __init__(self, pwxyz): """sr is a SurfRenderer""" gtk.Window.__init__(self) self.set_title('Surface renderer properties') #self.sr = sr #self.interactorStyle = self.sr.GetInteractorStyle() #self.sr.AddObserver('KeyPressEvent', self.key_press) self.pwxyz = pwxyz self.notebook = gtk.Notebook() self.notebook.show() vbox = gtk.VBox() vbox.show() vbox.pack_start(self.notebook, True, True) self.add(vbox) self._make_intensity_frame() self._make_camera_control() self._make_seqment_props_frame() self._make_pipeline_frame() self._make_picker_frame() def hide(*args): self.hide() return True self.connect('delete_event', hide) # action area hbox = gtk.HBox() hbox.show() vbox.pack_start(hbox, True, True) button = gtk.Button(stock=gtk.STOCK_CANCEL) button.show() button.connect('clicked', hide) hbox.pack_start(button, True, True) button = ButtonAltLabel('Render', gtk.STOCK_EXECUTE) button.show() #button.connect('clicked', self.render) hbox.pack_start(button, True, True) button = gtk.Button(stock=gtk.STOCK_OK) button.show() button.connect('clicked', hide) hbox.pack_start(button, True, True)
def restart(self): if self.nbook is not None: self.nbook.destroy() self.catbox.destroy() self.nbook = gtk.Notebook() self.nbook.set_show_tabs(False) self.nbook.set_border_width(0) self.nbook.show() self.catbox = gtk.VBox() self.catbox.show() self.catbox.set_spacing(1) self.catbox.set_border_width(1) self.catbox.show() self.mainbox.pack_start(self.catbox, False, False) self.mainbox.pack_start(self.nbook, False, False) self.create_menu() self.catbox.get_children()[0].set_relief(gtk.RELIEF_HALF) if self.entry: for child in self.entrybox.get_children(): child.destroy() self.entry = None if self.settings['run']: self.fl = FileListing(PATH) self.entry = gtk.Entry() self.entry.show() #~ self.entry.set_max_length(150) self.entry.set_width_chars(45) completion = gtk.EntryCompletion() self.entry.set_completion(completion) completion_model = self.create_completion_model() completion.set_model(completion_model) completion.set_text_column(0) self.entry.connect("activate", self.enter_callback) btn = Core.image_button(None, 'images/plugins/run.png', 24) btn.connect("clicked", self.enter_callback) btn.set_focus_on_click(False) self.entrybox.pack_start(self.entry, True, True) self.entrybox.pack_start(btn, False, False)
def __init__(self, teacher, no_notebook=False): gtk.VBox.__init__(self) cfg.ConfigUtils.__init__(self, teacher.m_exname) assert type(no_notebook) == bool self._std_buttons = [] self.m_key_bindings = {} self.m_t = teacher vbox = gtk.VBox() vbox.set_spacing(gu.PAD) vbox.set_border_width(gu.PAD) vbox.show() self.practise_box = gtk.VBox() self.practise_box.show() vbox.pack_start(self.practise_box, False) box = gtk.VBox() self.practise_box.pack_start(box, False, padding=gu.hig.SPACE_LARGE) box.show() self.g_lesson_heading = gtk.Label() box.pack_start(self.g_lesson_heading) self.g_lesson_description = gtk.Label() self.g_lesson_description.set_line_wrap(True) box.pack_start(self.g_lesson_description) self.action_area = gtk.HBox() self.action_area.show() vbox.pack_start(self.action_area, False) self.config_box = gtk.VBox() self.config_box.set_border_width(gu.PAD) self.config_box.show() self.config_box_sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) if no_notebook: self.pack_start(vbox) self.pack_start(self.config_box, False) self.g_notebook = None else: self.g_notebook = gtk.Notebook() self.pack_start(self.g_notebook) self.g_notebook.append_page(vbox, gtk.Label(_("Practise"))) self.g_notebook.append_page(self.config_box, gtk.Label(_("Config"))) self.g_notebook.show() self.g_cancel_test = gtk.Button(_("_Cancel test")) self.g_cancel_test.connect('clicked', self.on_cancel_test) self.action_area.pack_end(self.g_cancel_test, False)
def __init__(self, app): gtk.Window.__init__(self) self.app = app vbox = gtk.VBox(False, 0) self.mb = AppMenubar(self) vbox.pack_start(self.mb, False, False, 0) self.toolbar = AppToolbar(self) vbox.pack_start(self.toolbar, False, False, 0) #---CENTRAL PART hbox = gtk.HBox(False, 0) self.tools_frame = gtk.EventBox() self.tools = AppTools(self) hbox.pack_start(self.tools_frame, False, False, 1) self.nb_frame = gtk.EventBox() self.nb_splash = SplashArea(self) hbox.pack_start(self.nb_frame, True, True, 1) self.nb = gtk.Notebook() self.nb_frame.add(self.nb_splash) self.nb.connect('switch-page', self.change_doc) self.nb.set_property('scrollable', True) vbox.pack_start(hbox, True, True, 2) #---CENTRAL PART self.statusbar = AppStatusbar(self) vbox.pack_end(self.statusbar, expand=False) self.palette = Palette(self) vbox.pack_end(self.palette, False, False, 0) self.add(vbox) self.set_win_title() self.set_size_request(config.mw_min_width, config.mw_min_height) self.set_default_size(config.mw_width, config.mw_height) self.set_position(gtk.WIN_POS_CENTER) self.connect("delete-event", self.exit) self.add_accel_group(self.app.accelgroup) icon = os.path.join(config.resource_dir, 'app_icon.png') self.set_icon_from_file(icon) self.show_all() if config.mw_maximized: self.window.maximize()
def __init__(self): qtwindow.QTWindow.__init__(self, 'control', 'Instrument Control') self.connect("delete-event", self._delete_event_cb) self._set_frame = QTSetInstrumentFrame() self._manage_frame = QTManageInstrumentFrame() self._create_frame = QTCreateInstrumentFrame() self._notebook = gtk.Notebook() self._notebook.append_page(self._set_frame, gtk.Label(_L('Set'))) self._notebook.append_page(self._manage_frame, gtk.Label(_L('Manage'))) self._notebook.append_page(self._create_frame, gtk.Label(_L('Create'))) self._notebook.show_all() self._notebook.set_current_page(0) self.add(self._notebook)
def __init__(self, admingtk): """ @param admingtk: the GTK Admin with its nodes @type admingtk: L{flumotion.component.base.admin_gtk.BaseAdminGtk} """ self._debugEnabled = False self._admingtk = admingtk self._notebook = None self._pageWidgets = {} self._notebook = gtk.Notebook() admingtk.setup() self.nodes = admingtk.getNodes() self._appendPages() self._notebook.show()
def setup_context_menu(self): self.preferences_notebook = gtk.Notebook() self.preferences_notebook.props.border_width = 6 self.applet.dialog.new("preferences").vbox.add(self.preferences_notebook) prefs = gtk.Builder() prefs.add_from_file(ui_file) self.binder = self.applet.settings.get_binder(prefs) self.setup_general_preferences(prefs) self.setup_plugins_preferens(prefs) # Now do the actual binding: bind the keys to their Gtk+ widgets self.applet.settings.load_bindings(self.binder)
def __init__(self, handle): super(Activity, self).__init__(handle) self.paused = False watch = gtk.gdk.Cursor(gtk.gdk.WATCH) self.window.set_cursor(watch) self.p = gtk.VPaned() self.p.connect("notify::position", self.redraw) self.box = gtk.Notebook() self.p.pack2(self.box) self.p.show() self.box.set_show_tabs(False) self.splash = gtk.Image() pixbuf = gtk.gdk.pixbuf_new_from_file("images/splash-colgadito.png") screen = self.window.get_screen() width, height = screen.get_width(), screen.get_height() - style.GRID_CELL_SIZE pixbuf = pixbuf.scale_simple(width, height, gtk.gdk.INTERP_BILINEAR) self.splash.set_from_pixbuf(pixbuf) self.splash.show() eb = gtk.EventBox() eb.add(self.splash) eb.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white")) eb.show() self.box.append_page(eb, gtk.Label("Inicio")) self._pygamecanvas = sugargame2.canvas.PygameCanvas(self) self._pygamecanvas.set_flags(gtk.EXPAND) self._pygamecanvas.set_flags(gtk.FILL) self.connect("visibility-notify-event", self.redraw) self._pygamecanvas.set_events(gtk.gdk.BUTTON_PRESS_MASK) self._pygamecanvas.connect("button-press-event", self._pygamecanvas.grab_focus) self.box.append_page(self._pygamecanvas, gtk.Label("Juego")) self.box.show() self.set_canvas(self.p) gobject.timeout_add(300, self.pump) gobject.timeout_add(2000, self.init_interpreter) #gobject.timeout_add(1000, self.build_editor) gobject.timeout_add(1500, self.check_modified) self.build_toolbar() self.credits = None self.editor = None self._pygamecanvas.run_pygame(self.run_game)
def __init__(self, obj, name): window = gtk.Window() window.set_title("Zyfra Debug Browse GTK v" + version) window.connect("delete_event", self.delete_event) window.connect("destroy", self.destroy) window.set_default_size(800, 500) self.notebook = gtk.Notebook() window.add(self.notebook) #self.add_tab(obj, name) window.show_all() zyfra.debug.instance_gtk = True gtk.main() zyfra.debug.instance_gtk = False
def _createWindowCb(self, from_notebook, child, x, y): original_position = self.child_get_property(child, "position") label = self.child_get_property(child, "tab-label") window = gtk.Window() window.set_title(label) window.connect("destroy", self._detachedComponentWindowDestroyCb, child, original_position, label) notebook = gtk.Notebook() notebook.props.show_tabs = False window.add(notebook) window.show_all() # set_uposition is deprecated but what should I use instead? window.set_uposition(x, y) return notebook
def __init__(self, parent, controller=None): self.myparent = parent self.controller = controller self.notebook = gtk.Notebook() self.notebook.set_tab_pos(gtk.POS_TOP) self.company_frames = [] for i, name in enumerate(company_names): self.company_frames.append(self.make_frame(controller, i)) self.notebook.append_page(self.company_frames[i], gtk.Label(name)) self.notebook.show() self.dialog = gtk.Dialog( "Company Dialog", parent.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) self.dialog.vbox.pack_start(self.notebook)
def __init__(self, app, config=None, other_tabs=None, other_widgets=None): gtk.HPaned.__init__(self) self.app = app if other_tabs: notebook = gtk.Notebook() notebook.append_page(self._perspectives(other_widgets), gtk.Label("Views")) for name, widget in other_tabs: notebook.append_page(widget, gtk.Label(name)) self.perspectives.hide_headers() self.pack1(notebook) else: self.pack1(self._perspectives(other_widgets), False) self.config = config self.canvas = Canvas(self.config, zoom=1) self.pack2(self.canvas, True) self.show_all()
def __init__(self, parent, controller): """ parent = the dialog's parent window map = the map whose properties will be displayed """ gtk.Dialog.__init__(self, "", parent, gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) self.notebook = gtk.Notebook() self.createGeneralTab(controller) self.createSaveTab() self.vbox.add(self.notebook) self.show_all()
def definirNotebook(posTIT, lisNOM, lisOBJ, pagSEL): pcd = pango.FontDescription(TXT_FNT_REF) obj = gtk.Notebook() obj.set_scrollable(True) obj.set_show_tabs(True) obj.set_show_border(True) obj.set_tab_pos(posTIT) for ind in range(len(lisNOM)): nom = lisNOM[ind] val = lisOBJ[ind] lab = gtk.Label(nom) lab.modify_font(pcd) obj.append_page(val, lab) obj.set_current_page(pagSEL) obj.show() return obj
def __init__(self, app): gtk.Window.__init__(self) self.app = app vbox = gtk.VBox(False, 0) self.toolbar = AppToolbar(self) vbox.pack_start(self.toolbar, False, False, 0) # ---CENTRAL PART hpaned = gtk.HPaned() hpaned.set_border_width(0) self.nb_frame = gtk.EventBox() self.nb_splash = SplashArea(self) hpaned.pack1(self.nb_frame, True, True) self.nb = gtk.Notebook() self.nb_frame.add(self.nb_splash) self.nb.connect('switch-page', self.change_doc) self.nb.set_property('scrollable', True) # self.nb.set_tab_reorderable(True) self.nb.set_show_border(False) self.tools_frame = gtk.VBox(False, 0) self.tools = AppTools(self) self.tools.set_size_request(200, -1) self.tools_frame.pack_end(self.tools, expand=True) hpaned.pack2(self.tools_frame, True, False) hpaned.set_position(1000) vbox.pack_start(hpaned, True, True, 0) # ---CENTRAL PART END self.add(vbox) self.set_win_title() self.set_size_request(config.mw_min_width, config.mw_min_height) self.set_default_size(config.mw_width, config.mw_height) self.set_position(gtk.WIN_POS_CENTER) self.connect("delete-event", self.exit) self.add_accel_group(self.app.accelgroup) icon = os.path.join(config.resource_dir, 'app_icon.png') self.set_icon_from_file(icon) self.show_all() if config.mw_maximized: self.window.maximize()
def __init__(self, create = True, accel_group = None, tooltips = None): '''建立主窗口和布局 ''' self.mainwindow = gtk.Window(gtk.WINDOW_TOPLEVEL) self.mainwindow.set_icon_name("gimp") self.mainwindow.set_default_size(700, 500) self.mainwindow.maximize() self.mainwindow.set_title(_("GimpBox")) #self.mainwindow.set_position(gtk.WIN_POS_CENTER) self.mainwindow.show() self.mainwindow.connect("delete_event", self.quit) self.screen = wnck.screen_get_default() self.hpaned1 = gtk.HPaned() self.hpaned1.set_position(180) self.hpaned1.show() self.toolboxarea = gtk.Socket() self.toolboxarea.show() self.hpaned1.pack1(self.toolboxarea, False, True) self.hpaned2 = gtk.HPaned() self.hpaned2.show() self.notebook = gtk.Notebook() self.notebook.set_tab_pos(gtk.POS_BOTTOM) self.notebook.popup_enable() self.notebook.set_scrollable(True) self.notebook.show() self.hpaned2.pack1(self.notebook, False, True) self.miscboxarea = gtk.Socket() self.miscboxarea.show() self.hpaned2.pack2(self.miscboxarea, False, False) self.hpaned1.pack2(self.hpaned2, True, True) self.mainwindow.add(self.hpaned1) gobject.idle_add(self.start) #self.toolboxarea.connect('realize', self.start) self.mainwindow.show_all() pass
def __init__(self, session, account): '''constructor''' gui.base.ContactInformation.__init__(self, session, account) gtk.Window.__init__(self) self.set_default_size(640, 350) self.set_title(_('Contact information (%s)') % (account,)) self.set_role("dialog") self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) self.tabs = gtk.Notebook() self._create_tabs() self.tabs.show_all() self.add(self.tabs) self.fill_all()
def TabbedBox(c, box, pos, tabs): notebook = gtk.Notebook() notebook.set_tab_pos(pos) boxes = [] i = 0 for text in tabs: i += 1 label = gtk.Label(text) tab = gtk.VBox(spacing=5) tab.set_border_width(10) notebook.append_page(tab, label) boxes.append(tab) box.pack_start(notebook, False, False, 0) return boxes
def __init__(self): """""" gtk.VBox.__init__(self) self.download_manager = DownloadTree() self.upload_manager = UploadTree() #toolbar toolbar = gtk.Toolbar() self.pack_start(toolbar, False) toolbar.set_style(gtk.TOOLBAR_BOTH) tool_buttons = [ (_("Add Downloads"), media.ICON_DOWNLOAD, lambda x: self.add_downloads), (_("Add Uploads"), media.ICON_UPLOAD, lambda x: self.add_uploads), (None, None, None), (_("Clear Complete"), media.ICON_CLEAR, lambda x: x.clear_cb), (None, None, None), (_("Move Up"), media.ICON_UP, lambda x: x.move_up_cb), (_("Move Down"), media.ICON_DOWN, lambda x: x.move_down_cb), (None, None, None), (_("Start Selected"), media.ICON_START, lambda x: x.start_cb), (_("Stop Selected"), media.ICON_STOP, lambda x: x.stop_cb), ] for name, icon_path, get_callback in tool_buttons: if name == None: item = gtk.SeparatorToolItem() else: icon = gtk.image_new_from_file(icon_path) item = gtk.ToolButton(icon, name) item.connect("clicked", self.manage_callbacks, get_callback) toolbar.insert(item, -1) #notebook self.notebook = gtk.Notebook() self.pack_start(self.notebook) self.notebook.set_show_tabs(False) self.control_buttons = {} self.button_box = gtk.HBox() self.pack_start(self.button_box, False) self.download_id = self.add_page(self.download_manager, gtk.STOCK_GO_DOWN, _("Show Downloads")) self.upload_id = self.add_page(self.upload_manager, gtk.STOCK_GO_UP, _("Show Uploads"))
def __init__(self): import application app = application.get_app() assert app is not None flags = gtk.DIALOG_DESTROY_WITH_PARENT buttons = (_('Save as Default'), RESPONSE_SAVE_AS_DEFAULT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT) windowing.Dialog.__init__(self, app=app, title=_('Background'), parent=app.drawWindow, flags=flags, buttons=buttons) #set up window self.connect('response', self.on_response) notebook = self.nb = gtk.Notebook() self.vbox.pack_start(notebook) #set up patterns tab patterns_scroll = gtk.ScrolledWindow() patterns_scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) notebook.append_page(patterns_scroll, gtk.Label(_('Pattern'))) self.bgl = BackgroundList(self) patterns_scroll.add_with_viewport(self.bgl) def lazy_init(*ignored): if not self.bgl.initialized: self.bgl.initialize() self.connect("realize", lazy_init) #set up colors tab color_vbox = gtk.VBox() notebook.append_page(color_vbox, gtk.Label(_('Color'))) self.cs = gtk.ColorSelection() self.cs.connect('color-changed', self.color_changed_cb) color_vbox.pack_start(self.cs, expand=True) b = gtk.Button(_('Add color to Patterns')) b.connect('clicked', self.add_color_to_patterns_cb) color_vbox.pack_start(b, expand=False)
def build_widget(self): # Create a notebook: notebook = gtk.Notebook() notebook.set_tab_pos(gtk.POS_LEFT) notebook.popup_enable() notebook.set_scrollable(True) notebook.connect('drag-data-received', self.drag_received) notebook.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_ALL, config.data.drag_type['rule'], gtk.gdk.ACTION_COPY) #b=gtk.Button(rule.name) #b.connect('clicked', popup_edit, rule, catalog) #b.show() #vbox.add(b) return notebook