Hi,

In this short tutorial I will explain how to create a simple GTK application with GNU Smalltalk. First of all we download the gtk-tools package which contains improvements for Gtk.

git clone [email protected]:gst-objectspaces/gtk-tools.git
cd gtk-tools
./package.sh

Now we can create a first Gtk application; first we load the gtk-tools package

" Create a temporary variable "

  | window |

  PackageLoader fileInPackage: 'GtkTools'.


" This is a simple program that creates a window with a button and a status bar: "


" Create a new window "

    window := GtkTools GtkMainWindow new.

" Set a button as the main widget, change the title and status bar "

    window
        centralWidget: (GTK.GtkButton labeled: 'Hello World');
        title: 'simple';
        statusMessage: 'GTK Tutorial';
        showAll. " Display me and my children "

" Launch the Gtk event loop "

    GTK.Gtk main.

Cheers,
Gwen

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to