Blogs

First Gtk program in Smalltalk

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 git@gitorious.org: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';

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:

http://forum.world.st/Jtalk-a-Smalltalk-for-web-developers-td3354669.htm...

  • Gwenael Casaccio is now a part of Planet GNOME:

http://smalltalk.gnu.org/blog/mrgwen/hello-planet-gnome

  • GNU Smalltalk 3.2.4 released:

http://smalltalk.gnu.org/blog/mrgwen/gnu-smalltalk-3-2-4

  • GNU Smalltalk 4.1 is also released:

http://forum.world.st/GNU-Smalltalk-4-1-released-td3419830.html

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:

http://www.thewebqa.com/javascript/nicolas-petton-on-smalltalk-on-the-ja...

How to use MiniDebugger

Tagged:  •  

First you need to load MiniDebugger in your image.


gst -K examples/MiniDebugger.st -S

You may have to sudo it.

su -c 'gst -K examples/MiniDebugger.st -S'

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

Syndicate content

User login