Simple windowed application: Difference between revisions
Content added Content deleted
m (→{{header|R}}: Minor style update) |
(Modula-3) |
||
Line 614: | Line 614: | ||
) |
) |
||
createDialog buttonClick |
createDialog buttonClick |
||
=={{header|Modula-3}}== |
|||
{{libheader|Trestle}} |
|||
This code uses <tt>Trestle</tt>, a windowing toolkit developed for Modula-3. |
|||
<lang modula3>MODULE Click EXPORTS Main; |
|||
IMPORT Fmt, TextVBT, ButtonVBT, VBT, Axis, HVSplit, Trestle; |
|||
VAR label := TextVBT.New("There have been no clicks yet."); |
|||
button := ButtonVBT.New(TextVBT.New("Click me!"), Clicked); |
|||
main := HVSplit.Cons(Axis.T.Ver, label, button, adjustable := FALSE); |
|||
count := 0; |
|||
PROCEDURE Clicked(<*UNUSED*>button: ButtonVBT.T; <*UNUSED*>READONLY cd: VBT.MouseRec) = |
|||
BEGIN |
|||
INC(count); |
|||
TextVBT.Put(label, "Button pressed: " & Fmt.Int(count)); |
|||
END Clicked; |
|||
BEGIN |
|||
Trestle.Install(main); |
|||
Trestle.AwaitDelete(main); |
|||
END Click.</lang> |
|||
To compile the above code, you need to create a file called <tt>m3makefile</tt> which contains: |
|||
<pre> |
|||
import("ui") |
|||
import("libm3") |
|||
implementation("Click") |
|||
program("Click") |
|||
</pre> |
|||
=={{header|Objective-C}}== |
=={{header|Objective-C}}== |