Class: Gtk::Notebook

Inherits:
Object
  • Object
show all
Defined in:
lib/grumblr/ui.rb

Instance Method Summary collapse

Instance Method Details

#add_page_with_tab(page, text) ⇒ Object



643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/grumblr/ui.rb', line 643

def add_page_with_tab(page, text)
  filename = File.join(Grumblr::DATA_ROOT, 'pixmaps', '%s.bmp' % text.downcase)
  icon = Gtk::Image.new(filename)
  icon.set_padding 4, 0

  label = Gtk::Label.new('_' + text, true)
  label.set_alignment 0.0, 0.5
  label.set_padding 2, 2

  box = Gtk::HBox.new(false, 2)
  box.pack_start icon, false
  box.pack_start label, true
  box.show_all

  self.append_page_menu page, box, label
end