def __init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=0, padding=0, show_spinner=False): FramedBox.__init__(self, Gtk.Orientation.VERTICAL, spacing, padding) # make the header self.header = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, spacing) self.header_alignment = Gtk.Alignment() self.header_alignment.add(self.header) self.box.pack_start(self.header_alignment, False, False, 0) # make the content box self.content_box = Gtk.Box.new(orientation, spacing) self.content_box.show() # finally, a notebook for the spinner and the content box to share self.spinner_notebook = SpinnerNotebook(self.content_box, spinner_size=SpinnerView.SMALL) self.box.add(self.spinner_notebook) # make the "More" button, but don't add it to the header unless/until # we get a header_implements_more_button self.more = MoreLink()
def header_implements_more_button(self): if not hasattr(self, "more"): self.more = MoreLink() self.header.pack_end(self.more, False, False, 0)