Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Hello-world-Graphical/00-META.yaml
Normal file
8
Task/Hello-world-Graphical/00-META.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
category:
|
||||
- Basic language learning
|
||||
- Simple
|
||||
from: http://rosettacode.org/wiki/Hello_world/Graphical
|
||||
note: GUI
|
||||
requires:
|
||||
- Graphics
|
||||
8
Task/Hello-world-Graphical/00-TASK.txt
Normal file
8
Task/Hello-world-Graphical/00-TASK.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
;Task:
|
||||
Display the string '''Goodbye, World!''' on a [[GUI]] object (alert box, plain window, text area, etc.).
|
||||
|
||||
|
||||
;Related task:
|
||||
* [[Hello world/Text]]
|
||||
<br><br>
|
||||
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
/* ARM assembly AARCH64 Raspberry PI 3B */
|
||||
/* program disMessGraph64.s */
|
||||
/* link with gcc options -lX11 -L/usr/lpp/X11/lib */
|
||||
|
||||
/*******************************************/
|
||||
/* Constantes file */
|
||||
/*******************************************/
|
||||
/* for this file see task include a file in language AArch64 assembly*/
|
||||
.include "../includeConstantesARM64.inc"
|
||||
.equ ClientMessage, 33
|
||||
|
||||
/*******************************************/
|
||||
/* Initialized data */
|
||||
/*******************************************/
|
||||
.data
|
||||
szRetourligne: .asciz "\n"
|
||||
szMessErreur: .asciz "Server X11 not found.\n"
|
||||
szMessErrfen: .asciz "Error create X11 window.\n"
|
||||
szMessErrGC: .asciz "Error create Graphic Context.\n"
|
||||
szMessGoodBye: .asciz "Goodbye World!"
|
||||
|
||||
szLibDW: .asciz "WM_DELETE_WINDOW" // message close window
|
||||
|
||||
/*******************************************/
|
||||
/* UnInitialized data */
|
||||
/*******************************************/
|
||||
.bss
|
||||
.align 4
|
||||
qDisplay: .skip 8 // Display address
|
||||
qDefScreen: .skip 8 // Default screen address
|
||||
identWin: .skip 8 // window ident
|
||||
wmDeleteMessage: .skip 16 // ident close message
|
||||
stEvent: .skip 400 // provisional size
|
||||
|
||||
buffer: .skip 500
|
||||
|
||||
/**********************************************/
|
||||
/* -- Code section */
|
||||
/**********************************************/
|
||||
.text
|
||||
.global main // program entry
|
||||
main:
|
||||
mov x0,#0 // open server X
|
||||
bl XOpenDisplay
|
||||
cmp x0,#0
|
||||
beq erreur
|
||||
// Ok return Display address
|
||||
ldr x1,qAdrqDisplay
|
||||
str x0,[x1] // store Display address for future use
|
||||
mov x28,x0 // and in register 28
|
||||
// load default screen
|
||||
ldr x2,[x0,#264] // at location 264
|
||||
ldr x1,qAdrqDefScreen
|
||||
str x2,[x1] //store default_screen
|
||||
mov x2,x0
|
||||
ldr x0,[x2,#232] // screen list
|
||||
|
||||
//screen areas
|
||||
ldr x5,[x0,#+88] // white pixel
|
||||
ldr x3,[x0,#+96] // black pixel
|
||||
ldr x4,[x0,#+56] // bits par pixel
|
||||
ldr x1,[x0,#+16] // root windows
|
||||
// create window x11
|
||||
mov x0,x28 //display
|
||||
mov x2,#0 // position X
|
||||
mov x3,#0 // position Y
|
||||
mov x4,600 // weight
|
||||
mov x5,400 // height
|
||||
mov x6,0 // bordure ???
|
||||
ldr x7,0 // ?
|
||||
ldr x8,qBlanc // background
|
||||
str x8,[sp,-16]! // argument fot stack
|
||||
bl XCreateSimpleWindow
|
||||
add sp,sp,16 // for stack alignement
|
||||
cmp x0,#0 // error ?
|
||||
beq erreurF
|
||||
ldr x1,qAdridentWin
|
||||
str x0,[x1] // store window ident for future use
|
||||
mov x27,x0 // and in register 27
|
||||
|
||||
// Correction of window closing error
|
||||
mov x0,x28 // Display address
|
||||
ldr x1,qAdrszLibDW // atom name address
|
||||
mov x2,#1 // False create atom if not exist
|
||||
bl XInternAtom
|
||||
cmp x0,#0
|
||||
ble erreurF
|
||||
ldr x1,qAdrwmDeleteMessage // address message
|
||||
str x0,[x1]
|
||||
mov x2,x1 // address atom create
|
||||
mov x0,x28 // display address
|
||||
mov x1,x27 // window ident
|
||||
mov x3,#1 // number of protocoles
|
||||
bl XSetWMProtocols
|
||||
cmp x0,#0
|
||||
ble erreurF
|
||||
// create Graphic Context
|
||||
mov x0,x28 // display address
|
||||
mov x1,x27 // window ident
|
||||
bl createGC // GC address -> x26
|
||||
cbz x0,erreurF
|
||||
// Display window
|
||||
mov x1,x27 // ident window
|
||||
mov x0,x28 // Display address
|
||||
bl XMapWindow
|
||||
|
||||
ldr x0,qAdrszMessGoodBye // display text
|
||||
bl displayText
|
||||
|
||||
1: // events loop
|
||||
mov x0,x28 // Display address
|
||||
ldr x1,qAdrstEvent // events structure address
|
||||
bl XNextEvent
|
||||
ldr x0,qAdrstEvent // events structure address
|
||||
ldr w0,[x0] // type in 4 fist bytes
|
||||
cmp w0,#ClientMessage // message for close window
|
||||
bne 1b // no -> loop
|
||||
|
||||
ldr x0,qAdrstEvent // events structure address
|
||||
ldr x1,[x0,56] // location message code
|
||||
ldr x2,qAdrwmDeleteMessage // equal ?
|
||||
ldr x2,[x2]
|
||||
cmp x1,x2
|
||||
bne 1b // no loop
|
||||
|
||||
mov x0,0 // end Ok
|
||||
b 100f
|
||||
erreurF: // error create window
|
||||
ldr x0,qAdrszMessErrfen
|
||||
bl affichageMess
|
||||
mov x0,1
|
||||
b 100f
|
||||
erreur: // error no server x11 active
|
||||
ldr x0,qAdrszMessErreur
|
||||
bl affichageMess
|
||||
mov x0,1
|
||||
100: // program standard end
|
||||
mov x8,EXIT
|
||||
svc 0
|
||||
qBlanc: .quad 0xF0F0F0F0
|
||||
qAdrqDisplay: .quad qDisplay
|
||||
qAdrqDefScreen: .quad qDefScreen
|
||||
qAdridentWin: .quad identWin
|
||||
qAdrstEvent: .quad stEvent
|
||||
qAdrszMessErrfen: .quad szMessErrfen
|
||||
qAdrszMessErreur: .quad szMessErreur
|
||||
qAdrwmDeleteMessage: .quad wmDeleteMessage
|
||||
qAdrszLibDW: .quad szLibDW
|
||||
qAdrszMessGoodBye: .quad szMessGoodBye
|
||||
/******************************************************************/
|
||||
/* create Graphic Context */
|
||||
/******************************************************************/
|
||||
/* x0 contains the Display address */
|
||||
/* x1 contains the ident Window */
|
||||
createGC:
|
||||
stp x20,lr,[sp,-16]! // save registers
|
||||
mov x20,x0 // save display address
|
||||
mov x2,#0
|
||||
mov x3,#0
|
||||
bl XCreateGC
|
||||
cbz x0,99f
|
||||
mov x26,x0 // save GC
|
||||
mov x0,x20 // display address
|
||||
mov x1,x26
|
||||
ldr x2,qRed // code RGB color
|
||||
bl XSetForeground
|
||||
cbz x0,99f
|
||||
mov x0,x26 // return GC
|
||||
b 100f
|
||||
99:
|
||||
ldr x0,qAdrszMessErrGC
|
||||
bl affichageMess
|
||||
mov x0,0
|
||||
100:
|
||||
ldp x20,lr,[sp],16 // restaur 2 registers
|
||||
ret // return to address lr x30
|
||||
qAdrszMessErrGC: .quad szMessErrGC
|
||||
qRed: .quad 0xFF0000
|
||||
qGreen: .quad 0xFF00
|
||||
qBlue: .quad 0xFF
|
||||
qBlack: .quad 0x0
|
||||
/******************************************************************/
|
||||
/* display text on screen */
|
||||
/******************************************************************/
|
||||
/* x0 contains the address of text */
|
||||
displayText:
|
||||
stp x1,lr,[sp,-16]! // save registers
|
||||
mov x5,x0 // text address
|
||||
mov x6,0 // text size
|
||||
1: // loop compute text size
|
||||
ldrb w10,[x5,x6] // load text byte
|
||||
cbz x10,2f // zero -> end
|
||||
add x6,x6,1 // increment size
|
||||
b 1b // and loop
|
||||
2:
|
||||
mov x0,x28 // display address
|
||||
mov x1,x27 // ident window
|
||||
mov x2,x26 // GC address
|
||||
mov x3,#50 // position x
|
||||
mov x4,#100 // position y
|
||||
bl XDrawString
|
||||
100:
|
||||
ldp x1,lr,[sp],16 // restaur 2 registers
|
||||
ret // return to address lr x30
|
||||
/********************************************************/
|
||||
/* File Include fonctions */
|
||||
/********************************************************/
|
||||
/* for this file see task include a file in language AArch64 assembly */
|
||||
.include "../includeARM64.inc"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
BEGIN
|
||||
FILE window;
|
||||
open (window, "Hello!", stand draw channel);
|
||||
draw device (window, "X", "600x400");
|
||||
draw erase (window);
|
||||
draw move (window, 0.25, 0.5);
|
||||
draw colour (window, 1, 0, 0);
|
||||
draw text (window, "c", "c", "Goodbye, world!");
|
||||
draw show (window);
|
||||
close (window)
|
||||
END
|
||||
101
Task/Hello-world-Graphical/ATS/hello-world-graphical.ats
Normal file
101
Task/Hello-world-Graphical/ATS/hello-world-graphical.ats
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
//
|
||||
#include
|
||||
"share/atspre_define.hats"
|
||||
#include
|
||||
"share/atspre_staload.hats"
|
||||
//
|
||||
(* ****** ****** *)
|
||||
|
||||
staload UN = $UNSAFE
|
||||
|
||||
(* ****** ****** *)
|
||||
|
||||
staload "{$GLIB}/SATS/glib.sats"
|
||||
|
||||
(* ****** ****** *)
|
||||
|
||||
staload "{$GTK}/SATS/gdk.sats"
|
||||
staload "{$GTK}/SATS/gtk.sats"
|
||||
staload "{$GLIB}/SATS/glib-object.sats"
|
||||
|
||||
(* ****** ****** *)
|
||||
|
||||
%{^
|
||||
typedef char **charpp ;
|
||||
%} ;
|
||||
abstype charpp = $extype"charpp"
|
||||
|
||||
(* ****** ****** *)
|
||||
|
||||
fun hello
|
||||
(
|
||||
widget: !GtkWidget1, _: gpointer
|
||||
) : void = print ("Goodbye, world!\n")
|
||||
|
||||
fun on_delete_event
|
||||
(
|
||||
widget: !GtkWidget1
|
||||
, event: &GdkEvent, udata: gpointer
|
||||
) : gboolean = let
|
||||
val () = print ("delete event occurred\n")
|
||||
in
|
||||
GTRUE // handling of delete-event is finished
|
||||
end // end of [on_delete_event]
|
||||
|
||||
fun on_destroy
|
||||
(widget: !GtkWidget1, _: gpointer): void = gtk_main_quit ()
|
||||
// end of [on_destroy]
|
||||
|
||||
(* ****** ****** *)
|
||||
|
||||
macdef nullp = the_null_ptr
|
||||
|
||||
(* ****** ****** *)
|
||||
|
||||
implement
|
||||
main0 (argc, argv) =
|
||||
{
|
||||
//
|
||||
var argc: int = argc
|
||||
var argv: charpp = $UN.castvwtp1{charpp}(argv)
|
||||
//
|
||||
val () = $extfcall (void, "gtk_init", addr@(argc), addr@(argv))
|
||||
//
|
||||
val window =
|
||||
gtk_window_new (GTK_WINDOW_TOPLEVEL)
|
||||
val () = assertloc (ptrcast(window) > 0)
|
||||
//
|
||||
val _(*id*) =
|
||||
g_signal_connect (
|
||||
window, (gsignal)"destroy", (G_CALLBACK)on_destroy, (gpointer)nullp
|
||||
) (* end of [val] *)
|
||||
val _(*id*) =
|
||||
g_signal_connect (
|
||||
window, (gsignal)"delete_event", (G_CALLBACK)on_delete_event, (gpointer)nullp
|
||||
) (* end of [val] *)
|
||||
//
|
||||
val () = gtk_container_set_border_width (window, (guint)10)
|
||||
val button = gtk_button_new_with_label (gstring("Goodbye, world!"))
|
||||
val () = assertloc (ptrcast(button) > 0)
|
||||
//
|
||||
val () = gtk_widget_show (button)
|
||||
val () = gtk_container_add (window, button)
|
||||
val () = gtk_widget_show (window)
|
||||
//
|
||||
val _(*id*) =
|
||||
g_signal_connect
|
||||
(
|
||||
button, (gsignal)"clicked", (G_CALLBACK)hello, (gpointer)nullp
|
||||
)
|
||||
val _(*id*) =
|
||||
g_signal_connect_swapped
|
||||
(
|
||||
button, (gsignal)"clicked", (G_CALLBACK)gtk_widget_destroy, window
|
||||
)
|
||||
//
|
||||
val () = g_object_unref (button)
|
||||
val () = g_object_unref (window) // ref-count becomes 1!
|
||||
//
|
||||
val ((*void*)) = gtk_main ()
|
||||
//
|
||||
} (* end of [main0] *)
|
||||
2
Task/Hello-world-Graphical/AWK/hello-world-graphical.awk
Normal file
2
Task/Hello-world-Graphical/AWK/hello-world-graphical.awk
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Usage: awk -f hi_win.awk
|
||||
BEGIN { system("msg * Goodbye, Msgbox !") }
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
DEFINE PTR="CARD"
|
||||
|
||||
BYTE FUNC AtasciiToInternal(CHAR c)
|
||||
BYTE c2
|
||||
|
||||
c2=c&$7F
|
||||
IF c2<32 THEN
|
||||
RETURN (c+64)
|
||||
ELSEIF c2<96 THEN
|
||||
RETURN (c-32)
|
||||
FI
|
||||
RETURN (c)
|
||||
|
||||
PROC CharOut(CARD x BYTE y CHAR c)
|
||||
BYTE i,j,v
|
||||
PTR addr
|
||||
|
||||
addr=$E000+AtasciiToInternal(c)*8;
|
||||
FOR j=0 TO 7
|
||||
DO
|
||||
v=Peek(addr)
|
||||
i=8
|
||||
WHILE i>0
|
||||
DO
|
||||
IF (v&1)=0 THEN
|
||||
Color=0
|
||||
ELSE
|
||||
Color=1
|
||||
FI
|
||||
Plot(x+i-1,y+j)
|
||||
|
||||
v=v RSH 1
|
||||
i==-1
|
||||
OD
|
||||
addr==+1
|
||||
OD
|
||||
RETURN
|
||||
|
||||
PROC TextOut(CARD x BYTE y CHAR ARRAY text)
|
||||
BYTE i
|
||||
|
||||
FOR i=1 TO text(0)
|
||||
DO
|
||||
CharOut(x,y,text(i))
|
||||
x==+8
|
||||
OD
|
||||
RETURN
|
||||
|
||||
PROC Frame(CARD x BYTE y,width,height)
|
||||
Color=1
|
||||
Plot(x,y)
|
||||
DrawTo(x+width-1,y)
|
||||
DrawTo(x+width-1,y+height-1)
|
||||
DrawTo(x,y+height-1)
|
||||
DrawTo(x,y)
|
||||
RETURN
|
||||
|
||||
PROC Main()
|
||||
BYTE CH=$02FC,COLOR1=$02C5,COLOR2=$02C6
|
||||
BYTE i,x,y,width=[122],height=[10]
|
||||
|
||||
Graphics(8+16)
|
||||
COLOR1=$0C
|
||||
COLOR2=$02
|
||||
|
||||
FOR i=1 TO 10
|
||||
DO
|
||||
x=Rand(320-width)
|
||||
y=Rand(192-height)
|
||||
Frame(x,y,width,height)
|
||||
TextOut(x+1,y+1,"Goodbye, World!")
|
||||
OD
|
||||
|
||||
DO UNTIL CH#$FF OD
|
||||
CH=$FF
|
||||
RETURN
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
var textField:TextField = new TextField();
|
||||
stage.addChild(textField);
|
||||
textField.text = "Goodbye, World!"
|
||||
47
Task/Hello-world-Graphical/Ada/hello-world-graphical.ada
Normal file
47
Task/Hello-world-Graphical/Ada/hello-world-graphical.ada
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
with Gdk.Event; use Gdk.Event;
|
||||
with Gtk.Label; use Gtk.Label;
|
||||
with Gtk.Window; use Gtk.Window;
|
||||
with Gtk.Widget; use Gtk.Widget;
|
||||
|
||||
with Gtk.Handlers;
|
||||
with Gtk.Main;
|
||||
|
||||
procedure Windowed_Goodbye_World is
|
||||
Window : Gtk_Window;
|
||||
Label : Gtk_Label;
|
||||
|
||||
package Handlers is new Gtk.Handlers.Callback (Gtk_Widget_Record);
|
||||
package Return_Handlers is
|
||||
new Gtk.Handlers.Return_Callback (Gtk_Widget_Record, Boolean);
|
||||
|
||||
function Delete_Event (Widget : access Gtk_Widget_Record'Class)
|
||||
return Boolean is
|
||||
begin
|
||||
return False;
|
||||
end Delete_Event;
|
||||
|
||||
procedure Destroy (Widget : access Gtk_Widget_Record'Class) is
|
||||
begin
|
||||
Gtk.Main.Main_Quit;
|
||||
end Destroy;
|
||||
|
||||
begin
|
||||
Gtk.Main.Init;
|
||||
Gtk.Window.Gtk_New (Window);
|
||||
Gtk_New (Label, "Goodbye, World!");
|
||||
Add (Window, Label);
|
||||
Return_Handlers.Connect
|
||||
( Window,
|
||||
"delete_event",
|
||||
Return_Handlers.To_Marshaller (Delete_Event'Access)
|
||||
);
|
||||
Handlers.Connect
|
||||
( Window,
|
||||
"destroy",
|
||||
Handlers.To_Marshaller (Destroy'Access)
|
||||
);
|
||||
Show_All (Label);
|
||||
Show (Window);
|
||||
|
||||
Gtk.Main.Main;
|
||||
end Windowed_Goodbye_World;
|
||||
|
|
@ -0,0 +1 @@
|
|||
display dialog "Goodbye, World!" buttons {"Bye"}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
1 LET T$ = "GOODBYE, WORLD!"
|
||||
2 LET R = 5:GX = 3:GY = 2:O = 3:XC = R + GX:YC = R * 2 + GY
|
||||
3 TEXT : HOME : TEXT : HGR : HCOLOR= 7: HPLOT 0,0: CALL 62454: HCOLOR= 6
|
||||
4 LET L = LEN (T$): FOR I = 1 TO L:K = ASC ( MID$ (T$,I,1)):XO = XC:YO = YC: GOSUB 5:XC = XO + 1:YC = YO: GOSUB 7: NEXT : END
|
||||
5 IF K > 64 THEN K = K + LC: GOSUB 20:LC = 32: RETURN
|
||||
6 LET LC = 0: ON K > = 32 GOTO 20: RETURN
|
||||
7 GOSUB 20:XC = XC + R * 2 + GX: IF XC > 279 - R THEN XC = R + GX:YC = YC + GY + R * 5
|
||||
8 RETURN
|
||||
9 LET XC = XC - R * 2: RETURN
|
||||
10 LET Y = R:D = 1 - R:X = 0
|
||||
11 IF D > = 0 THEN Y = Y - 1:D = D - Y * 2
|
||||
12 LET D = D + X * 2 + 3
|
||||
13 IF O = 1 OR O = 3 THEN GOSUB 17
|
||||
14 IF O = 2 OR O = 3 THEN GOSUB 19
|
||||
15 LET X = X + 1: IF X < Y THEN 11
|
||||
16 LET O = 3:E = 0: RETURN
|
||||
17 HPLOT XC - X,YC + Y: HPLOT XC + X,YC + Y: HPLOT XC - Y,YC + X: IF NOT E THEN HPLOT XC + Y,YC + X
|
||||
18 RETURN
|
||||
19 HPLOT XC - X,YC - Y: HPLOT XC + X,YC - Y: HPLOT XC - Y,YC - X: HPLOT XC + Y,YC - X: RETURN
|
||||
20 LET M = K - 31
|
||||
21 ON M GOTO 32,33,34,35,36,37,38,39,40,41,42,43,44
|
||||
22 LET M = M - 32
|
||||
23 ON M GOTO 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87
|
||||
24 LET M = M - 32
|
||||
25 ON M GOTO 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,10,112,113,114,115,116,117,118,119,120,121
|
||||
32 RETURN
|
||||
33 HPLOT XC - R,YC - R * 2 TO XC - R,YC + R - GY: HPLOT XC - R,YC + R: GOTO 9: REM !
|
||||
44 HPLOT XC - R,YC + R + R / 2 TO XC - R,YC + R: GOTO 9: REM ,
|
||||
71 LET O = 2:YC = YC - R: GOSUB 10:YC = YC + R: HPLOT XC - R,YC TO XC - R,YC - R: HPLOT XC + R / 2,YC TO XC + R,YC TO XC + R,YC + R:O = 1: GOTO 10: REM G
|
||||
87 HPLOT XC - R,YC - R * 2 TO XC - R,YC + R TO XC,YC TO XC + R,YC + R TO XC + R,YC - R * 2: RETURN : REM W
|
||||
98 HPLOT XC - R,YC - R * 2 TO XC - R,YC + R: GOTO 10: RETURN : REM B
|
||||
100 HPLOT XC + R,YC - R * 2 TO XC + R,YC + R: GOTO 10: REM D
|
||||
101 HPLOT XC - R,YC TO XC + R,YC:E = 1: GOTO 10: REM E
|
||||
108 HPLOT XC - R,YC - R * 2 TO XC - R,YC + R: GOTO 9: REM L
|
||||
114 HPLOT XC - R,YC - R TO XC - R,YC + R:O = 2: GOTO 10: REM R
|
||||
121 HPLOT XC - R,YC - R TO XC,YC + R: HPLOT XC + R,YC - R TO XC - R,YC + R * 3: RETURN : REM Y
|
||||
|
|
@ -0,0 +1 @@
|
|||
popup "" "Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
MsgBox, Goodbye`, World!
|
||||
|
|
@ -0,0 +1 @@
|
|||
ToolTip, Goodbye`, World!
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Gui, Add, Text, x4 y4, To be announced:
|
||||
Gui, Add, Edit, xp+90 yp-3, Goodbye, World!
|
||||
Gui, Add, Button, xp+98 yp-1, OK
|
||||
Gui, Show, w226 h22 , Rosetta Code
|
||||
Return
|
||||
|
|
@ -0,0 +1 @@
|
|||
SplashTextOn, 100, 100, Rosetta Code, Goodbye, World!
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#include <GUIConstantsEx.au3>
|
||||
|
||||
$hGUI = GUICreate("Hello World") ; Create the main GUI
|
||||
GUICtrlCreateLabel("Goodbye, World!", -1, -1) ; Create a label dispalying "Goodbye, World!"
|
||||
|
||||
GUISetState() ; Make the GUI visible
|
||||
|
||||
While 1 ; Infinite GUI loop
|
||||
$nMsg = GUIGetMsg() ; Get any messages from the GUI
|
||||
Switch $nMsg ; Switch for a certain event
|
||||
Case $GUI_EVENT_CLOSE ; When an user closes the windows
|
||||
Exit ; Exit
|
||||
|
||||
EndSwitch
|
||||
WEnd
|
||||
|
|
@ -0,0 +1 @@
|
|||
MsgBox(0, "Goodbye", "Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
ToolTip("Goodbye, World!")
|
||||
3
Task/Hello-world-Graphical/Axe/hello-world-graphical.axe
Normal file
3
Task/Hello-world-Graphical/Axe/hello-world-graphical.axe
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ClrHome
|
||||
Text(0,0,"Goodbye, world!")
|
||||
Pause 5000
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
' Demonstrate a simple Windows application using FreeBasic
|
||||
|
||||
#include once "windows.bi"
|
||||
|
||||
Declare Function WinMain(ByVal hInst As HINSTANCE, _
|
||||
ByVal hPrev As HINSTANCE, _
|
||||
ByVal szCmdLine as String, _
|
||||
ByVal iCmdShow As Integer) As Integer
|
||||
End WinMain( GetModuleHandle( null ), null, Command( ), SW_NORMAL )
|
||||
|
||||
Function WinMain (ByVal hInst As HINSTANCE, _
|
||||
ByVal hPrev As HINSTANCE, _
|
||||
ByVal szCmdLine As String, _
|
||||
ByVal iCmdShow As Integer) As Integer
|
||||
MessageBox(NULL, "Goodbye World", "Goodbye World", MB_ICONINFORMATION)
|
||||
function = 0
|
||||
End Function
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
' Demonstrate a simple Windows/Linux application using GTK/FreeBasic
|
||||
|
||||
#INCLUDE "gtk/gtk.bi"
|
||||
|
||||
gtk_init(@__FB_ARGC__, @__FB_ARGV__)
|
||||
|
||||
VAR win = gtk_window_new (GTK_WINDOW_TOPLEVEL)
|
||||
gtk_window_set_title (gtk_window (win), "Goodbye, World")
|
||||
g_signal_connect(G_OBJECT (win), "delete-event", @gtk_main_quit, 0)
|
||||
gtk_widget_show_all (win)
|
||||
|
||||
gtk_main()
|
||||
|
||||
END 0
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
clg
|
||||
font "times new roman", 20,100
|
||||
color orange
|
||||
rect 10,10, 140,30
|
||||
color red
|
||||
text 10,10, "Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
SYS "MessageBox", @hwnd%, "Goodbye, World!", "", 0
|
||||
1
Task/Hello-world-Graphical/BML/hello-world-graphical.bml
Normal file
1
Task/Hello-world-Graphical/BML/hello-world-graphical.bml
Normal file
|
|
@ -0,0 +1 @@
|
|||
msgbox Goodbye, World!
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
OPTION GUI TRUE
|
||||
|
||||
gui = GUIDEFINE("{ type=window name=window XtNtitle=\"Graphical\" } \
|
||||
{ type=labelWidgetClass name=label parent=window XtNlabel=\"Goodbye, World!\" } ")
|
||||
|
||||
CALL GUIEVENT$(gui)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
OPTION GUI TRUE
|
||||
PRAGMA GUI gtk3
|
||||
|
||||
gui = GUIDEFINE("{ type=WINDOW name=window callback=delete-event title=\"Graphical\" } \
|
||||
{ type=LABEL name=label parent=window margin=5 label=\"Goodbye, World!\" } ")
|
||||
|
||||
CALL GUIEVENT$(gui)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
playfield:
|
||||
................................
|
||||
................................
|
||||
................................
|
||||
.XX..XXX.XXX.XX..XX..X.X.XXX....
|
||||
.X.X.X.X.X.X.X.X.XXX..X..XX...X.
|
||||
.XXX.XXX.XXX.XX..XXX..X..XXX.X..
|
||||
................................
|
||||
.....X.X.XXX.XX..X...XX...X.....
|
||||
.....XXX.X.X.XXX.X...X.X..X.....
|
||||
.....XXX.XXX.X.X.XXX.XX..X......
|
||||
................................
|
||||
end
|
||||
COLUPF = 15
|
||||
COLUBK = 1
|
||||
mainloop
|
||||
drawscreen
|
||||
goto mainloop
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
@echo off
|
||||
|
||||
::Output to message box [Does not work in Window 7 and later]
|
||||
msg * "Goodbye, World!" 2>nul
|
||||
|
||||
::Using MSHTA.EXE Hack::
|
||||
@mshta javascript:alert("Goodbye, World!");code(close());
|
||||
@mshta vbscript:Execute("msgbox(""Goodbye, World!""):code close")
|
||||
pause
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
beads 1 program 'Goodbye World'
|
||||
calc main_init
|
||||
alert('Goodbye, World!')
|
||||
|
||||
draw main_draw
|
||||
draw_str('Goodbye, World!')
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
using namespace System::Windows::Forms;
|
||||
|
||||
int main(array<System::String^> ^args)
|
||||
{
|
||||
MessageBox::Show("Goodbye, World!", "Rosetta Code");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#include <gtkmm.h>
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Gtk::Main app(argc, argv);
|
||||
Gtk::MessageDialog msg("Goodbye, World!");
|
||||
msg.run();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#include "afx.h"
|
||||
void ShowGoodbyeWorld(CWnd* pWnd)
|
||||
{
|
||||
pWnd->SetWindowText(_T("Goodbye, World!"));
|
||||
}
|
||||
15
Task/Hello-world-Graphical/C++/hello-world-graphical-3.cpp
Normal file
15
Task/Hello-world-Graphical/C++/hello-world-graphical-3.cpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Window.H>
|
||||
#include <FL/Fl_Box.H>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
Fl_Window *window = new Fl_Window(300,180);
|
||||
Fl_Box *box = new Fl_Box(20,40,260,100,"Goodbye, World!");
|
||||
box->box(FL_UP_BOX);
|
||||
box->labelsize(36);
|
||||
box->labelfont(FL_BOLD+FL_ITALIC);
|
||||
box->labeltype(FL_SHADOW_LABEL);
|
||||
window->end();
|
||||
window->show(argc, argv);
|
||||
return Fl::run();
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
class Program {
|
||||
static void Main(string[] args) {
|
||||
Application.EnableVisualStyles(); //Optional.
|
||||
MessageBox.Show("Goodbye, World!");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
using Gtk;
|
||||
using GtkSharp;
|
||||
|
||||
public class GoodbyeWorld {
|
||||
public static void Main(string[] args) {
|
||||
Gtk.Window window = new Gtk.Window();
|
||||
window.Title = "Goodbye, World";
|
||||
window.DeleteEvent += delegate { Application.Quit(); };
|
||||
window.ShowAll();
|
||||
Application.Run();
|
||||
}
|
||||
}
|
||||
14
Task/Hello-world-Graphical/C/hello-world-graphical-1.c
Normal file
14
Task/Hello-world-Graphical/C/hello-world-graphical-1.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
int main (int argc, char **argv) {
|
||||
GtkWidget *window;
|
||||
gtk_init(&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Goodbye, World");
|
||||
g_signal_connect (G_OBJECT (window), "delete-event", gtk_main_quit, NULL);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
gtk_main();
|
||||
return 0;
|
||||
}
|
||||
6
Task/Hello-world-Graphical/C/hello-world-graphical-2.c
Normal file
6
Task/Hello-world-Graphical/C/hello-world-graphical-2.c
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include <windows.h>
|
||||
|
||||
int main(void) {
|
||||
MessageBox(NULL, TEXT("Goodbye, World!"), TEXT("Rosetta Code"), MB_OK | MB_ICONINFORMATION);
|
||||
return 0;
|
||||
}
|
||||
20
Task/Hello-world-Graphical/C/hello-world-graphical-3.c
Normal file
20
Task/Hello-world-Graphical/C/hello-world-graphical-3.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <os2.h>
|
||||
|
||||
int main(void) {
|
||||
HAB hab;
|
||||
HMQ hmq;
|
||||
|
||||
hab = WinInitialize(0);
|
||||
hmq = WinCreateMsgQueue(hab, 0);
|
||||
|
||||
WinMessageBox(HWND_DESKTOP,
|
||||
HWND_DESKTOP,
|
||||
"Hello, Presentation Manager!",
|
||||
"My Program",
|
||||
0L,
|
||||
0L);
|
||||
|
||||
WinDestroyMsgQueue(hmq);
|
||||
WinTerminate(hab);
|
||||
return 0;
|
||||
}
|
||||
23
Task/Hello-world-Graphical/C/hello-world-graphical-4.c
Normal file
23
Task/Hello-world-Graphical/C/hello-world-graphical-4.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include <conio.h>
|
||||
#include <graphics.h>
|
||||
|
||||
int main(void) {
|
||||
int Driver = DETECT, Mode;
|
||||
int MaxX, MaxY, X, Y;
|
||||
char Message[] = "Hello, World!";
|
||||
|
||||
initgraph(&Driver, &Mode, "");
|
||||
|
||||
MaxX = getmaxx();
|
||||
MaxY = getmaxy();
|
||||
|
||||
settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 7);
|
||||
|
||||
X = (MaxX - textwidth(Message)) >> 1;
|
||||
Y = (MaxY - textheight(Message)) >> 1;
|
||||
outtextxy(X, Y, Message);
|
||||
|
||||
getch();
|
||||
closegraph();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
CLASS-ID ProgramClass.
|
||||
METHOD-ID Main STATIC.
|
||||
PROCEDURE DIVISION.
|
||||
INVOKE TYPE Application::EnableVisualStyles() *> Optional
|
||||
INVOKE TYPE MessageBox::Show("Goodbye, World!")
|
||||
END METHOD.
|
||||
END CLASS.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
CLASS-ID GoodbyeWorldWPF.Window IS PARTIAL
|
||||
INHERITS TYPE System.Windows.Window.
|
||||
METHOD-ID NEW.
|
||||
PROCEDURE DIVISION.
|
||||
INVOKE self::InitializeComponent()
|
||||
END METHOD.
|
||||
END CLASS.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<Window x:Class="COBOL_WPF.Window1"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Hello world/Graphical">
|
||||
<TextBox>Goodbye, World!</TextBox>
|
||||
</Window>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
*>
|
||||
*> cobweb-gui-hello, using gtk-label
|
||||
*> Tectonics:
|
||||
*> cobc -w -xj cobweb-gui-hello.cob cobweb-gtk.cob \
|
||||
*> `pkg-config --libs gtk+-3.0`
|
||||
*>
|
||||
identification division.
|
||||
program-id. cobweb-gui-hello.
|
||||
|
||||
environment division.
|
||||
configuration section.
|
||||
repository.
|
||||
function new-window
|
||||
function new-box
|
||||
function new-label
|
||||
function gtk-go
|
||||
function all intrinsic.
|
||||
|
||||
data division.
|
||||
working-storage section.
|
||||
|
||||
01 TOPLEVEL usage binary-long value 0.
|
||||
01 HORIZONTAL usage binary-long value 0.
|
||||
01 VERTICAL usage binary-long value 1.
|
||||
|
||||
01 width-hint usage binary-long value 160.
|
||||
01 height-hint usage binary-long value 16.
|
||||
|
||||
01 spacing usage binary-long value 8.
|
||||
01 homogeneous usage binary-long value 0.
|
||||
|
||||
01 extraneous usage binary-long.
|
||||
|
||||
01 gtk-window-data.
|
||||
05 gtk-window usage pointer.
|
||||
01 gtk-container-data.
|
||||
05 gtk-container usage pointer.
|
||||
|
||||
01 gtk-box-data.
|
||||
05 gtk-box usage pointer.
|
||||
01 gtk-label-data.
|
||||
05 gtk-label usage pointer.
|
||||
|
||||
procedure division.
|
||||
cobweb-hello-main.
|
||||
|
||||
*> Main window and top level container
|
||||
move new-window("Hello", TOPLEVEL, width-hint, height-hint)
|
||||
to gtk-window-data
|
||||
move new-box(gtk-window, VERTICAL, spacing, homogeneous)
|
||||
to gtk-container-data
|
||||
|
||||
*> Box, across, with simple label
|
||||
move new-box(gtk-container, HORIZONTAL, spacing, homogeneous)
|
||||
to gtk-box-data
|
||||
move new-label(gtk-box, "Goodbye, World!") to gtk-label-data
|
||||
|
||||
*> GTK+ event loop now takes over
|
||||
move gtk-go(gtk-window) to extraneous
|
||||
|
||||
goback.
|
||||
end program cobweb-gui-hello.
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
program-id. ghello.
|
||||
data division.
|
||||
working-storage section.
|
||||
01 var pic x(1).
|
||||
01 lynz pic 9(3).
|
||||
01 colz pic 9(3).
|
||||
01 msg pic x(15) value "Goodbye, world!".
|
||||
procedure division.
|
||||
accept lynz from lines end-accept
|
||||
divide lynz by 2 giving lynz.
|
||||
accept colz from columns end-accept
|
||||
divide colz by 2 giving colz.
|
||||
subtract 7 from colz giving colz.
|
||||
display msg
|
||||
at line number lynz
|
||||
column number colz
|
||||
end-display
|
||||
accept var end-accept
|
||||
stop run.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
ViewWindow 1,127,1,1,63,1
|
||||
AxesOff
|
||||
CoordOff
|
||||
GridOff
|
||||
LabelOff
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Text 1,1,"Goodbye, World!"
|
||||
ClrGraph
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import StdEnv, StdIO
|
||||
|
||||
Start :: *World -> *World
|
||||
Start world = startIO NDI Void (snd o openDialog undef hello) [] world
|
||||
where
|
||||
hello = Dialog "" (TextControl "Goodbye, World!" [])
|
||||
[WindowClose (noLS closeProcess)]
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
(ns experimentation.core
|
||||
(:import (javax.swing JOptionPane JFrame JTextArea JButton)
|
||||
(java.awt FlowLayout)))
|
||||
|
||||
(JOptionPane/showMessageDialog nil "Goodbye, World!")
|
||||
(let [button (JButton. "Goodbye, World!")
|
||||
window (JFrame. "Goodbye, World!")
|
||||
text (JTextArea. "Goodbye, World!")]
|
||||
(doto window
|
||||
(.setLayout (FlowLayout.))
|
||||
(.add button)
|
||||
(.add text)
|
||||
(.pack)
|
||||
(.setDefaultCloseOperation (JFrame/EXIT_ON_CLOSE))
|
||||
(.setVisible true)))
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
(ns example
|
||||
(:require [cljfx.api :as fx]))
|
||||
|
||||
(fx/on-fx-thread
|
||||
(fx/create-component
|
||||
{:fx/type :stage
|
||||
:showing true
|
||||
:title "Cljfx example"
|
||||
:width 300
|
||||
:height 100
|
||||
:scene {:fx/type :scene
|
||||
:root {:fx/type :v-box
|
||||
:alignment :center
|
||||
:children [{:fx/type :label
|
||||
:text "Goodbye, world"}]}}}))
|
||||
14
Task/Hello-world-Graphical/Cobra/hello-world-graphical.cobra
Normal file
14
Task/Hello-world-Graphical/Cobra/hello-world-graphical.cobra
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@args -pkg:gtk-sharp-2.0
|
||||
|
||||
use Gtk
|
||||
|
||||
class MainProgram
|
||||
def main
|
||||
Application.init
|
||||
dialog = MessageDialog(nil,
|
||||
DialogFlags.DestroyWithParent,
|
||||
MessageType.Info,
|
||||
ButtonsType.Ok,
|
||||
"Goodbye, World!")
|
||||
dialog.run
|
||||
dialog.destroy
|
||||
|
|
@ -0,0 +1 @@
|
|||
alert "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
1 rem hello world on graphics screen
|
||||
2 rem commodore 64 version
|
||||
|
||||
10 print chr$(147): print " press c to clear bitmap area,"
|
||||
15 print " any other key to continue"
|
||||
20 get k$:if k$="" then 20
|
||||
25 if k$<>"c" then goto 40
|
||||
|
||||
30 poke 53280,0:print chr$(147):print " clearing bitmap area... please wait..."
|
||||
35 base=8192:for i=base to base+7999:poke i,0:next
|
||||
|
||||
40 print chr$(147);
|
||||
45 poke 53272,peek(53272) or 8:rem set bitmap memory at 8192 ($2000)
|
||||
50 poke 53265,peek(53265) or 32:rem enter bitmap mode
|
||||
|
||||
55 rem write text to graphics at tx,ty
|
||||
60 t$="goodbye, world!":tx=10:ty=10
|
||||
65 gosub 400
|
||||
|
||||
70 rem draw sine wave - prove we are in hi-res mode
|
||||
75 for x=0 to 319:y=int(50*sin(x/10))+100:gosub 500:next
|
||||
|
||||
80 rem wait for keypress
|
||||
85 get k$:if k$="" then 85
|
||||
|
||||
90 rem back to text mode, restore colors, end program
|
||||
95 poke 53265,peek(53265) and 223:poke 53272,peek(53272) and 247
|
||||
100 poke 53280,14:poke 53281,6:poke 646,14
|
||||
200 end
|
||||
|
||||
400 rem write text to graphics routine
|
||||
405 tx=tx+(40*ty):m=base+(tx*8)
|
||||
410 poke 56334,peek(56334) and 254 : rem turn off keyscan
|
||||
415 poke 1,peek(1) and 251 : rem switch in chargen rom
|
||||
420 for i=1 to len(t$)
|
||||
425 l=asc(mid$(t$,i,1))-64:if l<0 then l=l+64
|
||||
430 for b=0 to 7
|
||||
435 poke m,peek(53248+(l*8)+b)
|
||||
440 m=m+1
|
||||
445 next b, i
|
||||
450 poke 1,peek(1) or 4 : rem switch in io
|
||||
455 poke 56334,peek(56334) or 1 : rem restart keyscan
|
||||
460 return
|
||||
|
||||
500 rem plot a single pixel at x,y
|
||||
510 mem=base+int(y/8)*320+int(x/8)*8+(y and 7)
|
||||
520 px=7-(x and 7)
|
||||
530 poke mem,peek(mem) or 2^px
|
||||
540 return
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
(use-package :ltk)
|
||||
|
||||
(defun show-message (text)
|
||||
"Show message in a label on a Tk window"
|
||||
(with-ltk ()
|
||||
(let* ((label (make-instance 'label :text text))
|
||||
(button (make-instance 'button :text "Done"
|
||||
:command (lambda ()
|
||||
(ltk::break-mainloop)
|
||||
(ltk::update)))))
|
||||
(pack label :side :top :expand t :fill :both)
|
||||
(pack button :side :right)
|
||||
(mainloop))))
|
||||
|
||||
(show-message "Goodbye World")
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
(in-package :clim-user)
|
||||
|
||||
(defclass hello-world-pane
|
||||
(clim-stream-pane) ())
|
||||
|
||||
(define-application-frame hello-world ()
|
||||
((greeting :initform "Goodbye World"
|
||||
:accessor greeting))
|
||||
(:pane (make-pane 'hello-world-pane)))
|
||||
|
||||
;;; Behaviour defined by the Handle Repaint Protocol
|
||||
(defmethod handle-repaint ((pane hello-world-pane) region)
|
||||
(let ((w (bounding-rectangle-width pane))
|
||||
(h (bounding-rectangle-height pane)))
|
||||
;; Blank the pane out
|
||||
(draw-rectangle* pane 0 0 w h
|
||||
:filled t
|
||||
:ink (pane-background pane))
|
||||
;; Draw greeting in center of pane
|
||||
(draw-text* pane
|
||||
(greeting *application-frame*)
|
||||
(floor w 2) (floor h 2)
|
||||
:align-x :center
|
||||
:align-y :center)))
|
||||
|
||||
(run-frame-top-level
|
||||
(make-application-frame 'hello-world
|
||||
:width 200 :height 200))
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
DEF Win:WINDOW
|
||||
DEF Close:CHAR
|
||||
DEF ScreenSizeX,ScreenSizeY:INT
|
||||
|
||||
GETSCREENSIZE(ScreenSizeX,ScreenSizeY)
|
||||
|
||||
WINDOW Win,0,0,ScreenSizeX,ScreenSizeY,0,0,"Goodbye program",MainHandler
|
||||
|
||||
PRINT Win,"Goodbye, World!"
|
||||
'Prints in the upper left corner of the window (position 0,0).
|
||||
|
||||
WAITUNTIL Close=1
|
||||
|
||||
CLOSEWINDOW Win
|
||||
|
||||
END
|
||||
|
||||
SUB MainHandler
|
||||
|
||||
IF @CLASS=@IDCLOSEWINDOW THEN Close=1
|
||||
|
||||
RETURN
|
||||
15
Task/Hello-world-Graphical/D/hello-world-graphical.d
Normal file
15
Task/Hello-world-Graphical/D/hello-world-graphical.d
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import gtk.MainWindow, gtk.Label, gtk.Main;
|
||||
|
||||
class GoodbyeWorld : MainWindow {
|
||||
this() {
|
||||
super("GtkD");
|
||||
add(new Label("Goodbye World"));
|
||||
showAll();
|
||||
}
|
||||
}
|
||||
|
||||
void main(string[] args) {
|
||||
Main.init(args);
|
||||
new GoodbyeWorld();
|
||||
Main.run();
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
main() => runApp( MaterialApp( home: Text( "Goodbye, World!" ) ) );
|
||||
14
Task/Hello-world-Graphical/Dart/hello-world-graphical-2.dart
Normal file
14
Task/Hello-world-Graphical/Dart/hello-world-graphical-2.dart
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
runApp(
|
||||
MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: Scaffold (
|
||||
body: Center (
|
||||
child: Text( "Goodbye, World!")
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import 'dart:html';
|
||||
|
||||
main() => document.body.innerHtml = '<p>Goodbye, World!</p>';
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import 'dart:html';
|
||||
|
||||
main() => window.alert("Goodbye, World!");
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
program HelloWorldGraphical;
|
||||
|
||||
uses
|
||||
Dialogs;
|
||||
|
||||
begin
|
||||
ShowMessage('Goodbye, World!');
|
||||
end.
|
||||
|
|
@ -0,0 +1 @@
|
|||
display_me()_msg(Goodbye, World!);
|
||||
|
|
@ -0,0 +1 @@
|
|||
me_msg(Goodbye, World!);
|
||||
|
|
@ -0,0 +1 @@
|
|||
notify-user("Goodbye, World!", frame: make(<frame>));
|
||||
17
Task/Hello-world-Graphical/E/hello-world-graphical.e
Normal file
17
Task/Hello-world-Graphical/E/hello-world-graphical.e
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
def <widget> := <swt:widgets.*>
|
||||
def SWT := <swt:makeSWT>
|
||||
|
||||
def frame := <widget:makeShell>(currentDisplay)
|
||||
frame.setText("Rosetta Code")
|
||||
frame.setBounds(30, 30, 230, 60)
|
||||
frame.addDisposeListener(def _ { to widgetDisposed(event) {
|
||||
interp.continueAtTop()
|
||||
}})
|
||||
|
||||
def label := <widget:makeLabel>(frame, SWT.getLEFT())
|
||||
label.setText("Goodbye, World!")
|
||||
swtGrid`$frame: $label`
|
||||
|
||||
frame.open()
|
||||
|
||||
interp.blockAtTop()
|
||||
2
Task/Hello-world-Graphical/EC/hello-world-graphical-1.ec
Normal file
2
Task/Hello-world-Graphical/EC/hello-world-graphical-1.ec
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import "ecere"
|
||||
MessageBox goodBye { contents = "Goodbye, World!" };
|
||||
2
Task/Hello-world-Graphical/EC/hello-world-graphical-2.ec
Normal file
2
Task/Hello-world-Graphical/EC/hello-world-graphical-2.ec
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import "ecere"
|
||||
Label label { text = "Goodbye, World!", hasClose = true, opacity = 1, size = { 320, 200 } };
|
||||
15
Task/Hello-world-Graphical/EC/hello-world-graphical-3.ec
Normal file
15
Task/Hello-world-Graphical/EC/hello-world-graphical-3.ec
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "ecere"
|
||||
|
||||
class GoodByeForm : Window
|
||||
{
|
||||
text = "Goodbye, World!";
|
||||
size = { 320, 200 };
|
||||
hasClose = true;
|
||||
|
||||
void OnRedraw(Surface surface)
|
||||
{
|
||||
surface.WriteTextf(10, 10, "Goodbye, World!");
|
||||
}
|
||||
}
|
||||
|
||||
GoodByeForm form {};
|
||||
16
Task/Hello-world-Graphical/EGL/hello-world-graphical.egl
Normal file
16
Task/Hello-world-Graphical/EGL/hello-world-graphical.egl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import org.eclipse.edt.rui.widgets.*;
|
||||
import dojo.widgets.*;
|
||||
|
||||
handler HelloWorld type RUIhandler{initialUI =[ui]}
|
||||
|
||||
ui Box {columns=1, children=[nameField, helloLabel, goButton]};
|
||||
|
||||
nameField DojoTextField {placeHolder = "What's your name?", text = "World"};
|
||||
helloLabel TextLabel {};
|
||||
goButton DojoButton {text = "Say Goodbye", onClick ::= onClick_goButton};
|
||||
|
||||
function onClick_goButton(e Event in)
|
||||
helloLabel.text = "Goodbye, " + nameField.text + "!";
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
move 10 20
|
||||
text "Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
(alert "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import forms;
|
||||
|
||||
public class MainWindow : SDIDialog
|
||||
{
|
||||
Label goodByeWorldLabel;
|
||||
Button closeButton;
|
||||
|
||||
constructor new()
|
||||
<= new()
|
||||
{
|
||||
self.Caption := "ELENA";
|
||||
|
||||
goodByeWorldLabel := Label.new();
|
||||
closeButton := Button.new();
|
||||
|
||||
self
|
||||
.appendControl(goodByeWorldLabel)
|
||||
.appendControl(closeButton);
|
||||
|
||||
self.setRegion(250, 200, 200, 110);
|
||||
|
||||
goodByeWorldLabel.Caption := "Goodbye, World!";
|
||||
goodByeWorldLabel.setRegion(40, 10, 150, 30);
|
||||
|
||||
closeButton.Caption := "Close";
|
||||
closeButton.setRegion(20, 40, 150, 30);
|
||||
closeButton.onClick := (args){ forward program.stop() };
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import xforms;
|
||||
|
||||
const layout = "
|
||||
<Form X=""250"" Y=""200"" Height=""110"" Width=""200"" Caption=""ELENA"">
|
||||
<Label X=""40"" Y=""10"" Width=""150"" Height=""30"" Caption=""Goodbye, World!"">
|
||||
</Label>
|
||||
<Button X=""20"" Y=""40"" Width=""150"" Height=""30"" Caption=""Close"" onClick=""onExit"">
|
||||
</Button>
|
||||
</Form>";
|
||||
|
||||
public class MainWindow
|
||||
{
|
||||
Form;
|
||||
|
||||
constructor new()
|
||||
{
|
||||
Form := xforms.execute(layout, self);
|
||||
}
|
||||
|
||||
onExit(arg)
|
||||
{
|
||||
forward program.stop()
|
||||
}
|
||||
|
||||
dispatch() => Form;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
(message-box "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
include msgbox.e
|
||||
|
||||
integer response
|
||||
response = message_box("Goodbye, World!","Bye",MB_OK)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#light
|
||||
open System
|
||||
open System.Windows.Forms
|
||||
[<EntryPoint>]
|
||||
let main _ =
|
||||
MessageBox.Show("Hello World!") |> ignore
|
||||
0
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using fwt
|
||||
|
||||
class Hello
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
Dialog.openInfo (null, "Goodbye world")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(fn love.load []
|
||||
(love.window.setMode 300 300 {"resizable" false})
|
||||
(love.window.setTitle "Hello world/Graphical in Fennel!"))
|
||||
|
||||
(let [str "Goodbye, World!"]
|
||||
(fn love.draw []
|
||||
(love.graphics.print str 95 150)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
HWND z" Goodbye, World!" z" (title)" MB_OK MessageBox
|
||||
|
|
@ -0,0 +1 @@
|
|||
s" Goodbye, World!" MsgBox
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
program hello
|
||||
use windows
|
||||
integer :: res
|
||||
res = MessageBoxA(0, LOC("Hello, World"), LOC("Window Title"), MB_OK)
|
||||
end program
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
program hello
|
||||
use user32
|
||||
integer :: res
|
||||
res = MessageBox(0, "Hello, World", "Window Title", MB_OK)
|
||||
end program
|
||||
40
Task/Hello-world-Graphical/Fortran/hello-world-graphical-3.f
Normal file
40
Task/Hello-world-Graphical/Fortran/hello-world-graphical-3.f
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
module handlers_m
|
||||
use iso_c_binding
|
||||
use gtk
|
||||
implicit none
|
||||
|
||||
contains
|
||||
|
||||
subroutine destroy (widget, gdata) bind(c)
|
||||
type(c_ptr), value :: widget, gdata
|
||||
call gtk_main_quit ()
|
||||
end subroutine destroy
|
||||
|
||||
end module handlers_m
|
||||
|
||||
program test
|
||||
use iso_c_binding
|
||||
use gtk
|
||||
use handlers_m
|
||||
implicit none
|
||||
|
||||
type(c_ptr) :: window
|
||||
type(c_ptr) :: box
|
||||
type(c_ptr) :: button
|
||||
|
||||
call gtk_init ()
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL)
|
||||
call gtk_window_set_default_size(window, 500, 20)
|
||||
call gtk_window_set_title(window, "gtk-fortran"//c_null_char)
|
||||
call g_signal_connect (window, "destroy"//c_null_char, c_funloc(destroy))
|
||||
box = gtk_hbox_new (TRUE, 10_c_int);
|
||||
call gtk_container_add (window, box)
|
||||
button = gtk_button_new_with_label ("Goodbye, World!"//c_null_char)
|
||||
call gtk_box_pack_start (box, button, FALSE, FALSE, 0_c_int)
|
||||
call g_signal_connect (button, "clicked"//c_null_char, c_funloc(destroy))
|
||||
call gtk_widget_show (button)
|
||||
call gtk_widget_show (box)
|
||||
call gtk_widget_show (window)
|
||||
call gtk_main ()
|
||||
|
||||
end program test
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
screen 1 'Mode 320x200
|
||||
locate 12,15
|
||||
? "Goodbye, World!"
|
||||
sleep
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
#INCLUDE "windows.bi"
|
||||
MessageBox(0, "Goodbye, World!", "Message",0)
|
||||
12
Task/Hello-world-Graphical/Frege/hello-world-graphical.frege
Normal file
12
Task/Hello-world-Graphical/Frege/hello-world-graphical.frege
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package HelloWorldGraphical where
|
||||
|
||||
import Java.Swing
|
||||
|
||||
main _ = do
|
||||
frame <- JFrame.new "Goodbye, world!"
|
||||
frame.setDefaultCloseOperation(JFrame.dispose_on_close)
|
||||
label <- JLabel.new "Goodbye, world!"
|
||||
cp <- frame.getContentPane
|
||||
cp.add label
|
||||
frame.pack
|
||||
frame.setVisible true
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
g = new graphics
|
||||
g.font["SansSerif", 10]
|
||||
g.text["Goodbye, World!", 0, 0, 10 degrees]
|
||||
g.show[]
|
||||
|
||||
g.print[] // Optional: render to printer
|
||||
g.write["GoodbyeWorld.png", 400, 300] // Optional: write to graphics file
|
||||
17
Task/Hello-world-Graphical/FunL/hello-world-graphical.funl
Normal file
17
Task/Hello-world-Graphical/FunL/hello-world-graphical.funl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
native javax.swing.{SwingUtilities, JPanel, JLabel, JFrame}
|
||||
native java.awt.Font
|
||||
|
||||
def createAndShowGUI( msg ) =
|
||||
f = JFrame()
|
||||
f.setTitle( msg )
|
||||
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE )
|
||||
p = JPanel()
|
||||
l = JLabel( msg )
|
||||
l.setFont( Font.decode(Font.SERIF + ' 150') )
|
||||
p.add( l )
|
||||
f.add( p )
|
||||
f.pack()
|
||||
f.setResizable( false )
|
||||
f.setVisible( true )
|
||||
|
||||
SwingUtilities.invokeLater( createAndShowGUI.runnable('Goodbye, World!') )
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alert 1, NSWarningAlertStyle, @"Goodbye, World!", @"It's been real.", @"See ya!", YES
|
||||
|
||||
HandleEvents
|
||||
1
Task/Hello-world-Graphical/GML/hello-world-graphical.gml
Normal file
1
Task/Hello-world-Graphical/GML/hello-world-graphical.gml
Normal file
|
|
@ -0,0 +1 @@
|
|||
draw_text(0,0,"Goodbye World!");
|
||||
|
|
@ -0,0 +1 @@
|
|||
Start,Programs,Accessories,Notepad,Type:Goodbye[comma][space]World[pling]
|
||||
|
|
@ -0,0 +1 @@
|
|||
Message.Info("Goodbye, World!") ' Display a simple message box
|
||||
17
Task/Hello-world-Graphical/Genie/hello-world-graphical.genie
Normal file
17
Task/Hello-world-Graphical/Genie/hello-world-graphical.genie
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[indent=4]
|
||||
/*
|
||||
Genie GTK+ hello
|
||||
valac --pkg gtk+-3.0 hello-gtk.gs
|
||||
./hello-gtk
|
||||
*/
|
||||
uses Gtk
|
||||
|
||||
init
|
||||
Gtk.init (ref args)
|
||||
var window = new Window (WindowType.TOPLEVEL)
|
||||
var label = new Label("Goodbye, World!")
|
||||
window.add(label)
|
||||
window.set_default_size(160, 100)
|
||||
window.show_all()
|
||||
window.destroy.connect(Gtk.main_quit)
|
||||
Gtk.main()
|
||||
|
|
@ -0,0 +1 @@
|
|||
debug="⡧⢼⣟⣋⣇⣀⣇⣀⣏⣹⠀⠀⣇⣼⣏⣹⡯⡽⣇⣀⣏⡱⢘⠀"
|
||||
16
Task/Hello-world-Graphical/Go/hello-world-graphical.go
Normal file
16
Task/Hello-world-Graphical/Go/hello-world-graphical.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package main
|
||||
|
||||
import "github.com/mattn/go-gtk/gtk"
|
||||
|
||||
func main() {
|
||||
gtk.Init(nil)
|
||||
win := gtk.NewWindow(gtk.WINDOW_TOPLEVEL)
|
||||
win.SetTitle("Goodbye, World!")
|
||||
win.SetSizeRequest(300, 200)
|
||||
win.Connect("destroy", gtk.MainQuit)
|
||||
button := gtk.NewButtonWithLabel("Goodbye, World!")
|
||||
win.Add(button)
|
||||
button.Connect("clicked", gtk.MainQuit)
|
||||
win.ShowAll()
|
||||
gtk.Main()
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import groovy.swing.SwingBuilder
|
||||
import javax.swing.JFrame
|
||||
|
||||
new SwingBuilder().edt {
|
||||
optionPane().showMessageDialog(null, "Goodbye, World!")
|
||||
frame(title:'Goodbye, World!', defaultCloseOperation:JFrame.EXIT_ON_CLOSE, pack:true, show: true) {
|
||||
flowLayout()
|
||||
button(text:'Goodbye, World!')
|
||||
textArea(text:'Goodbye, World!')
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
MSGBOX("Goodbye, World!");
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
RECT();
|
||||
TEXTOUT_P("Goodbye, World!", GROBW_P(G0)/4, GROBH_P(G0)/4, 7);
|
||||
WAIT(-1);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
PROCEDURE Main()
|
||||
RETURN wapi_MessageBox(,"Goodbye, World!","")
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue