def __init__(self, pc): gtk.Toolbar.__init__(self) self.activity = pc # C slider self.activity.c_slider = ToolButton("Con") self.activity.c_slider.set_tooltip(_('C')) self.activity.c_slider.props.sensitive = True self.activity.c_slider.connect('clicked', self.activity._c_slider_cb) self.insert(self.activity.c_slider, -1) self.activity.c_slider.show() # A slider self.activity.a_slider = ToolButton("Aoff") self.activity.a_slider.set_tooltip(_('A')) self.activity.a_slider.props.sensitive = True self.activity.a_slider.connect('clicked', self.activity._a_slider_cb) self.insert(self.activity.a_slider, -1) self.activity.a_slider.show() # Label for showing status self.activity.results_label = gtk.Label("1.0 × 1.0 = 1.0") self.activity.results_label.show() self.activity.results_toolitem = gtk.ToolItem() self.activity.results_toolitem.add(self.activity.results_label) self.insert(self.activity.results_toolitem, -1) self.activity.results_toolitem.show()
def __init__(self): gtk.Toolbar.__init__(self) self._zoom_out = ToolButton('zoom-out') self._zoom_out.set_tooltip(_('Zoom out')) self._zoom_out.connect('clicked', self._zoom_out_cb) self.insert(self._zoom_out, -1) self._zoom_out.props.sensitive = False self._zoom_out.show() self._zoom_in = ToolButton('zoom-in') self._zoom_in.set_tooltip(_('Zoom in')) self._zoom_in.connect('clicked', self._zoom_in_cb) self.insert(self._zoom_in, -1) self._zoom_in.props.sensitive = True self._zoom_in.show() spacer = gtk.SeparatorToolItem() spacer.props.draw = False self.insert(spacer, -1) spacer.show() self._fullscreen = ToolButton('view-fullscreen') self._fullscreen.set_tooltip(_('Fullscreen')) self._fullscreen.connect('clicked', self._fullscreen_cb) self.insert(self._fullscreen, -1) self._fullscreen.show()
def __init__(self, handle): activity.Activity.__init__(self, handle) self.toolbox = activity.ActivityToolbox(self) activity_toolbar = self.toolbox.get_activity_toolbar() activity_toolbar.share.props.visible = False activity_toolbar.keep.props.visible = False go_up = ToolButton("gtk-go-up") go_up.props.tooltip = _("Go Up") go_up.show() activity_toolbar.insert(go_up, 2) refresh = ToolButton("gtk-refresh") refresh.props.tooltip = _("Refresh") refresh.show() activity_toolbar.insert(refresh, 2) self.set_toolbox(self.toolbox) self.toolbox.show() widget = filemanager.Widget() go_up.connect("clicked", self.go_up_callback, widget) refresh.connect("clicked", self.refresh_callback, widget) widget.show() current_directory = gio.File(path=os.environ["HOME"]) widget.set_current_directory(current_directory.get_uri()) widget.connect("file-menu", self.file_menu) widget.connect('current-directory-menu', self.current_directory_menu) self.set_canvas(widget) self.show()
def __init__(self): activity.EditToolbar.__init__(self) separator = gtk.SeparatorToolItem() separator.set_draw(False) separator.set_expand(True) self.insert(separator, -1) separator.show() search_item = gtk.ToolItem() self._search_entry = gtk.Entry() self._search_entry.connect('activate', self._search_entry_activate_cb) width = int(gtk.gdk.screen_width() / 3) self._search_entry.set_size_request(width, -1) search_item.add(self._search_entry) self._search_entry.show() self.insert(search_item, -1) search_item.show() self._prev = ToolButton('go-previous-paired') self._prev.set_tooltip(_('Previous')) self._prev.props.sensitive = False self._prev.connect('clicked', self._find_prev_cb) self.insert(self._prev, -1) self._prev.show() self._next = ToolButton('go-next-paired') self._next.set_tooltip(_('Next')) self._next.props.sensitive = False self._next.connect('clicked', self._find_next_cb) self.insert(self._next, -1) self._next.show()
def __init__(self, pc): gtk.Toolbar.__init__(self) self.activity = pc # Play button self.activity.play = ToolButton("media-playback-start") self.activity.play.set_tooltip(_('Play')) self.activity.play.props.sensitive = True self.activity.play.connect('clicked', self.activity._play_cb) self.insert(self.activity.play, -1) self.activity.play.show() # Sound toggle button self.activity.sound = ToolButton("speaker-muted-100") self.activity.sound.set_tooltip(_('Mute')) self.activity.sound.props.sensitive = True self.activity.sound.connect('clicked', self.activity._sound_cb) self.insert(self.activity.sound, -1) self.activity.sound.show() separator = gtk.SeparatorToolItem() separator.set_draw(True) self.insert(separator, -1) separator.show() # Label for showing play status self.activity.level_label = gtk.Label("%s %d" % (_("Level"), 1)) self.activity.level_label.show() self.activity.level_toolitem = gtk.ToolItem() self.activity.level_toolitem.add(self.activity.level_label) self.insert(self.activity.level_toolitem, -1) self.activity.level_toolitem.show()
def __init__(self, web_view): gobject.GObject.__init__(self) self._web_view = web_view self._back = ToolButton('go-previous-paired') self._back.set_tooltip(_('Back')) self._back.props.sensitive = False self._back.connect('clicked', self._go_back_cb) self.insert(self._back, -1) self._back.show() self._forward = ToolButton('go-next-paired') self._forward.set_tooltip(_('Forward')) self._forward.props.sensitive = False self._forward.connect('clicked', self._go_forward_cb) self.insert(self._forward, -1) self._forward.show() home = ToolButton('zoom-home') home.set_tooltip(_('Home')) home.connect('clicked', self._go_home_cb) self.insert(home, -1) home.show() progress_listener = self._web_view.progress progress_listener.connect('location-changed', self._location_changed_cb) progress_listener.connect('loading-stop', self._loading_stop_cb)
def __init__(self): gtk.Toolbar.__init__(self) self._add_separator() self._icon = Icon() self._add_widget(self._icon) self._add_separator() self._title = gtk.Label() self._add_widget(self._title) self._add_separator(True) self.cancel_button = ToolButton('dialog-cancel') self.cancel_button.set_tooltip(_('Cancel')) self.cancel_button.connect('clicked', self.__cancel_button_clicked_cb) self.insert(self.cancel_button, -1) self.cancel_button.show() self.accept_button = ToolButton('dialog-ok') self.accept_button.set_tooltip(_('Ok')) self.accept_button.connect('clicked', self.__accept_button_clicked_cb) self.insert(self.accept_button, -1) self.accept_button.show()
def add_frequency_slider(self, toolbar): ''' Either on the Sound toolbar or the Main toolbar ''' self._freq_stepper_up = ToolButton('freq-high') self._freq_stepper_up.set_tooltip(_('Zoom out')) self._freq_stepper_up.connect('clicked', self._freq_stepper_up_cb) self.activity.adjustmentf = gtk.Adjustment(0.5, self.LOWER, self.UPPER, 0.01, 0.1, 0) self.activity.adjustmentf.connect('value_changed', self.cb_page_sizef) self._freq_range = gtk.HScale(self.activity.adjustmentf) self._freq_range.set_inverted(True) self._freq_range.set_draw_value(False) self._freq_range.set_update_policy(gtk.UPDATE_CONTINUOUS) self._freq_range.set_size_request(120, 15) self._freq_stepper_down = ToolButton('freq-low') self._freq_stepper_down.set_tooltip(_('Zoom in')) self._freq_stepper_down.connect('clicked', self._freq_stepper_down_cb) self._freq_range_tool = gtk.ToolItem() self._freq_range_tool.add(self._freq_range) toolbar.insert(self._freq_stepper_up, -1) toolbar.insert(self._freq_range_tool, -1) toolbar.insert(self._freq_stepper_down, -1) return
def __init__(self): gtk.Toolbar.__init__(self) self.back = ToolButton('go-previous') self.back.set_tooltip(_('Back')) self.back.props.sensitive = False palette = self.back.get_palette() self.prev_page = MenuItem(text_label=_("Previous page")) palette.menu.append(self.prev_page) self.prev_page.show_all() self.back.connect('clicked', self.go_back_cb) self.prev_page.connect('activate', self.go_back_cb) self.insert(self.back, -1) self.back.show() self.forward = ToolButton('go-next') self.forward.set_tooltip(_('Forward')) self.forward.props.sensitive = False palette = self.forward.get_palette() self.next_page = MenuItem(text_label=_("Next page")) palette.menu.append(self.next_page) self.next_page.show_all() self.forward.connect('clicked', self.go_forward_cb) self.next_page.connect('activate', self.go_forward_cb) self.insert(self.forward, -1) self.forward.show() num_page_item = gtk.ToolItem() self._num_page_entry = gtk.Entry() self._num_page_entry.set_text('0') self._num_page_entry.set_alignment(1) self._num_page_entry.connect('insert-text', self._num_page_entry_insert_text_cb) self._num_page_entry.connect('activate', self._num_page_entry_activate_cb) self._num_page_entry.set_width_chars(4) num_page_item.add(self._num_page_entry) self._num_page_entry.show() self.insert(num_page_item, -1) num_page_item.show() total_page_item = gtk.ToolItem() self._total_page_label = gtk.Label() label_attributes = pango.AttrList() label_attributes.insert(pango.AttrSize(14000, 0, -1)) label_attributes.insert( pango.AttrForeground(65535, 65535, 65535, 0, -1)) self._total_page_label.set_attributes(label_attributes) self._total_page_label.set_text(' / 0') total_page_item.add(self._total_page_label) self._total_page_label.show() self.insert(total_page_item, -1) total_page_item.show()
def __init__(self, web_view): gobject.GObject.__init__(self) self._web_view = web_view self._back = ToolButton('go-previous-paired') self._back.set_tooltip(_('Back')) self._back.props.sensitive = False self._back.connect('clicked', self._go_back_cb) self.insert(self._back, -1) self._back.show() self._forward = ToolButton('go-next-paired') self._forward.set_tooltip(_('Forward')) self._forward.props.sensitive = False self._forward.connect('clicked', self._go_forward_cb) self.insert(self._forward, -1) self._forward.show() home = ToolButton('zoom-home') home.set_tooltip(_('Home')) home.connect('clicked', self._go_home_cb) self.insert(home, -1) home.show() self._listener = xpcom.server.WrapObject( ProgressListener(self), interfaces.nsIWebProgressListener) weak_ref = xpcom.client.WeakReference(self._listener) mask = interfaces.nsIWebProgress.NOTIFY_STATE_NETWORK | \ interfaces.nsIWebProgress.NOTIFY_LOCATION self._web_view.web_progress.addProgressListener(self._listener, mask)
def __init__(self, main_area): gtk.Toolbar.__init__(self) self._main_area = main_area tool = ToolButton('zoom-best-fit') tool.set_tooltip(_('Fit to window')) tool.set_accelerator(_('<ctrl>9')) tool.connect('clicked', self.__zoom_tofit_cb) self.insert(tool, -1) tool = ToolButton('zoom-original') tool.set_tooltip(_('Original size')) tool.set_accelerator(_('<ctrl>0')) tool.connect('clicked', self.__zoom_original_cb) self.insert(tool, -1) tool = ToolButton('zoom-out') tool.set_tooltip(_('Zoom out')) tool.set_accelerator(_('<ctrl>minus')) tool.connect('clicked', self.__zoom_out_cb) self.insert(tool, -1) tool = ToolButton('zoom-in') tool.set_tooltip(_('Zoom in')) tool.set_accelerator(_('<ctrl>equal')) tool.connect('clicked', self.__zoom_in_cb) self.insert(tool, -1) self.show_all()
def createToolbox(self): toolbox = activity.ActivityToolbox(self) self.toolbar = gtk.Toolbar() toolbox.add_toolbar(_('Ecomundo'), self.toolbar) self.toolbar.show() self.set_toolbox(toolbox) toolbox.show() self.btnNew = ToolButton('reload') self.btnNew.connect('clicked', self.onBtNewClicked) self.toolbar.insert(self.btnNew, -1) self.btnNew.show() self.btPlay = ToolButton('next') self.btPlay.connect('clicked', self.onBtPlayClicked) self.toolbar.insert(self.btPlay, -1) self.btPlay.show() self.btStop = ToolButton('process-stop') self.btStop.connect('clicked', self.onBtStopClicked) self.toolbar.insert(self.btStop, -1) self.btStop.show() self.btStop.props.sensitive = False; self.btPlay.props.sensitive = True; toolbox.set_current_toolbar(1)
def __init__(self, handle): activity.Activity.__init__(self, handle) self.toolbox = activity.ActivityToolbox(self) activity_toolbar = self.toolbox.get_activity_toolbar() activity_toolbar.share.props.visible = False activity_toolbar.keep.props.visible = False connect = ToolButton("gtk-refresh") connect.props.tooltip = "Conectar" connect.connect("clicked", self.connect_vnc) connect.show() activity_toolbar.insert(connect, 2) fullscreen = ToolButton("view-fullscreen") fullscreen.props.tooltip = "Pantalla Completa" fullscreen.connect("clicked", self.fullscreen_cb) fullscreen.show() activity_toolbar.insert(fullscreen, 2) self.set_toolbox(self.toolbox) self.toolbox.show() area = gtk.ScrolledWindow() area.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) area.show() self.vnc = GRFBWidget() area.add_with_viewport(self.vnc) self.vnc.show() self.set_canvas(area) self.present() self.maximize() self.show()
def __init__(self): gtk.Toolbar.__init__(self) self._back = ToolButton('go-previous') self._back.set_tooltip(_('Back')) self._back.props.sensitive = False self._back.connect('clicked', self._go_back_cb) self.insert(self._back, -1) self._back.show() self._forward = ToolButton('go-next') self._forward.set_tooltip(_('Forward')) self._forward.props.sensitive = False self._forward.connect('clicked', self._go_forward_cb) self.insert(self._forward, -1) self._forward.show() num_page_item = gtk.ToolItem() self._num_page_entry = gtk.Entry() self._num_page_entry.set_text('0') self._num_page_entry.set_alignment(1) self._num_page_entry.connect('insert-text', self._num_page_entry_insert_text_cb) self._num_page_entry.connect('activate', self._num_page_entry_activate_cb) self._num_page_entry.set_width_chars(4) num_page_item.add(self._num_page_entry) self._num_page_entry.show() self.insert(num_page_item, -1) num_page_item.show() total_page_item = gtk.ToolItem() self._total_page_label = gtk.Label() label_attributes = pango.AttrList() label_attributes.insert(pango.AttrSize(14000, 0, -1)) label_attributes.insert(pango.AttrForeground(65535, 65535, 65535, 0, -1)) self._total_page_label.set_attributes(label_attributes) self._total_page_label.set_text(' / 0') total_page_item.add(self._total_page_label) self._total_page_label.show() self.insert(total_page_item, -1) total_page_item.show() downloaded_item = gtk.ToolItem() self._downloaded_label = gtk.Label() self._downloaded_label.set_attributes(label_attributes) self._downloaded_label.set_text('') downloaded_item.add(self._downloaded_label) self._downloaded_label.show() self.insert(downloaded_item, -1) downloaded_item.show()
def _add_speed_slider(self, toolbar): self._speed_stepper_down = ToolButton('speed-down') self._speed_stepper_down.set_tooltip(_('Slow down')) self._speed_stepper_down.connect('clicked', self._speed_stepper_down_cb) self._speed_stepper_down.show() self._adjustment = gtk.Adjustment(200, self.LOWER, self.UPPER, 25, 100, 0) self._adjustment.connect('value_changed', self._speed_change_cb) self._speed_range = gtk.HScale(self._adjustment) self._speed_range.set_inverted(True) self._speed_range.set_draw_value(False) self._speed_range.set_update_policy(gtk.UPDATE_CONTINUOUS) self._speed_range.set_size_request(120, 15) self._speed_range.show() self._speed_stepper_up = ToolButton('speed-up') self._speed_stepper_up.set_tooltip(_('Speed up')) self._speed_stepper_up.connect('clicked', self._speed_stepper_up_cb) self._speed_stepper_up.show() self._speed_range_tool = gtk.ToolItem() self._speed_range_tool.add(self._speed_range) self._speed_range_tool.show() toolbar.insert(self._speed_stepper_down, -1) toolbar.insert(self._speed_range_tool, -1) toolbar.insert(self._speed_stepper_up, -1) return
def __init__(self, btnfunction, loadfunction, win, path="none"): super(Avatars, self).__init__() win.set_title(_('Select a avatar')) win.set_decorated(False) win.set_position(gtk.WIN_POS_CENTER) y = gtk.gdk.screen_height() - 100 win.set_size_request(gtk.gdk.screen_width() - 100, y) self.win = win scroll = gtk.ScrolledWindow() scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.hbox = gtk.HBox() self.show_all() self.function = btnfunction self.a = 0 self.vbx = gtk.VBox() self.vbx.pack_start(self.hbox, False, False, 6) self.eventbox = gtk.EventBox() self.eventbox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('white')) self.eventbox.add(self.vbx) scroll.add_with_viewport(self.eventbox) #### # Sugar Style #### tl = gtk.Toolbar() tl.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black')) self.loadfromjournal = ToolButton('open-from-journal') self.loadfromjournal.set_tooltip(_('Load from journal')) self.loadfromjournal.connect('clicked', loadfunction, win) self.accept = ToolButton('dialog-ok') self.accept.set_tooltip(_('Accept')) self.cancel = ToolButton('gtk-cancel') self.cancel.set_tooltip(_('Cancel')) self.cancel.connect('clicked', lambda x: win.destroy()) sep = gtk.SeparatorToolItem() sep.set_expand(True) sep.props.draw = False tl.insert(self.loadfromjournal, 0) tl.insert(sep, 1) tl.insert(self.accept, 2) tl.insert(self.cancel, 3) tl.set_size_request(55, -1) self.pack_start(tl, False, False, 0) self.eventbox.add(scroll) self.pack_end(scroll, True, True, 0) #### self.path = None self.actual = None for x in os.listdir('avatars'): if path != "none": if path == os.path.join(os.getcwd(), 'avatars', x): sensitive = False else: sensitive = True else: sensitive = True self._gen_avatars(x, sensitive) gobject.timeout_add(10, self._check)
def __init__(self, parent_xid, dialog_title): gtk.Window.__init__(self) self.connect('realize', self.__realize_cb) self.set_decorated(False) self.set_position(gtk.WIN_POS_CENTER_ALWAYS) self.set_border_width(style.LINE_WIDTH) width = gtk.gdk.screen_width() - style.GRID_CELL_SIZE * 4 height = gtk.gdk.screen_height() - style.GRID_CELL_SIZE * 4 self.set_size_request(width, height) self._parent_window_xid = parent_xid _vbox = gtk.VBox(spacing=2) self.add(_vbox) self.toolbar = gtk.Toolbar() label = gtk.Label() label.set_markup('<b> %s</b>' % dialog_title) label.set_alignment(0, 0.5) tool_item = gtk.ToolItem() tool_item.add(label) label.show() self.toolbar.insert(tool_item, -1) tool_item.show() separator = gtk.SeparatorToolItem() separator.props.draw = False separator.set_expand(True) self.toolbar.insert(separator, -1) separator.show() stop = ToolButton(icon_name='dialog-cancel') stop.set_tooltip(_('Cancel')) stop.connect('clicked', lambda *w: self.destroy()) self.toolbar.insert(stop, -1) stop.show() delete = ToolButton(icon_name='edit-delete') delete.set_tooltip(_('Delete')) delete.connect('clicked', self.accept_clicked_delete_cb) self.toolbar.insert(delete, -1) delete.show() accept = ToolButton(icon_name='dialog-ok') accept.set_tooltip(_('Ok')) accept.connect('clicked', self.accept_clicked_cb) accept.show() self.toolbar.insert(accept, -1) _vbox.pack_start(self.toolbar, expand=False) self.toolbar.show() self._event_box = gtk.EventBox() _vbox.pack_start(self._event_box, expand=True, fill=True) self._canvas = None
def Boton(tooltip=None, icon=None, connect=None): if icon != None: Boton = ToolButton(icon) else: Boton = ToolButton('gtk-missing-image') if tooltip != None: Boton.set_tooltip(tooltip) if connect != None: Boton.connect("clicked", connect) return Boton
def __init__(self, pc): gtk.Toolbar.__init__(self) self.activity = pc # Ruler self.activity.rulers = ToolButton("ruler") self.activity.rulers.set_tooltip(_('Ruler')) self.activity.rulers.props.sensitive = True self.activity.rulers.connect('clicked', self.activity._rulers_cb) self.insert(self.activity.rulers, -1) self.activity.rulers.show() # Grid self.activity.grids = ToolButton("grid-a") self.activity.grids.set_tooltip(_('Grid')) self.activity.grids.props.sensitive = True self.activity.grids.connect('clicked', self.activity._grids_cb) self.insert(self.activity.grids, -1) self.activity.grids.show() # Angles self.activity.angles = ToolButton("angles-90") self.activity.angles.set_tooltip(_('Angles')) self.activity.angles.props.sensitive = True self.activity.angles.connect('clicked', self.activity._angles_cb) self.insert(self.activity.angles, -1) self.activity.angles.show() # Checker self.activity.checker = ToolButton("checker") self.activity.checker.set_tooltip(_('Checker')) self.activity.checker.props.sensitive = True self.activity.checker.connect('clicked', self.activity._checker_cb) self.insert(self.activity.checker, -1) self.activity.checker.show() if not self.activity.known_dpi: separator = gtk.SeparatorToolItem() separator.set_draw(True) self.insert(separator, -1) separator.show() dpi = self.activity._canvas.get_dpi() self.activity._dpi_spin_adj = gtk.Adjustment( dpi, 72, 200, 2, 32, 0) self.activity._dpi_spin = \ gtk.SpinButton(self.activity._dpi_spin_adj, 0, 0) self.activity._dpi_spin_id = self.activity._dpi_spin.connect( 'value-changed', self.activity._dpi_spin_cb) self.activity._dpi_spin.set_numeric(True) self.activity._dpi_spin.show() self.activity.tool_item_dpi = gtk.ToolItem() self.activity.tool_item_dpi.add(self.activity._dpi_spin) self.insert(self.activity.tool_item_dpi, -1) self.activity.tool_item_dpi.show()
def _load_toolbar(self): toolbar = gtk.Toolbar() # Remove Feed Palette remove_button = ToolButton(icon_name='list-remove') vbox = gtk.VBox() label = gtk.Label(_('Really delete feed?')) vbox.pack_start(label) hbox = gtk.HBox() expander_label = gtk.Label(' ') hbox.pack_start(expander_label) #b = gtk.Button(icon_name='stock-remove') b = ToolButton(icon_name='list-remove') #b.set_use_stock(True) b.connect('clicked', self._on_remove_feed_activate) hbox.pack_start(b, False) vbox.pack_start(hbox) palette = Palette(_('Remove Feed?')) palette.set_content(vbox) vbox.show_all() remove_button.set_palette(palette) toolbar.insert(remove_button, -1) remove_button.show() # Add Feed Palette button = ToolButton(icon_name='list-add') toolbar.insert(button, -1) button.show() self._add_feed_dialog = AddFeedDialog.AddFeedDialog( gtk.glade.XML(os.path.join(self.glade_prefix, 'penguintv.glade'), "window_add_feed", 'penguintv'), self) #MAGIC content = self._add_feed_dialog.extract_content() content.show_all() #button.connect('clicked', self._add_feed_dialog.show) palette = Palette(_('Subscribe to Feed')) palette.set_content(content) button.set_palette(palette) self._feedlist = gtk.ListStore(int, str, str) self._combo = gtk.ComboBox(self._feedlist) cell = gtk.CellRendererText() self._combo.pack_start(cell, True) self._combo.add_attribute(cell, 'text', 1) self._combo.connect("changed", self._on_combo_select) toolcombo = ToolComboBox(self._combo) toolbar.insert(toolcombo, -1) toolcombo.show_all() toolbar.show() return toolbar
def __init__(self, parent, web_view): gobject.GObject.__init__(self) self._help = parent self._web_view = web_view self._back = ToolButton('go-previous-paired') self._back.set_tooltip(_('Back')) self._back.props.sensitive = False self._back.connect('clicked', self._go_back_cb) self.insert(self._back, -1) self._back.show() self._forward = ToolButton('go-next-paired') self._forward.set_tooltip(_('Forward')) self._forward.props.sensitive = False self._forward.connect('clicked', self._go_forward_cb) self.insert(self._forward, -1) self._forward.show() home = ToolButton('zoom-home') home.set_tooltip(_('Home')) home.connect('clicked', self._go_home_cb) self.insert(home, -1) home.show() separator = gtk.SeparatorToolItem() separator.set_draw(False) separator.set_expand(True) self.insert(separator, -1) separator.show() stop_button = ToolButton('activity-stop') stop_button.set_tooltip(_('Stop')) #stop_button.props.accelerator = '<Ctrl>Q' stop_button.connect('clicked', self.__stop_clicked_cb) self.insert(stop_button, -1) stop_button.show() if version < 0.838: self._listener = xpcom.server.WrapObject( EarlyListener(self), interfaces.nsIWebProgressListener) weak_ref = xpcom.client.WeakReference(self._listener) mask = interfaces.nsIWebProgress.NOTIFY_STATE_NETWORK | \ interfaces.nsIWebProgress.NOTIFY_LOCATION self._web_view.web_progress.addProgressListener( self._listener, mask) else: progress_listener = self._web_view.progress progress_listener.connect('location-changed', self._location_changed_cb) progress_listener.connect('loading-stop', self._loading_stop_cb)
def __init__(self): gtk.Toolbar.__init__(self) apply = ToolButton(icon_name='dialog-apply', tooltip=_('Apply')) apply.connect('clicked', self._apply_cb) self.insert(apply, -1) cancel = ToolButton(icon_name='dialog-cancel', tooltip=_('Cancel')) cancel.connect('clicked', self._cancel_cb) self.insert(cancel, -1) self.show_all()
def build_toolbar(self): self.max_participants = 1 toolbox = ToolbarBox() activity_button = ActivityToolbarButton(self) toolbox.toolbar.insert(activity_button, -1) activity_button.show() pano_toolbar = toolbox.toolbar new_button = ToolButton('stock_refresh') new_button.set_tooltip(_('New Panorama')) new_button.connect('clicked', self.new_event) pano_toolbar.insert(new_button, -1) new_button.show() capture_button = ToolButton('add_capture') capture_button.set_tooltip(_('Add a capture to the Panorama')) capture_button.connect('clicked', self.capture_event) pano_toolbar.insert(capture_button, -1) capture_button.show() stitch_button = ToolButton('format-columns-triple') stitch_button.set_tooltip(_('Stitch Panorama')) stitch_button.connect('clicked', self.stitch_event) pano_toolbar.insert(stitch_button, -1) stitch_button.show() stiching_auto = ToolButton('media-playback-start') stiching_auto.set_tooltip(_('Enable auto-stitch')) stiching_auto.connect('clicked', self.change_stich) pano_toolbar.insert(stiching_auto, -1) save_button = ToolButton('filesave') save_button.set_tooltip(_('Save Panorama')) save_button.connect('clicked', self.save_event) pano_toolbar.insert(save_button, -1) save_button.show() separator = gtk.SeparatorToolItem() separator.props.draw = False separator.set_expand(True) pano_toolbar.insert(separator,-1) stop_button = StopButton(self) stop_button.props.accelerator = '<Ctrl>q' pano_toolbar.insert(stop_button, -1) stop_button.show() self.set_toolbar_box(toolbox) toolbox.show_all()
def __init__(self, toolbox, abiword_canvas, parent): gtk.Toolbar.__init__(self) self._toolbox = toolbox self._abiword_canvas = abiword_canvas self._parent = parent self._table = abiword.TableCreator() self._table.set_labels(_('Table'), _('Cancel')) self._table_id = self._table.connect('selected', self._table_cb) self._table.show() tool_item = gtk.ToolItem() tool_item.add(self._table) self.insert(tool_item, -1) tool_item.show_all() self._table_rows_after = ToolButton('row-insert') self._table_rows_after.set_tooltip(_('Insert Row')) self._table_rows_after_id = self._table_rows_after.connect( 'clicked', self._table_rows_after_cb) self.insert(self._table_rows_after, -1) self._table_rows_after.show() self._table_delete_rows = ToolButton('row-remove') self._table_delete_rows.set_tooltip(_('Delete Row')) self._table_delete_rows_id = self._table_delete_rows.connect( 'clicked', self._table_delete_rows_cb) self.insert(self._table_delete_rows, -1) self._table_delete_rows.show() self._table_cols_after = ToolButton('column-insert') self._table_cols_after.set_tooltip(_('Insert Column')) self._table_cols_after_id = self._table_cols_after.connect( 'clicked', self._table_cols_after_cb) self.insert(self._table_cols_after, -1) self._table_cols_after.show() self._table_delete_cols = ToolButton('column-remove') self._table_delete_cols.set_tooltip(_('Delete Column')) self._table_delete_cols_id = self._table_delete_cols.connect( 'clicked', self._table_delete_cols_cb) self.insert(self._table_delete_cols, -1) self._table_delete_cols.show() self._abiword_canvas.connect('table-state', self._isTable_cb) ####btn salir del barrido del menu item self._btn_barrido_menu = ToolButton() self._btn_barrido_menu.set_tooltip(_('Salir \nMenú')) self._btn_barrido_menu_id = self._btn_barrido_menu.connect( 'clicked', self._btn_barrido_menu_cb) self.insert(self._btn_barrido_menu, -1) self._btn_barrido_menu.set_no_show_all(True)
def __init__(self, abiword_canvas): gtk.Toolbar.__init__(self) self._abiword_canvas = abiword_canvas self._table = abiword.TableCreator() self._table.set_labels(_('Table'), _('Cancel')) self._table_id = self._table.connect('selected', self._table_cb) image = gtk.Image() image.set_from_icon_name('insert-table', -1) self._table.set_image(image) self._table.set_relief(gtk.RELIEF_NONE) tool_item = gtk.ToolItem() tool_item.add(self._table) self.insert(tool_item, -1) tool_item.show_all() self._table_rows_after = ToolButton('row-insert') self._table_rows_after.set_tooltip(_('Insert Row')) self._table_rows_after_id = self._table_rows_after.connect( \ 'clicked', self._table_rows_after_cb) self.insert(self._table_rows_after, -1) self._table_delete_rows = ToolButton('row-remove') self._table_delete_rows.set_tooltip(_('Delete Row')) self._table_delete_rows_id = self._table_delete_rows.connect( \ 'clicked', self._table_delete_rows_cb) self.insert(self._table_delete_rows, -1) self._table_cols_after = ToolButton('column-insert') self._table_cols_after.set_tooltip(_('Insert Column')) self._table_cols_after_id = self._table_cols_after.connect( \ 'clicked', self._table_cols_after_cb) self.insert(self._table_cols_after, -1) self._table_delete_cols = ToolButton('column-remove') self._table_delete_cols.set_tooltip(_('Delete Column')) self._table_delete_cols_id = self._table_delete_cols.connect( \ 'clicked', self._table_delete_cols_cb) self.insert(self._table_delete_cols, -1) separator = gtk.SeparatorToolItem() self.insert(separator, -1) image = ToolButton('insert-picture') image.set_tooltip(_('Insert Image')) self._image_id = image.connect('clicked', self._image_cb) self.insert(image, -1) self.show_all() self._abiword_canvas.connect('table-state', self._isTable_cb)
def __init__(self): gtk.Toolbar.__init__(self) self._zoom_out = ToolButton('zoom-out') self._zoom_out.set_tooltip(_('Zoom out')) self._zoom_out.connect('clicked', self._zoom_out_cb) self.insert(self._zoom_out, -1) self._zoom_out.show() self._zoom_in = ToolButton('zoom-in') self._zoom_in.set_tooltip(_('Zoom in')) self._zoom_in.connect('clicked', self._zoom_in_cb) self.insert(self._zoom_in, -1) self._zoom_in.show()
def __init__(self, handle): activity.Activity.__init__(self, handle) self.max_participants = 1 toolbar_box = ToolbarBox() activity_button = ActivityToolbarButton(self) toolbar_box.toolbar.insert(activity_button, 0) activity_button.show() jugarc_button = ToolButton('chico') jugarc_button.set_tooltip(('Jugar el juego en pantalla chica')) jugarc_button.connect('clicked', self._jugar_chico) toolbar_box.toolbar.insert(jugarc_button, -1) jugarc_button.show jugarm_button = ToolButton('mediano') jugarm_button.set_tooltip(('Jugar el juego en pantalla mediana')) jugarm_button.connect('clicked', self._jugar_mediano) toolbar_box.toolbar.insert(jugarm_button, -1) jugarm_button.show jugarg_button = ToolButton('grande') jugarg_button.set_tooltip(('Jugar el juego en pantalla grande')) jugarg_button.connect('clicked', self._jugar_grande) toolbar_box.toolbar.insert(jugarg_button, -1) jugarg_button.show separator = gtk.SeparatorToolItem() separator.props.draw = False separator.set_expand(True) toolbar_box.toolbar.insert(separator, -1) separator.show() self.create_help(toolbar_box.toolbar) self.set_toolbar_box(toolbar_box) toolbar_box.show() self._update_accelerators(toolbar_box) self._filechooser = gtk.FileChooserWidget(\ action=gtk.FILE_CHOOSER_ACTION_OPEN,backend=None) self._filechooser.set_current_folder("/") self.botonJugar = gtk.Button("Jugar rom") self.botonJugar.connect('clicked', self._jugar_mediano) self.botonJugar.show() self._filechooser.set_extra_widget(self.botonJugar) self.set_canvas(self._filechooser) self.show_all()
def __init__(self, jam): gtk.Toolbar.__init__(self) def _insertSeparator(x=1): for i in range(x): self.separator = gtk.SeparatorToolItem() self.separator.set_draw(True) self.insert(self.separator, -1) self.separator.show() #self.toolbox = toolbox self.jam = jam if Config.FEATURES_MIC: self.micRec1Button = ToolButton('rec1') self.micRec1Button.connect('clicked', self.jam.micRec, 'mic1') self.insert(self.micRec1Button, -1) self.micRec1Button.show() self.micRec1Button.set_tooltip(_('Record microphone into slot 1')) self.micRec2Button = ToolButton('rec2') self.micRec2Button.connect('clicked', self.jam.micRec, 'mic2') self.insert(self.micRec2Button, -1) self.micRec2Button.show() self.micRec2Button.set_tooltip(_('Record microphone into slot 2')) self.micRec3Button = ToolButton('rec3') self.micRec3Button.connect('clicked', self.jam.micRec, 'mic3') self.insert(self.micRec3Button, -1) self.micRec3Button.show() self.micRec3Button.set_tooltip(_('Record microphone into slot 3')) self.micRec4Button = ToolButton('rec4') self.micRec4Button.connect('clicked', self.jam.micRec, 'mic4') self.insert(self.micRec4Button, -1) self.micRec4Button.show() self.micRec4Button.set_tooltip(('Record microphone into slot 4')) _insertSeparator() if Config.FEATURES_NEWSOUNDS: self._loopSettingsPalette = LoopSettingsPalette( _('Add new Sound'), self.jam) self.loopSetButton = ToggleToolButton('loop') self.loopSetButton.set_palette(self._loopSettingsPalette) self.insert(self.loopSetButton, -1) self.loopSetButton.show() self.show_all()
def build_toolbar(self): toolbar_box = ToolbarBox() self.set_toolbar_box(toolbar_box) toolbar_box.show() activity_button = ActivityToolbarButton(self) toolbar_box.toolbar.insert(activity_button, -1) activity_button.show() self.blocklist = [] self.radioList = {} for c in tools.allTools: button = ToolButton(c.icon) button.set_tooltip(_(c.toolTip)) button.connect('clicked',self.radioClicked) toolbar_box.toolbar.insert(button, -1) button.show() self.radioList[button] = c.name separator = gtk.SeparatorToolItem() separator.props.draw = False separator.set_expand(True) toolbar_box.toolbar.insert(separator, -1) separator.show() stop_button = StopButton(self) toolbar_box.toolbar.insert(stop_button, -1) stop_button.show() self.show_all()
def __init__(self, **kwargs): gtk.ToolItem.__init__(self) help_button = ToolButton('help-icon') help_button.set_tooltip(_('Help')) self.add(help_button) self._palette = help_button.get_palette() sw = gtk.ScrolledWindow() sw.set_size_request(int(gtk.gdk.screen_width() / 2.8), gtk.gdk.screen_height() - style.GRID_CELL_SIZE * 3) sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) self._max_text_width = int(gtk.gdk.screen_width() / 3) - 20 self._vbox = gtk.VBox() self._vbox.set_homogeneous(False) hbox = gtk.HBox() hbox.pack_start(self._vbox, False, True, 0) sw.add_with_viewport(hbox) self._palette.set_content(sw) sw.show_all() help_button.connect('clicked', self.__help_button_clicked_cb)