File: expander.rb

package info (click to toggle)
ruby-gnome2 0.15.0-1.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 7,692 kB
  • ctags: 8,558
  • sloc: ansic: 69,912; ruby: 19,511; makefile: 97; xml: 35; sql: 13
file content (40 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team
# This program is licenced under the same licence as Ruby-GNOME2.
# $Id: expander.rb,v 1.2 2005/02/25 17:09:25 kzys Exp $
=begin
= Expander (Expander)

GtkExpander allows to provide additional content that is initially hidden.
This is also known as "disclosure triangle".
=end

require 'common'

module Demo
  class Expander < Gtk::Dialog
    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
  end
end