gtk example

This commit is contained in:
Norayr Chilingarian 2014-01-31 17:08:54 +04:00
parent 9fb89d2a14
commit 97181a4b8d
10 changed files with 730 additions and 0 deletions

34
src/test/Gtk/handlers.Mod Normal file
View file

@ -0,0 +1,34 @@
(***************************************************************************
Project: HelloWorld
Purpose: A libglade-Hello-World with oo2c
Version: 1.0
Predecessor: -
Changes: -
Target: Linux
Compiler: oo2c
Date: Jan. 2009
Author: Frank Hrebabetzky
***************************************************************************)
MODULE handlers;
IMPORT
SYSTEM, Out := Console, G, Gdk, Gtk;
PROCEDURE (*["Hello"]*) Hello* (widget:Gtk.WidgetPtr; data:SYSTEM.PTR);
BEGIN
Out.String("Hello, world!"); Out.Ln;
END Hello;
PROCEDURE (*["Draw"]*) Draw* (widget:Gtk.WidgetPtr;
event:Gdk.EventExposePtr; data:G.pointer): G.boolean;
VAR a: G.int;
BEGIN
a:= widget.allocation.width DIV 2;
Gdk.drawArc (widget.window, widget.style.fgGc[ORD(widget.state)], G.TRUE,
a DIV 2, a DIV 2, a, a, 0, 64*360);
RETURN G.TRUE;
END Draw;
END handlers.