A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
3
Task/Hello-world-Graphical/0DESCRIPTION
Normal file
3
Task/Hello-world-Graphical/0DESCRIPTION
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
In this User Output task, the goal is to display the string "Goodbye, World!" on a [[GUI]] object (alert box, plain window, text area, etc.).
|
||||
|
||||
See also: [[Hello world/Text]]
|
||||
6
Task/Hello-world-Graphical/1META.yaml
Normal file
6
Task/Hello-world-Graphical/1META.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
category:
|
||||
- Basic language learning
|
||||
note: GUI
|
||||
requires:
|
||||
- Graphics
|
||||
35
Task/Hello-world-Graphical/ATS/hello-world-graphical.ats
Normal file
35
Task/Hello-world-Graphical/ATS/hello-world-graphical.ats
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
%{^
|
||||
extern
|
||||
ats_void_type
|
||||
mainats (ats_int_type argc, ats_ptr_type argv);
|
||||
%}
|
||||
|
||||
staload "contrib/glib/SATS/glib.sats"
|
||||
staload "contrib/glib/SATS/glib-object.sats"
|
||||
staload "contrib/GTK/SATS/gtk.sats"
|
||||
|
||||
extern fun main1 (): void = "main1"
|
||||
|
||||
implement main1 () = () where {
|
||||
val window = gtk_window_new (GTK_WINDOW_TOPLEVEL)
|
||||
val (pf | title) = gstring_of_string ("Goodbye, World!")
|
||||
val () = gtk_window_set_title (window, title)
|
||||
prval () = pf (title)
|
||||
val _sid = g_signal_connect
|
||||
(window, (gsignal)"delete-event", (G_CALLBACK)gtk_main_quit, (gpointer)null)
|
||||
val () = gtk_widget_show (window)
|
||||
val () = gtk_main ()
|
||||
val () = gtk_widget_destroy0 (window)
|
||||
}
|
||||
|
||||
implement main_dummy () = ()
|
||||
|
||||
%{$
|
||||
ats_void_type
|
||||
mainats (ats_int_type argc, ats_ptr_type argv)
|
||||
{
|
||||
gtk_init ((int*)&argc, (char***)&argv);
|
||||
main1 ();
|
||||
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 @@
|
|||
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,9 @@
|
|||
; display a window
|
||||
$hMain = GUICreate("Hello World", 178, 125)
|
||||
GUICtrlCreateLabel("Goodbye, world", 48, 48, 78, 17)
|
||||
GUISetState()
|
||||
While GUIGetMsg() <> -3
|
||||
WEnd
|
||||
GUIDelete($hMain)
|
||||
;a message box
|
||||
MsgBox(0, "", "Goodbye, world")
|
||||
|
|
@ -0,0 +1 @@
|
|||
MsgBox(0,"Goodbye","Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
ToolTip("Goodbye, World!")
|
||||
17
Task/Hello-world-Graphical/BASIC/hello-world-graphical-1.bas
Normal file
17
Task/Hello-world-Graphical/BASIC/hello-world-graphical-1.bas
Normal file
|
|
@ -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
|
||||
14
Task/Hello-world-Graphical/BASIC/hello-world-graphical-2.bas
Normal file
14
Task/Hello-world-Graphical/BASIC/hello-world-graphical-2.bas
Normal file
|
|
@ -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, "Hello World"
|
||||
|
|
@ -0,0 +1 @@
|
|||
SYS "MessageBox", @hwnd%, "Goodbye, World!", "", 0
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using namespace System::Windows::Forms;
|
||||
|
||||
int main(array<System::String^> ^args)
|
||||
{
|
||||
MessageBox::Show("Goodbye, World!", "Rosetta Code");
|
||||
}
|
||||
|
|
@ -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,"Goodby, 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();
|
||||
}
|
||||
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;
|
||||
}
|
||||
5
Task/Hello-world-Graphical/C/hello-world-graphical-2.c
Normal file
5
Task/Hello-world-Graphical/C/hello-world-graphical-2.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include "windows.h"
|
||||
void SayGoodbyeWorld(HWND hWnd)
|
||||
{
|
||||
SetWindowText(hWnd, _T("Goodbye, World!"));
|
||||
}
|
||||
19
Task/Hello-world-Graphical/COBOL/hello-world-graphical.cobol
Normal file
19
Task/Hello-world-Graphical/COBOL/hello-world-graphical.cobol
Normal file
|
|
@ -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,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)]
|
||||
15
Task/Hello-world-Graphical/Clojure/hello-world-graphical.clj
Normal file
15
Task/Hello-world-Graphical/Clojure/hello-world-graphical.clj
Normal file
|
|
@ -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)))
|
||||
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,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")
|
||||
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,8 @@
|
|||
program HelloWorldGraphical;
|
||||
|
||||
uses
|
||||
Dialogs;
|
||||
|
||||
begin
|
||||
ShowMessage('Goodbye, World!');
|
||||
end.
|
||||
|
|
@ -0,0 +1 @@
|
|||
notify-user("hello 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()
|
||||
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,4 @@
|
|||
include msgbox.e
|
||||
|
||||
integer response
|
||||
response = message_box("Goodbye, World!","Bye",MB_OK)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using fwt
|
||||
|
||||
class Hello
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
Dialog.openInfo (null, "Goodbye world")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
HWND z" Goodbye, World!" z" (title)" MB_OK MessageBox
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
g = new graphics
|
||||
g.font["SansSerif", 10]
|
||||
g.text["Hello World!", 0, 0]
|
||||
g.show[]
|
||||
|
||||
g.print[] // Optional: render to printer
|
||||
g.write["HelloWorld.png", 400, 300] // Optional: write to graphics file
|
||||
|
|
@ -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
|
||||
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.Window(gtk.GTK_WINDOW_TOPLEVEL)
|
||||
win.SetTitle("Goodbye, World!")
|
||||
win.SetSizeRequest(300, 200)
|
||||
win.Connect("destroy", gtk.MainQuit)
|
||||
button := gtk.ButtonWithLabel("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,13 @@
|
|||
import Graphics.UI.Gtk
|
||||
import Control.Monad
|
||||
|
||||
messDialog = do
|
||||
initGUI
|
||||
dialog <- messageDialogNew Nothing [] MessageInfo ButtonsOk "Goodbye, World!"
|
||||
|
||||
rs <- dialogRun dialog
|
||||
when (rs == ResponseOk || rs == ResponseDeleteEvent) $ widgetDestroy dialog
|
||||
|
||||
dialog `onDestroy` mainQuit
|
||||
|
||||
mainGUI
|
||||
|
|
@ -0,0 +1 @@
|
|||
*Main> messDialog
|
||||
|
|
@ -0,0 +1 @@
|
|||
WRITE(Messagebox='!') 'Goodbye, World!'
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
link graphics
|
||||
procedure main()
|
||||
WOpen("size=100,20") | stop("No window")
|
||||
WWrites("Goodbye, World!")
|
||||
WDone()
|
||||
end
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import gui
|
||||
$include "guih.icn"
|
||||
|
||||
class WindowApp : Dialog ()
|
||||
|
||||
# -- automatically called when the dialog is created
|
||||
method component_setup ()
|
||||
# add 'hello world' label
|
||||
label := Label("label=Hello world","pos=0,0")
|
||||
add (label)
|
||||
|
||||
# make sure we respond to close event
|
||||
connect(self, "dispose", CLOSE_BUTTON_EVENT)
|
||||
end
|
||||
end
|
||||
|
||||
# create and show the window
|
||||
procedure main ()
|
||||
w := WindowApp ()
|
||||
w.show_modal ()
|
||||
end
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
10 REM FONT DERIVED FROM 04B-09 BY YUJI OSHIMOTO
|
||||
20 GR
|
||||
30 COLOR = 12
|
||||
40 REM G
|
||||
50 HLIN 0,5 AT 0 : HLIN 0,5 AT 1
|
||||
60 VLIN 2,9 AT 0 : VLIN 2,9 AT 1
|
||||
70 HLIN 2,5 AT 9 : HLIN 2,5 AT 8
|
||||
80 VLIN 4,7 AT 5 : VLIN 4,7 AT 4
|
||||
90 VLIN 4,5 AT 3
|
||||
100 REM O
|
||||
110 HLIN 7,12 AT 2 : HLIN 7,12 AT 3
|
||||
120 HLIN 7,12 AT 8 : HLIN 7,12 AT 9
|
||||
130 VLIN 4,7 AT 7 : VLIN 4,7 AT 8
|
||||
140 VLIN 4,7 AT 11 : VLIN 4,7 AT 12
|
||||
150 REM O
|
||||
160 HLIN 14,19 AT 2 : HLIN 14,19 AT 3
|
||||
170 HLIN 14,19 AT 8 : HLIN 14,19 AT 9
|
||||
180 VLIN 4,7 AT 14 : VLIN 4,7 AT 15
|
||||
190 VLIN 4,7 AT 18 : VLIN 4,7 AT 19
|
||||
200 REM D
|
||||
210 HLIN 21,24 AT 2 : HLIN 21,24 AT 3
|
||||
220 HLIN 21,26 AT 8 : HLIN 21,26 AT 9
|
||||
230 VLIN 4,7 AT 21 : VLIN 4,7 AT 22
|
||||
240 VLIN 0,7 AT 25 : VLIN 0,7 AT 26
|
||||
250 REM -
|
||||
260 HLIN 28,33 AT 4 : HLIN 28,33 AT 5
|
||||
270 REM B
|
||||
280 VLIN 11,20 AT 0 : VLIN 11,20 AT 1
|
||||
290 HLIN 2,5 AT 20 : HLIN 2,5 AT 19
|
||||
300 VLIN 15,18 AT 5 : VLIN 15,18 AT 4
|
||||
310 HLIN 2,5 AT 14 : HLIN 2,5 AT 13
|
||||
320 REM Y
|
||||
330 VLIN 13,20 AT 7 : VLIN 13,20 AT 8
|
||||
340 VLIN 19,20 AT 9 : VLIN 19,20 AT 10
|
||||
350 VLIN 13,24 AT 11 : VLIN 13,24 AT 12
|
||||
360 VLIN 23,24 AT 10 : VLIN 23,24 AT 9
|
||||
370 REM E
|
||||
380 VLIN 13,20 AT 14 : VLIN 13,20 AT 15
|
||||
390 HLIN 16,19 AT 13 : HLIN 16,19 AT 14
|
||||
400 HLIN 18,19 AT 15 : HLIN 18,19 AT 16
|
||||
410 HLIN 16,17 AT 17 : HLIN 16,17 AT 18
|
||||
420 HLIN 16,19 AT 19 : HLIN 16,19 AT 20
|
||||
430 REM ,
|
||||
440 VLIN 17,22 AT 21 : VLIN 17,22 AT 22
|
||||
450 REM W
|
||||
460 VLIN 24,33 AT 0 : VLIN 24,33 AT 1 : VLIN 24,33 AT 3
|
||||
470 VLIN 24,33 AT 4 : VLIN 24,33 AT 6 : VLIN 24,33 AT 7
|
||||
480 HLIN 0,7 AT 33 : HLIN 0,7 AT 32
|
||||
490 REM O
|
||||
500 HLIN 9,14 AT 26 : HLIN 9,14 AT 27
|
||||
510 HLIN 9,14 AT 32 : HLIN 9,14 AT 33
|
||||
520 VLIN 28,31 AT 9 : VLIN 28,31 AT 10
|
||||
530 VLIN 28,31 AT 13 : VLIN 28,31 AT 14
|
||||
540 REM R
|
||||
550 HLIN 16,21 AT 26 : HLIN 16,21 AT 27
|
||||
560 VLIN 28,33 AT 16 : VLIN 28,33 AT 17
|
||||
570 REM L
|
||||
580 VLIN 24,33 AT 23 : VLIN 24,33 AT 24
|
||||
590 REM D
|
||||
600 HLIN 26,29 AT 26 : HLIN 26,29 AT 27
|
||||
610 HLIN 26,29 AT 32 : HLIN 26,29 AT 33
|
||||
620 VLIN 28,33 AT 26 : VLIN 28,33 AT 27
|
||||
630 VLIN 24,33 AT 30 : VLIN 24,33 AT 31
|
||||
640 REM !
|
||||
650 VLIN 24,29 AT 33 : VLIN 24,29 AT 34
|
||||
660 VLIN 32,33 AT 33 : VLIN 32,33 AT 34
|
||||
670 END
|
||||
16
Task/Hello-world-Graphical/Ioke/hello-world-graphical.ioke
Normal file
16
Task/Hello-world-Graphical/Ioke/hello-world-graphical.ioke
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import(
|
||||
:javax:swing, :JOptionPane, :JFrame, :JTextArea, :JButton
|
||||
)
|
||||
import java:awt:FlowLayout
|
||||
|
||||
JOptionPane showMessageDialog(nil, "Goodbye, World!")
|
||||
button = JButton new("Goodbye, World!")
|
||||
text = JTextArea new("Goodbye, World!")
|
||||
window = JFrame new("Goodbye, World!") do(
|
||||
layout = FlowLayout new
|
||||
add(button)
|
||||
add(text)
|
||||
pack
|
||||
setDefaultCloseOperation(JFrame field:EXIT_ON_CLOSE)
|
||||
visible = true
|
||||
)
|
||||
1
Task/Hello-world-Graphical/J/hello-world-graphical.j
Normal file
1
Task/Hello-world-Graphical/J/hello-world-graphical.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
wdinfo'Goodbye, World!'
|
||||
24
Task/Hello-world-Graphical/Java/hello-world-graphical.java
Normal file
24
Task/Hello-world-Graphical/Java/hello-world-graphical.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class OutputSwing {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable(){
|
||||
public void run() {
|
||||
JOptionPane.showMessageDialog (null, "Goodbye, World!"); // in alert box
|
||||
JFrame frame = new JFrame("Goodbye, World!"); // on title bar
|
||||
JTextArea text = new JTextArea("Goodbye, World!"); // in editable area
|
||||
JButton button = new JButton("Goodbye, World!"); // on button
|
||||
|
||||
frame.setLayout(new FlowLayout());
|
||||
frame.add(button);
|
||||
frame.add(text);
|
||||
frame.pack();
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
alert("Goodbye, World!");
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function main() {
|
||||
Konsol:Message("Goodbye, World!", "")
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
function main() {
|
||||
Screen:PrintString("Goodbye, World!")
|
||||
while (B1 == false) {
|
||||
Screen:Render()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
NOTICE "Goodbye, world!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
LABEL [Hello, World!]
|
||||
SETLABELHEIGHT 2 * last LABELSIZE
|
||||
LABEL [Goodbye, World!]
|
||||
8
Task/Hello-world-Graphical/Lua/hello-world-graphical.lua
Normal file
8
Task/Hello-world-Graphical/Lua/hello-world-graphical.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require "iuplua"
|
||||
|
||||
dlg = iup.dialog{iup.label{title="Goodbye, World!"}; title="test"}
|
||||
dlg:show()
|
||||
|
||||
if (not iup.MainLoopLevel or iup.MainLoopLevel()==0) then
|
||||
iup.MainLoop()
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
msgbox('Goodbye, World!')
|
||||
|
|
@ -0,0 +1 @@
|
|||
text(0.2,0.2,'Hello World!')
|
||||
|
|
@ -0,0 +1 @@
|
|||
messageBox "Goodbye world"
|
||||
|
|
@ -0,0 +1 @@
|
|||
Maplets:-Display( Maplets:-Elements:-Maplet( [ "Goodbye, World!" ] ) );
|
||||
|
|
@ -0,0 +1 @@
|
|||
CreateDialog["Hello world"]
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
MODULE GUIHello EXPORTS Main;
|
||||
|
||||
IMPORT TextVBT, Trestle;
|
||||
|
||||
<*FATAL ANY*>
|
||||
|
||||
VAR v := TextVBT.New("Goodbye, World!");
|
||||
|
||||
BEGIN
|
||||
Trestle.Install(v);
|
||||
Trestle.AwaitDelete(v);
|
||||
END GUIHello.
|
||||
14
Task/Hello-world-Graphical/PHP/hello-world-graphical.php
Normal file
14
Task/Hello-world-Graphical/PHP/hello-world-graphical.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
if (!class_exists('gtk'))
|
||||
{
|
||||
die("Please load the php-gtk2 module in your php.ini\r\n");
|
||||
}
|
||||
|
||||
$wnd = new GtkWindow();
|
||||
$wnd->set_title('Goodbye world');
|
||||
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
|
||||
|
||||
$lblHello = new GtkLabel("Goodbye, World!");
|
||||
$wnd->add($lblHello);
|
||||
|
||||
$wnd->show_all();
|
||||
Gtk::main();
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Tk;
|
||||
|
||||
my $main = MainWindow->new;
|
||||
$main->Label(-text => 'Goodbye, World')->pack;
|
||||
MainLoop();
|
||||
10
Task/Hello-world-Graphical/Perl/hello-world-graphical-2.pl
Normal file
10
Task/Hello-world-Graphical/Perl/hello-world-graphical-2.pl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Tk;
|
||||
|
||||
my $main = MainWindow->new;
|
||||
$main->Button(
|
||||
-text => 'Goodbye, World',
|
||||
-command => \&exit,
|
||||
)->pack;
|
||||
MainLoop();
|
||||
15
Task/Hello-world-Graphical/Perl/hello-world-graphical-3.pl
Normal file
15
Task/Hello-world-Graphical/Perl/hello-world-graphical-3.pl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Gtk2 '-init';
|
||||
|
||||
my $window = Gtk2::Window->new;
|
||||
$window->set_title('Goodbye world');
|
||||
$window->signal_connect(
|
||||
destroy => sub { Gtk2->main_quit; }
|
||||
);
|
||||
|
||||
my $label = Gtk2::Label->new('Goodbye, world');
|
||||
$window->add($label);
|
||||
|
||||
$window->show_all;
|
||||
Gtk2->main;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use XUL::Gui;
|
||||
|
||||
display Label 'Goodbye, World!';
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use XUL::Gui;
|
||||
|
||||
display Button
|
||||
label => 'Goodbye, World!',
|
||||
oncommand => sub {quit};
|
||||
|
|
@ -0,0 +1 @@
|
|||
(call 'dialog "--msgbox" "Goodbye, World!" 5 20)
|
||||
|
|
@ -0,0 +1 @@
|
|||
send(@display, inform, 'Goodbye, World !').
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
goodbye :-
|
||||
new(D, window('Goodbye')),
|
||||
send(D, size, size(250, 100)),
|
||||
new(S, string("Goodbye, World !")),
|
||||
new(T, text(S)),
|
||||
get(@display, label_font, F),
|
||||
get(F, width(S), M),
|
||||
XT is (250 - M)/2,
|
||||
get(F, height, H),
|
||||
YT = (100-H)/2,
|
||||
send(D, display, T, point(XT, YT)),
|
||||
send(D, open).
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import tkMessageBox
|
||||
|
||||
result = tkMessageBox.showinfo("Some Window Label", "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from tkinter import messagebox
|
||||
|
||||
result = messagebox.showinfo("Some Window Label", "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import PyQt4.QtGui
|
||||
app = PyQt4.QtGui.QApplication([])
|
||||
pb = PyQt4.QtGui.QPushButton('Hello World')
|
||||
pb.connect(pb,PyQt4.QtCore.SIGNAL("clicked()"),pb.close)
|
||||
pb.show()
|
||||
exit(app.exec_())
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
|
||||
window = gtk.Window()
|
||||
window.set_title('Goodbye, World')
|
||||
window.connect('delete-event', gtk.main_quit)
|
||||
window.show_all()
|
||||
gtk.main()
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import wx
|
||||
|
||||
app = wx.App(False)
|
||||
frame = wx.Frame(None, wx.ID_ANY, "Hello, World")
|
||||
frame.Show(True)
|
||||
app.MainLoop()
|
||||
4
Task/Hello-world-Graphical/R/hello-world-graphical.r
Normal file
4
Task/Hello-world-Graphical/R/hello-world-graphical.r
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
library(RGtk2) # bindings to Gtk
|
||||
w <- gtkWindowNew()
|
||||
l <- gtkLabelNew("Goodbye, World!")
|
||||
w$add(l)
|
||||
16
Task/Hello-world-Graphical/REXX/hello-world-graphical-1.rexx
Normal file
16
Task/Hello-world-Graphical/REXX/hello-world-graphical-1.rexx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*REXX (PC/REXX) to display a message in a window (which is bordered). */
|
||||
|
||||
/*REXX (PC/REXX) to display a message in a window (which is bordered). */
|
||||
if fcnpkg('rxwindow')¬==1 then do
|
||||
say 'RXWINDOW function package not loaded.'
|
||||
exit 13
|
||||
end
|
||||
|
||||
if pcvideo()==3 then normal= 7
|
||||
else normal=13
|
||||
|
||||
window#=w_open(1, 1, 3, 80, normal)
|
||||
call w_border window#
|
||||
call w_put window#, 2, 2, center("Goodbye, World!", 80-2)
|
||||
|
||||
/*stick a fork in it, we're done.*/
|
||||
26
Task/Hello-world-Graphical/REXX/hello-world-graphical-2.rexx
Normal file
26
Task/Hello-world-Graphical/REXX/hello-world-graphical-2.rexx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*REXX pgm shows a "hello world" window (& another to show how to close)*/
|
||||
parse upper version !ver .; !pcrexx='REXX/PERSONAL'==!ver |'REXX/PC'==!ver
|
||||
if \!pcrexx then call ser "This isn't PC/REXX" /* is ¬ PC/REXX ? */
|
||||
rxWin=fcnpkg('rxwindow') /*function around?*/
|
||||
if rxWin\==1 then do 1; 'RXWINDOW /q'
|
||||
if fcnpkg('rxwindow')==1 then leave /*function is OK. */
|
||||
say 'error loading RXWINDOW !'; exit 13
|
||||
end
|
||||
top=1; normal=31; border=30; curpos=cursor()
|
||||
width=40; height=11; line.=; line.1='Goodbye, World!'
|
||||
w=w_open(2,3,height+2,width,normal); call w_border w,,,,,border
|
||||
helpLine="press the esc key to quit"
|
||||
helpw=w_open(2,50,3,length(helpLine)+4,normal)
|
||||
call w_border helpw,,,,,border; call w_put helpw,2,3,helpLine
|
||||
call w_hide w, 'n'
|
||||
do k=0 to height-1
|
||||
_=top+k; call w_put w,k+2,3,line._,width-4
|
||||
end /*k*/
|
||||
call w_unhide w; esc='1b'x
|
||||
do forever; if inkey()=esc then leave; end
|
||||
call w_close w
|
||||
call w_close helpw
|
||||
if rxWin\==1 then 'RXUNLOAD rxwindow'
|
||||
parse var curpos row col
|
||||
call cursor row, col
|
||||
/*stick a fork in it, we're done.*/
|
||||
19
Task/Hello-world-Graphical/Racket/hello-world-graphical.rkt
Normal file
19
Task/Hello-world-Graphical/Racket/hello-world-graphical.rkt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#lang racket/gui
|
||||
(require racket/gui/base)
|
||||
|
||||
; Make a frame by instantiating the frame% class
|
||||
(define frame (new frame% [label "Goodbye, World!"]))
|
||||
|
||||
; Make a static text message in the frame
|
||||
(define msg (new message% [parent frame]
|
||||
[label "No events so far..."]))
|
||||
|
||||
; Make a button in the frame
|
||||
(new button% [parent frame]
|
||||
[label "Click Me"]
|
||||
; Callback procedure for a button click:
|
||||
(callback (lambda (button event)
|
||||
(send msg set-label "Button click"))))
|
||||
|
||||
; Show the frame by calling its show method
|
||||
(send frame show #t)
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
require 'gtk2'
|
||||
|
||||
window = Gtk::Window.new
|
||||
window.title = 'Goodbye, World'
|
||||
window.signal_connect(:delete-event) { Gtk.main_quit }
|
||||
window.show_all
|
||||
|
||||
Gtk.main
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
require 'tk'
|
||||
root = TkRoot.new("title" => "User Output")
|
||||
TkLabel.new(root, "text"=>"CHUNKY BACON!").pack("side"=>'top')
|
||||
Tk.mainloop
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#_Note: this code MUST be executed through the Shoes GUI!!
|
||||
|
||||
Shoes.app do
|
||||
para "CHUNKY BACON!", :size => 72
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
swing.Dialog.showMessage(message = "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
import swing._
|
||||
|
||||
object GoodbyeWorld extends SimpleSwingApplication {
|
||||
|
||||
Dialog.showMessage(message = "Goodbye, World!")
|
||||
|
||||
def top = new MainFrame {
|
||||
title = "Goodbye, World!"
|
||||
contents = new FlowPanel {
|
||||
contents += new Button ("Goodbye, World!")
|
||||
contents += new TextArea("Goodbye, World!")
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Task/Hello-world-Graphical/Scheme/hello-world-graphical.ss
Normal file
15
Task/Hello-world-Graphical/Scheme/hello-world-graphical.ss
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!r6rs
|
||||
|
||||
;; PS-TK example: display frame + label
|
||||
|
||||
(import (rnrs)
|
||||
(lib pstk main) ; change this to refer to your PS/Tk installation
|
||||
)
|
||||
|
||||
(define tk (tk-start))
|
||||
(tk/wm 'title tk "PS-Tk Example: Label")
|
||||
|
||||
(let ((label (tk 'create-widget 'label 'text: "Goodbye, world")))
|
||||
(tk/place label 'height: 20 'width: 50 'x: 10 'y: 20))
|
||||
|
||||
(tk-event-loop tk)
|
||||
|
|
@ -0,0 +1 @@
|
|||
MessageBox show: 'Goodbye, world.'
|
||||
|
|
@ -0,0 +1 @@
|
|||
Dialog information: 'Goodbye, world.'
|
||||
|
|
@ -0,0 +1 @@
|
|||
pack [label .l -text "Goodbye, World"]
|
||||
|
|
@ -0,0 +1 @@
|
|||
pack [button .b -text "Goodbye, World" -command exit]
|
||||
|
|
@ -0,0 +1 @@
|
|||
tk_messageBox -message "Goodbye, World"
|
||||
Loading…
Add table
Add a link
Reference in a new issue