[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] First GTK program with GNU Smalltalk
From: |
Gwenael Casaccio |
Subject: |
[Help-smalltalk] First GTK program with GNU Smalltalk |
Date: |
Tue, 19 Apr 2011 22:26:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
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 address@hidden: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] First GTK program with GNU Smalltalk,
Gwenael Casaccio <=