GNU Smalltalk (Fwd: [Help-smalltalk] First GTK program with GNU Smalltalk)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

GNU Smalltalk (Fwd: [Help-smalltalk] First GTK program with GNU Smalltalk)

Giuseppe
A quien le pueda interesar

-------- Mensaje original --------
Asunto: [Help-smalltalk] First GTK program with GNU Smalltalk
Fecha: Tue, 19 Apr 2011 22:26:25 +0200
De: Gwenael Casaccio <[hidden email]>
Para: GNU Smalltalk <[hidden email]>



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 [hidden email]: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
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk