Intro Overview Window Widgets Layout Events

Window Widget

The Window is the basic widget of Wise. It has a Ruby part and a native part. You will never touch the native part. The Ruby part talks to the native part and allows you to do everything with the native window that is necessary.

Window initializer

Making a window is easy enough:

Wise::Window.new(parent)
where the parent may be nil for a toplevel window or another window. This alone does not do anything useful but pop up a window. To improve on that, there are several options that can be passed via a hashtable to the window: That would look like:

require 'wise'
Window.new(parent, :fg=>Color.new(120, 160, 200), :space=>5)
Many of those options are inherited by the children of the window. This allows you to set the background color (or background image, when implemented) of all widgets, by just setting it in the toplevel window.

Window Layout

For layout, these extra options are available, but may or may not be used by the layout manager. See the layout section. Layout can be a bit weird, as some layout mamagers will be interested in properties of the children (e.g. the default manager will look at :side for its children).

Toplevel Window

A toplevel window is a window that has no parents and is usually managed by the window manager. It is what a typical user would call a window.

A toplevel window has a few extra options:

Window methods

Now that we have window, we may want to do several things with it: While a window exists, call map() or unmap(). Setting background and other fields for each widget will cause the siblings to change their setting, too (but that's not updated on the screen immediately, yet; enforcing a redraw will show it, though).

Some (toplevel) options can not be changed, ever: modal, dock and override. Others may not have been implemented to change after creation.


Kero
Intro Overview Window Widgets Layout Events