Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login




GTK+ provides the Gtk::Calendar widget, which is a widget that displays one month of a calendar. It allows the user to move among months and years with scroll arrows. You can also display three letter abbreviations of the day names and week numbers for the chosen year.


Following is a simple example from the original Japanese tutorial Ruby/GNOME2 site.


#!/usr/bin/env ruby
require 'gtk2'

window =
window.signal_connect("delete_event") {Gtk.main_quit}
hbox =, 10)

flag = 0
].each do |f|
	c =
	flag |= f
	hbox.pack_start(c, true, true, 0)

Status Icons


The Gtk::StatusIcon object was introduced in GTK+ 2.10 and is used to display an icon in the system tray (notification area) in a platform-independent manner.

The "system tray" or notification area is normally used for transient icons that indicate some special state. For example, a system tray icon might appear to tell the user that they have new mail, or have an incoming instant message, or something along those lines. The basic idea is that creating an icon in the notification area is less annoying than popping up a dialogue.

A Gtk::StatusIcon object can be used to display an icon in a "system tray". The icon can have a tool-tip, and the user can interact with it by activating it or popping up a context menu. Critical information should not solely be displayed in a Gtk::StatusIcon, since it may not be visible (e.g. when the user doesn't have a notification area on his panel). This can be checked with Gtk::StatusIcon#embedded?.

On X11, the implementation follows the "System Tray" specification. Implementations of the "tray" side of this specification can be found e.g. in the GNOME and KDE panel applications. It will also show up in the Dock or the System tray on Mac OSX and Windows, respectively.

Note that a Gtk::StatusIcon is not a widget, but just a GLib::Object. Making it a widget would be impractical, since the system tray on Win32 doesn't allow to embed arbitrary widgets.

Last modified:2013/03/12 12:54:14
References:[tut-gtk2-agtkw] [tut-gtk]