You. Forth. Simplicity.

git repository
download
prior releases
documentation wiki
issue tracker
mailing list and forum
irc channel and logs
try it


This wiki remains, like the original forum, mainly for historical value. There is a new wiki which, while having less content, is more secure and oriented towards modern Retro implementations.

reload node | edit | recent changes | front page

Developing with GTK

The Windows and Generic ports of RetroForth provide support for using external libraries. One of the first significant uses of this functionality was to provide bindings for GTK+.

The primary focus of our bindings at this time is to allow creation of form-based applications quickly and easily. The primary bindings are complete, but much work on them remains to be done.

For you enjoyment, a few screenshots:


init
Initialize the GTK+ environment


To create a window:
window: name
To set the title:
name " title" setTitle


To create a button:
" initial label" button: name-of-button
To obtain the label of a button:
name-of-button button.getText
To set the label of a button:
name-of-button " new label" button.setText


To create a label:
" initial text" label: label-name
To change the text of a label:
label-name " text" label.setText


hbox-fixed:
vbox-fixed:
hbox:
vbox:
hButtonBox:
vButtonBox:
scrolled:


Single Line Text Entry

To create a text entry field:
entry: name
To change the text of a field:
name " text" entry.setText
To get the text in a field:
name entry.getText
To set the width of the field:
name #chars entry.setWidth
To set the maximum length of a field:
name #chars entry.setMaxLength
For a multi-line entry box, use textbox instead of entry


container add: object
container add-to: window
show: object
hide: object
window " signal" callback signal: object

TIP: If you are trying to use GTK 1.2, you may need to preload the gdk library. Try something like:

LD_PRELOAD=libgdk-1.2.so ./retro

Often this resolved problems.