47 lines
911 B
Text
47 lines
911 B
Text
// Display a Message in a GUI Window
|
|
//
|
|
// Nigel Galloway, April 18th., 2012.
|
|
//
|
|
namespace HelloWorldGUI;
|
|
|
|
interface
|
|
|
|
uses
|
|
Glade, Gtk, System;
|
|
|
|
type
|
|
Program = public static class
|
|
public
|
|
class method Main(args: array of String);
|
|
end;
|
|
|
|
MainForm = class(System.Object)
|
|
private
|
|
var
|
|
[Widget] hworld: Gtk.Window;
|
|
public
|
|
constructor(args: array of String);
|
|
method on_hworld_delete_event(aSender: Object; args: DeleteEventArgs);
|
|
end;
|
|
|
|
implementation
|
|
|
|
class method Program.Main(args: array of String);
|
|
begin
|
|
new MainForm(args);
|
|
end;
|
|
|
|
constructor MainForm(args: array of String);
|
|
begin
|
|
inherited constructor;
|
|
Application.Init();
|
|
with myG := new Glade.XML(nil, 'HelloWorldGUI.Main.glade', 'hworld', nil) do myG.Autoconnect(self);
|
|
Application.Run();
|
|
end;
|
|
|
|
method MainForm.on_hworld_delete_event(aSender: Object; args: DeleteEventArgs);
|
|
begin
|
|
Application.Quit();
|
|
end;
|
|
|
|
end.
|