def __init__(self, playlist, player): NotebookPage.__init__(self) self.playlist = playlist self.swindow = gtk.ScrolledWindow() self.swindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.pack_start(self.swindow, True, True) self.view = PlaylistView(self.playlist, player) self.swindow.add(self.view) hbox = gtk.HButtonBox() button = gtk.Button(stock=gtk.STOCK_CLEAR) button.connect( 'clicked', self.on_clear_history ) hbox.pack_start( button ) button = gtk.Button(stock=gtk.STOCK_SAVE) button.connect( 'clicked', self.on_save_history ) hbox.pack_start( button ) align = gtk.Alignment( 1.0, 0.0 ) align.add( hbox ) self.pack_start( align, False, False ) self.show_all()
def __init__(self, container, player): NotebookPage.__init__(self) self.container = container self.player = player self.playlist = player.queue # a queue is a playlist object... self.swindow = gtk.ScrolledWindow() self.swindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.pack_start(self.swindow, True, True) self.view = PlaylistView(self.player.queue, self.player) self.view.dragdrop_copyonly = True self.swindow.add(self.view) event.add_callback(self.on_length_changed, 'playlist_current_position_changed', self.player.queue) event.add_callback(self.on_length_changed, "playlist_tracks_added", self.player.queue) event.add_callback(self.on_length_changed, "playlist_tracks_removed", self.player.queue) self.show_all()
def get_panel(self): ''' Returns a NotebookPage object that will be used as the panel :returns: NotebookPage object ''' if not self._child: window = self.builder.get_object(self.ui_info[1]) child = window.get_child() window.remove(child) if not self.label: self.label = window.get_title() window.destroy() self._child = NotebookPage(child, self.label) return self._child
def get_panel(self): ''' Returns a NotebookPage object that will be used as the panel :returns: NotebookPage object ''' if not self._child: widget = self.builder.get_object(self.ui_info[1]) if isinstance(widget, Gtk.Window): # the old way, for pre 4.0.0-compatibility child = widget.get_child() if not self.label: self.label = widget.get_title() LOGGER.info( "Old style panel %s is creating unnecessary Gtk.Window.", self.label) widget.remove(child) widget.destroy() else: child = widget self._child = NotebookPage(child, self.label, 'panel-tab-context') return self._child
def get_panel(self): if self._panel is None: self._panel = NotebookPage(self.vbox, self.title, 'panel-tab-context') return self._panel
def get_panel(self): if self._panel is None: self._panel = NotebookPage(self.vbox, self.title) return self._panel
def get_panel(self): '''Returns panel for panel interface''' if self._panel is None: self.lyrics_panel.unparent() self._panel = NotebookPage(self.lyrics_panel, _('Lyrics')) return self._panel
def set_tab(self, tab): NotebookPage.set_tab(self, tab) tab.set_closable(not self.do_closing())