Sha256: bad488e36a0e692a00bf15b665a876f1f5d5d1d44311a3fca1b4ddbdebf21148

Contents?: true

Size: 1.31 KB

Versions: 47

Compression:

Stored size: 1.31 KB

Contents

# 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
      # as opposed to the GTK2 dialog, the buttons have to be enclodes by brackeds
      # together with their ResponseType AND all groups have to bracketed together
      super(:title => 'GtkExpander',
            :parent => nil,
            :flags => 0,
            :buttons => [[Gtk::Stock::CLOSE, Gtk::ResponseType::NONE]])
      self.resizable = false

      signal_connect('response') do
        self.destroy
      end

      vbox = Gtk::Box.new(:vertical, 5)
      self.child.pack_start(vbox, :expand => true, :fill => true)
      vbox.border_width = 5

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

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

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

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
gtk3-3.0.7-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.7-x64-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.7 sample/gtk-demo/expander.rb
gtk3-3.0.6-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.6-x64-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.6 sample/gtk-demo/expander.rb
gtk3-3.0.5-x64-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.5-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.5 sample/gtk-demo/expander.rb
gtk3-3.0.4-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.4-x64-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.4 sample/gtk-demo/expander.rb
gtk3-3.0.3-x64-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.3-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.3 sample/gtk-demo/expander.rb
gtk3-3.0.2-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.2-x64-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.2 sample/gtk-demo/expander.rb
gtk3-3.0.1-x86-mingw32 sample/gtk-demo/expander.rb
gtk3-3.0.1-x64-mingw32 sample/gtk-demo/expander.rb