CList widget

Gtk::CList is a multi-column list widget. It will replace Gtk::List class (of course, Gtk::List is still available).
ex: Display Environmental Variables

nn Here is the simple example of CList class. This program displayes all environmental variables.

Program clist.rb:

require 'gtk'

window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
clist = Gtk::CList.new(['name', 'value'])
clist.set_usize(300, 200)
clist.set_column_width 0, 100
ENV.keys.sort.each {|k| clist.append [k, ENV[k]]}
window.add clist
clist.show
window.show
Gtk.main

Result:
(attention: this result depends gtk-1.0.x. If you execute this program with version 1.2.x, little changes will be occur in look & feel.)

Description:


Methods of CList Widget

Gtk::CList.new(columns)
Gtk::CList.new(['title1', 'title2', ... ])
This method creates a CList widget. When using first style, created CList have "columns" columns but no title. When using second style, created CList have columns with title.
set_policy(vscrollbar_policy, hscrollbar_polic y)
Next
[TOP]
Written by akaishi@ruby.freak.ne.jp