First Gtk program in Smalltalk


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
cd gtk-tools

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 "

       centralWidget: (GTK.GtkButton labeled: 'Hello World');
       title: 'simple';

GNU Smalltalk Monthly Digest (April 2011)

Tagged:  •    •    •  

Welcome to GNU Smalltalk (GST) monthly digest, a place to find a summary of happenings from the world of GST. If you don't know what GST is, you can look at [1] to learn more about this beautiful programming language.

Here are some of the news happened last month:

  • Nicolas Petton announced Jtalk. Jtalk is an implementation of the Smalltalk language that runs on top of the JavaScript runtime:

  • Gwenael Casaccio is now a part of Planet GNOME:

  • GNU Smalltalk 3.2.4 released:

  • GNU Smalltalk 4.1 is also released:

Block Closure and Timeouts

Tagged:  •  

For the SS7/GSM work I am doing I have to implement dialogues with other systems and by default the IO in a lightweight process in Smalltalk is blocking (built on top of SIGIO). My problem is that a remote system could make me wait for a response forever. I am not an experienced Smalltalker yet but the existing options didn't look good enough (which might be me being unexperienced). I looked into what is required to add a #timeout:do: to the BlockClosure. The idea is to run the dialogue in a very straight forward way and guard the whole operation with a Timeout.

self sendSomething.
self waitForResponseOfKind: ABC.
self someMoreStuff.
self waitForMoe.
self askOtherSystem.
self conclude.
] timeout: 10 do: ['The operation timed out... cleanup']

Nicolas Petton Interview

The WebQA did an interview with Nicolas Petton, co-author/author of Iliad Web Framework and Jtalk. You can find the interview here:

How to use MiniDebugger

Tagged:  •  

First you need to load MiniDebugger in your image.

gst -K examples/ -S

You may have to sudo it.

su -c 'gst -K examples/ -S'

This will save the image with MiniDebugger loaded.
Next time you encounter a exception the MiniDebugger will prompt.

Syndicate content

User login