Python gi.repository.Gtk.Button() Examples
The following are 30
code examples of gi.repository.Gtk.Button().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
gi.repository.Gtk
, or try the search function
.
Example #1
Source File: ChainVBox.py From pychess with GNU General Public License v3.0 | 6 votes |
def __init__(self): GObject.GObject.__init__(self) chainline = ChainLine(CHAIN_TOP) self.pack_start(chainline, True, True, 0) self.button = Gtk.Button() self.pack_start(self.button, False, True, 0) chainline = ChainLine(CHAIN_BOTTOM) self.pack_start(chainline, True, True, 0) self.image = Gtk.Image() self.image.set_from_file(addDataPrefix("glade/stock-vchain-24.png")) self.button.set_image(self.image) self.button.set_relief(Gtk.ReliefStyle.NONE) self.button.set_property("yalign", 0) self._active = True self.button.connect("clicked", self.onClicked)
Example #2
Source File: buttons.py From kano-toolset with GNU General Public License v2.0 | 6 votes |
def __init__(self, text="", icon_filename=""): Gtk.Button.__init__(self) apply_colours_to_widget(self) self.internal_box = Gtk.Box(spacing=10) self.internal_box.props.halign = Gtk.Align.CENTER self.add(self.internal_box) if icon_filename: self.icon = Gtk.Image.new_from_file(icon_filename) self.internal_box.pack_start(self.icon, False, False, 0) self.label = Gtk.Label(text) self.internal_box.pack_start(self.label, False, False, 0) else: self.label = Gtk.Label(text) self.internal_box.add(self.label) cursor.attach_cursor_events(self)
Example #3
Source File: edit.py From Authenticator with GNU General Public License v2.0 | 6 votes |
def _on_save(self, *_): """ Save Button clicked signal handler. """ new_account = self.account_config.account username = new_account["username"] provider = new_account["provider"] old_provider = self._account.provider # Update the AccountRow widget self.emit("updated", username, provider) # Update the providers list if provider != old_provider: from .list import AccountsWidget ac_widget = AccountsWidget.get_default() ac_widget.update_provider(self._account, provider) self._on_quit()
Example #4
Source File: settings.py From Authenticator with GNU General Public License v2.0 | 6 votes |
def __on_clear_database_clicked(self, *__): notification = Gd.Notification() notification.set_timeout(5) notification.connect("dismissed", self.__clear_database) container = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) notification_lbl = Gtk.Label() notification_lbl.set_text(_("The existing accounts will be erased in 5 seconds")) container.pack_start(notification_lbl, False, False, 3) undo_btn = Gtk.Button() undo_btn.set_label(_("Undo")) undo_btn.connect("clicked", lambda widget: notification.hide()) container.pack_end(undo_btn, False, False, 3) notification.add(container) notification_parent = self.stack.get_child_by_name("behaviour") notification_parent.add(notification) notification_parent.reorder_child(notification, 0) self.show_all()
Example #5
Source File: gnupg.py From Authenticator with GNU General Public License v2.0 | 6 votes |
def _build_widgets(self): header_bar = Gtk.HeaderBar() header_bar.set_show_close_button(True) header_bar.set_title(_("GPG paraphrase")) apply_btn = Gtk.Button() apply_btn.set_label(_("Import")) apply_btn.get_style_context().add_class("suggested-action") apply_btn.connect("clicked", self.__on_apply) header_bar.pack_end(apply_btn) self.set_titlebar(header_bar) container = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.paraphrase_widget = SettingsBoxWithEntry(_("Paraphrase"), True) container.pack_start(self.paraphrase_widget, False, False, 0) container.get_style_context().add_class("settings-main-container") self.add(container)
Example #6
Source File: headerbar.py From Authenticator with GNU General Public License v2.0 | 6 votes |
def __init__(self): Gtk.HeaderBar.__init__(self) self.search_btn = HeaderBarToggleButton("system-search-symbolic", _("Search")) self.add_btn = HeaderBarButton("list-add-symbolic", _("Add a new account")) self.settings_btn = HeaderBarButton("open-menu-symbolic", _("Settings")) self.select_btn = HeaderBarButton("object-select-symbolic", _("Selection mode")) self.cancel_btn = Gtk.Button(label=_("Cancel")) self.popover = None self._build_widgets()
Example #7
Source File: tab.py From ImEditor with GNU General Public License v3.0 | 6 votes |
def __init__(self, win, tab, title, img): Gtk.Box.__init__(self) self.set_spacing(5) self.win = win self.tab = tab # Preview of image self.icon = Gtk.Image() # Title self.label = Gtk.Label() self.set_title(title) # Close button button = Gtk.Button() button.set_relief(Gtk.ReliefStyle.NONE) button.add(Gtk.Image.new_from_icon_name('window-close', Gtk.IconSize.MENU)) button.connect('clicked', self.on_close_button_clicked) self.add(self.icon) self.add(self.label) self.add(button) self.show_all()
Example #8
Source File: NetworkScreen.py From kano-settings with GNU General Public License v2.0 | 6 votes |
def _create_refresh_button(self): '''Create the refresh button. This it quite involved as you have to pack an image into the button which need to change when the cursor hovers over it, and change the cursor to be a hand over it. ''' refresh_icon_filepath = os.path.join(img_dir, "refresh.png") refresh_icon = Gtk.Image.new_from_file(refresh_icon_filepath) refresh_btn = Gtk.Button() refresh_btn.get_style_context().add_class('refresh_btn') refresh_btn.set_image(refresh_icon) attach_cursor_events(refresh_btn) # These are here in case we want to change the icon on mouse over refresh_btn.connect('enter-notify-event', self._set_refresh_hover_icon) refresh_btn.connect('leave-notify-event', self._set_refresh_normal_icon) refresh_btn.connect('clicked', self._go_to_spinner_screen) return refresh_btn # This is linked to enter-notify-event, hence the extra arguments
Example #9
Source File: FaceDetection.py From addons-source with GNU General Public License v2.0 | 6 votes |
def build_gui(self): """ Build the GUI interface. """ self.top = Gtk.Box() if not computer_vision_available: vbox = Gtk.Label(_("OpenCV-Python is not installed")) self.top.pack_start(vbox, False, False, 0) self.top.show_all() return self.top # first column: vbox = Gtk.Box(Gtk.Orientation.VERTICAL) self.top.pack_start(vbox, False, False, 0) self.photo = Photo() vbox.pack_start(self.photo, False, False, 5) self.detect_button = Gtk.Button(_("Detect New Faces")) self.detect_button.connect('button-press-event', self.detect) vbox.pack_start(self.detect_button, False, False, 0) # second column vbox = Gtk.Box(Gtk.Orientation.VERTICAL) vbox.pack_start(Gtk.Label("Image:"), False, False, 0) self.top.pack_start(vbox, False, False, 0) # show and return: self.top.show_all() return self.top
Example #10
Source File: graphview.py From addons-source with GNU General Public License v2.0 | 6 votes |
def build_bkmark_ext_panel(self): """ Build bookmark popover extand panel. """ btn_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) # add button to add active person to bookmarks # tooltip will be changed in "self.load_bookmarks" self.add_bkmark = Gtk.Button(label=_('Add active person')) self.add_bkmark.connect("clicked", self.add_active_to_bkmarks) btn_box.pack_start(self.add_bkmark, True, True, 2) # add buton to call bookmarks manager manage_bkmarks = Gtk.Button(label=_('Edit')) manage_bkmarks.set_tooltip_text(_('Call the bookmark editor')) manage_bkmarks.connect("clicked", self.edit_bookmarks) btn_box.pack_start(manage_bkmarks, True, True, 2) return btn_box
Example #11
Source File: editexifmetadata.py From addons-source with GNU General Public License v2.0 | 6 votes |
def __create_button(self, text, callback=[], sensitive=False): """ creates and returns a button for display """ button = Gtk.Button(label=text) if callback is not []: for call_ in callback: button.connect("clicked", call_) # attach a addon widget to the button for later manipulation self.exif_widgets[text] = button if not sensitive: button.set_sensitive(False) button.show() return button
Example #12
Source File: RemarkableWindow.py From Remarkable with MIT License | 6 votes |
def insert_table(self, widget): self.insert_window_table = Gtk.Window() self.insert_window_table.set_title("Insert Table") self.insert_window_table.set_resizable(True) self.insert_window_table.set_border_width(6) self.insert_window_table.set_default_size(300, 250) self.insert_window_table.set_position(Gtk.WindowPosition.CENTER) vbox = Gtk.VBox() label_n_rows = Gtk.Label("Number of Rows:") self.entry_n_rows = Gtk.Entry() label_n_columns = Gtk.Label("Number of Columns") self.entry_n_columns = Gtk.Entry() vbox.pack_start(label_n_rows, self, False, False) vbox.pack_start(self.entry_n_rows, self, False, False) vbox.pack_start(label_n_columns, self, False, False) vbox.pack_start(self.entry_n_columns, self, False, False) button = Gtk.Button("Insert Table") vbox.pack_end(button, self, False, False) self.insert_window_table.add(vbox) self.insert_window_table.show_all() button.connect("clicked", self.insert_table_cmd, self.insert_window_table)
Example #13
Source File: RemarkableWindow.py From Remarkable with MIT License | 6 votes |
def on_menuitem_custom_activate(self, widget): self.custom_window = Gtk.Window() self.custom_window.set_default_size(640, 480) self.custom_window.set_position(Gtk.WindowPosition.CENTER) self.custom_window.set_title("Custom CSS") self.custom_vbox = Gtk.VBox() self.custom_scroller = Gtk.ScrolledWindow() self.custom_button = Gtk.Button("Apply") self.custom_vbox.pack_end(self.custom_button, False, False, 0) self.custom_text_view = Gtk.TextView() self.custom_text_buffer = Gtk.TextBuffer() self.custom_text_buffer.set_text(self.custom_css) self.custom_text_view.set_buffer(self.custom_text_buffer) self.custom_scroller.add(self.custom_text_view) self.custom_vbox.pack_start(self.custom_scroller, True, True, 0) self.custom_window.add(self.custom_vbox) self.custom_window.show_all() self.custom_button.connect("clicked", self.apply_custom_css, self.custom_window, self.custom_text_buffer)
Example #14
Source File: path.py From gtg with GNU General Public License v3.0 | 6 votes |
def _populate_gtk(self, width): """Creates the Gtk.Label, the textbox and the button @param width: the width of the Gtk.Label object """ label = Gtk.Label(label=_("Filename:")) label.set_line_wrap(True) label.set_alignment(xalign=0, yalign=0.5) label.set_size_request(width=width, height=-1) self.pack_start(label, False, True, 0) align = Gtk.Alignment.new(0, 0.5, 1, 0) align.set_padding(0, 0, 10, 0) self.pack_start(align, True, True, 0) self.textbox = Gtk.Entry() self.textbox.set_text(self.backend.get_parameters()['path']) self.textbox.connect('changed', self.on_path_modified) align.add(self.textbox) self.button = Gtk.Button() self.button.set_label("Edit") self.button.connect('clicked', self.on_button_clicked) self.pack_start(self.button, False, True, 0)
Example #15
Source File: addpanel.py From gtg with GNU General Public License v3.0 | 6 votes |
def _fill_bottom_box(self, box): """ Helper function to fill and box with a buttonbox, featuring and ok and cancel buttons. @param box: the Gtk.Box to fill """ cancel_button = Gtk.Button() cancel_button.set_label("Cancel") cancel_button.connect('clicked', self.on_cancel) self.ok_button = Gtk.Button() self.ok_button.set_label("OK") self.ok_button.connect('clicked', self.on_confirm) align = Gtk.Alignment.new(0.5, 1, 1, 0) align.set_padding(0, 10, 0, 0) buttonbox = Gtk.ButtonBox() buttonbox.set_layout(Gtk.ButtonBoxStyle.EDGE) buttonbox.add(cancel_button) buttonbox.set_child_secondary(cancel_button, False) buttonbox.add(self.ok_button) align.add(buttonbox) box.pack_start(align, True, True, 0)
Example #16
Source File: states_editor.py From RAFCON with Eclipse Public License 1.0 | 6 votes |
def create_button(toggle, font_size, icon_code, release_callback=None, *additional_parameters): if toggle: button = Gtk.ToggleButton() else: button = Gtk.Button() button.set_relief(Gtk.ReliefStyle.NONE) Gtk.Widget.set_focus_on_click(button, True) button.set_size_request(width=constants.GRID_SIZE*3, height=-1) label = Gtk.Label() set_label_markup(label, icon_code, is_icon=True, size=font_size) button.add(label) if release_callback: button.connect('released', release_callback, *additional_parameters) return button
Example #17
Source File: headerbar.py From Audio-Cutter with GNU General Public License v3.0 | 6 votes |
def _setup_widgets(self): """Setup main headerbar widgets.""" # Open button self._open_btn.set_label(_("Open")) self._open_btn.connect("clicked", self._open_file) self.pack_start(self._open_btn) menu_icn = Gio.ThemedIcon(name="open-menu-symbolic") menu_img = Gtk.Image.new_from_gicon(menu_icn, Gtk.IconSize.BUTTON) self.menu_btn.set_image(menu_img) self.pack_end(self.menu_btn) # Play Button self.set_is_playing(False) self.play_btn.set_sensitive(False) self.pack_start(self.play_btn)
Example #18
Source File: time.py From Audio-Cutter with GNU General Public License v3.0 | 6 votes |
def _setup_widgets(self): """Create the Time Button widgets.""" # Time entry self._entry.set_max_length(8) self._entry.set_width_chars(8) self._entry.connect("changed", self._on_type) self._entry.set_max_width_chars(8) # Up btn up_icn = Gio.ThemedIcon(name="list-add-symbolic") up_img = Gtk.Image.new_from_gicon(up_icn, Gtk.IconSize.BUTTON) self._up_btn.set_image(up_img) self._up_btn.connect("clicked", self.step_up) self._up_btn.get_style_context().add_class("flat") # Lower btn lower_icn = Gio.ThemedIcon(name="list-remove-symbolic") lower_img = Gtk.Image.new_from_gicon(lower_icn, Gtk.IconSize.BUTTON) self._lower_btn.set_image(lower_img) self._lower_btn.connect("clicked", self.step_down) self._lower_btn.get_style_context().add_class("flat") self.pack_start(self._entry, False, False, 0) self.pack_start(self._lower_btn, False, False, 0) self.pack_start(self._up_btn, False, False, 0)
Example #19
Source File: state_machines_editor.py From RAFCON with Eclipse Public License 1.0 | 5 votes |
def create_tab_close_button(callback, *additional_parameters): close_label = Gtk.Label() set_label_markup(close_label, constants.BUTTON_CLOSE, is_icon=True, size=constants.FONT_SIZE_SMALL) close_button = Gtk.Button() close_button.set_size_request(width=constants.GRID_SIZE*3, height=-1) close_button.set_relief(Gtk.ReliefStyle.NONE) Gtk.Widget.set_focus_on_click(close_button, True) close_button.add(close_label) close_button.connect('released', callback, *additional_parameters) return close_button
Example #20
Source File: row.py From Authenticator with GNU General Public License v2.0 | 5 votes |
def _on_edit(self, *_): """ Edit Button clicked signal handler. Opens a new Window to edit the current account. """ from ..window import Window edit_window = EditAccountWindow(self._account) edit_window.set_transient_for(Window.get_default()) edit_window.connect("updated", self._on_update) edit_window.show_all() edit_window.present()
Example #21
Source File: outcomes.py From RAFCON with Eclipse Public License 1.0 | 5 votes |
def __init__(self): super(StateOutcomesEditorView, self).__init__() self.vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0) self.treeView = StateOutcomesTreeView() add_button = Gtk.Button(label='Add') Gtk.Widget.set_focus_on_click(add_button, True) add_button.set_border_width(constants.BUTTON_BORDER_WIDTH) add_button.set_size_request(constants.BUTTON_MIN_WIDTH, -1) remove_button = Gtk.Button(label='Remove') Gtk.Widget.set_focus_on_click(remove_button, True) remove_button.set_border_width(constants.BUTTON_BORDER_WIDTH) remove_button.set_size_request(constants.BUTTON_MIN_WIDTH, -1) self['add_button'] = add_button self['remove_button'] = remove_button self.Hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0) self.Hbox.get_style_context().add_class("widget-toolbar") self.Hbox.pack_end(self['remove_button'], False, True, 0) self.Hbox.pack_end(self['add_button'], False, True, 0) scrollable = Gtk.ScrolledWindow() scrollable.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scrollable.add(self.treeView.get_top_widget()) self.treeView.scrollbar_widget = scrollable outcomes_widget_title = gui_helper_label.create_widget_title("OUTCOMES") self.vbox.pack_start(outcomes_widget_title, False, True, 0) self.vbox.pack_start(scrollable, True, True, 0) self.vbox.pack_start(self.Hbox, expand=False, fill=True, padding=0) self.vbox.show_all() self['main_frame'] = self.vbox self.top = 'main_frame'
Example #22
Source File: gamewidget.py From pychess with GNU General Public License v3.0 | 5 votes |
def initTabcontents(self): tabcontent = createAlignment(0, 0, 0, 0) hbox = Gtk.HBox() hbox.set_spacing(4) hbox.pack_start(createImage(light_off), False, True, 0) close_button = Gtk.Button() close_button.set_property("can-focus", False) close_button.add(createImage(gtk_close)) close_button.set_relief(Gtk.ReliefStyle.NONE) close_button.set_size_request(20, 18) self.cids[close_button] = close_button.connect("clicked", self.on_game_close_clicked) hbox.pack_end(close_button, False, True, 0) text_hbox = Gtk.HBox() white_label = Gtk.Label(label="") text_hbox.pack_start(white_label, False, True, 0) text_hbox.pack_start(Gtk.Label(label=" - "), False, True, 0) black_label = Gtk.Label(label="") text_hbox.pack_start(black_label, False, True, 0) gameinfo_label = Gtk.Label(label="") text_hbox.pack_start(gameinfo_label, False, True, 0) # label.set_alignment(0,.7) hbox.pack_end(text_hbox, True, True, 0) tabcontent.add(hbox) tabcontent.show_all() # Gtk doesn't show tab labels when the rest is return tabcontent, white_label, black_label, gameinfo_label
Example #23
Source File: label.py From RAFCON with Eclipse Public License 1.0 | 5 votes |
def set_button_children_size_request(widget): try: if not isinstance(widget, Gtk.Container): return for child in widget.get_children(): if isinstance(child, Gtk.Button): child.set_size_request(constants.BUTTON_MIN_WIDTH, -1) else: set_button_children_size_request(child) except AttributeError: return
Example #24
Source File: widgets.py From nautilus-folder-icons with GNU General Public License v3.0 | 5 votes |
def _build_header_bar(self): """Setup window headerbar.""" # Header bar headerbar = Gtk.HeaderBar() headerbar_container = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3) title = Gtk.Label() title.set_text(_("Icon Chooser")) title.get_style_context().add_class("title") headerbar_container.pack_start(title, False, False, 0) subtitle = Gtk.Label() subtitle.get_style_context().add_class("subtitle") subtitle_text = ", ".join(self._folders) subtitle.set_text(subtitle_text) subtitle.set_ellipsize(Pango.EllipsizeMode.END) subtitle.set_tooltip_text(subtitle_text) subtitle.props.max_width_chars = 30 headerbar_container.pack_start(subtitle, False, False, 0) headerbar.set_custom_title(headerbar_container) headerbar.set_show_close_button(False) # Search Button self._search_btn = Gtk.ToggleButton() search_icn = Gio.ThemedIcon(name="system-search-symbolic") search_img = Gtk.Image.new_from_gicon(search_icn, Gtk.IconSize.BUTTON) self._search_btn.set_image(search_img) # Cancel Button close_button = Gtk.Button() close_button.set_label(_("Close")) close_button.connect("clicked", self._close_window) headerbar.pack_start(close_button) headerbar.pack_end(self._search_btn) self.set_titlebar(headerbar)
Example #25
Source File: main_ui.py From innstereo with GNU General Public License v2.0 | 5 votes |
def on_main_window_destroy(self, widget): """ Triggered when the main window is closed with the x-Button. Terminates the Gtk main loop """ Gtk.main_quit()
Example #26
Source File: authentication.py From networkmgr with BSD 3-Clause "New" or "Revised" License | 5 votes |
def button(self): cancel = Gtk.Button(stock=Gtk.STOCK_CANCEL) cancel.connect("clicked", self.close) connect = Gtk.Button(stock=Gtk.STOCK_CONNECT) connect.connect("clicked", self.add_to_wpa_supplicant) table = Gtk.Table(1, 2, True) table.set_col_spacings(10) table.attach(connect, 4, 5, 0, 1) table.attach(cancel, 3, 4, 0, 1) return table
Example #27
Source File: backend_infobar.py From gtg with GNU General Public License v3.0 | 5 votes |
def _prepare_textual_interaction(self): """ Helper function. gtk calls to populate the infobar in the case of interaction request """ title, description\ = getattr(self.backend, self.callback)("get_ui_dialog_text") self.dialog = Gtk.Window() # type = Gtk.WindowType.POPUP self.dialog.set_title(title) self.dialog.set_transient_for(self.browser.window) self.dialog.set_destroy_with_parent(True) self.dialog.set_position(Gtk.WindowPosition.CENTER_ON_PARENT) self.dialog.set_modal(True) # self.dialog.set_size_request(300,170) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.dialog.add(vbox) description_label = Gtk.Label() description_label.set_justify(Gtk.Justification.FILL) description_label.set_line_wrap(True) description_label.set_markup(description) align = Gtk.Alignment.new(0.5, 0.5, 1, 1) align.set_padding(10, 0, 20, 20) align.add(description_label) vbox.pack_start(align, True, True, 0) self.text_box = Gtk.Entry() self.text_box.set_size_request(-1, 40) align = Gtk.Alignment.new(0.5, 0.5, 1, 1) align.set_padding(20, 20, 20, 20) align.add(self.text_box) vbox.pack_start(align, True, True, 0) button = Gtk.Button() button.set_label(_("OK")) button.connect("clicked", self._on_text_confirmed) button.set_size_request(-1, 40) vbox.pack_start(button, False, True, 0) self.dialog.show_all() self.hide()
Example #28
Source File: configurepanel.py From gtg with GNU General Public License v3.0 | 5 votes |
def _fill_middle_box(self, box): """ Helper function to fill an box with a label and a button @param box: the Gtk.Box to fill """ self.sync_status_label = Gtk.Label() self.sync_status_label.set_alignment(xalign=0.8, yalign=0.5) self.sync_button = Gtk.Button() self.sync_button.connect("clicked", self.on_sync_button_clicked) box.pack_start(self.sync_status_label, True, True, 0) box.pack_start(self.sync_button, True, True, 0)
Example #29
Source File: RemarkableWindow.py From Remarkable with MIT License | 5 votes |
def insert_link(self, widget): self.insert_window_link = Gtk.Window() self.insert_window_link.set_title("Insert Link") self.insert_window_link.set_resizable(True) self.insert_window_link.set_border_width(6) self.insert_window_link.set_default_size(350, 250) self.insert_window_link.set_position(Gtk.WindowPosition.CENTER) vbox = Gtk.VBox() label_alt_text = Gtk.Label("Alt Text:") self.entry_alt_text = Gtk.Entry() label_url = Gtk.Label("Url:") self.entry_url = Gtk.Entry() vbox.pack_start(label_alt_text, self, False, False) vbox.pack_start(self.entry_alt_text, self, False, False) vbox.pack_start(label_url, self, False, False) vbox.pack_start(self.entry_url, self, False, False) button = Gtk.Button("Insert Link") vbox.pack_end(button, self, False, False) # Use highligted text as the default "alt text" if self.text_buffer.get_has_selection(): start, end = self.text_buffer.get_selection_bounds() text = self.text_buffer.get_text(start, end, True) self.entry_alt_text.set_text(text) self.insert_window_link.add(vbox) self.insert_window_link.show_all() button.connect("clicked", self.insert_link_cmd, self.insert_window_link)
Example #30
Source File: headerbar.py From Audio-Cutter with GNU General Public License v3.0 | 5 votes |
def __init__(self): GObject.GObject.__init__(self) Gtk.HeaderBar.__init__(self) self.play_btn = Gtk.Button() self._open_btn = Gtk.Button() self.menu_btn = Gtk.Button() self.set_title(_("Audio Cutter")) self.set_show_close_button(True) self._setup_widgets()