class Demo::Expander

Public Class Methods

new() click to toggle source
Calls superclass method Gtk::Dialog::new
# File gtk2/sample/gtk-demo/expander.rb, line 15
def initialize
  super('GtkExpander',
        nil, # parent
        0,
        [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE])
  self.resizable = false

  signal_connect('response') do
    self.destroy
  end

  vbox = Gtk::VBox.new(false, 5)
  self.vbox.pack_start(vbox, true, true)
  vbox.border_width = 5

  label = Gtk::Label.new('Expander demo. CLick on the triangle for details.')
  vbox.pack_start(label, false, false)

  # Create the expander
  expander = Gtk::Expander.new('Details')
  vbox.pack_start(expander, false, false)

  expander.add(Gtk::Label.new('Details can be shown or hidden.'))
end