Hello world/Graphical: Difference between revisions

sort
m (→‎{{header|Nyquist}}: Now the code is described as being a plugin for Audacity, which it is.)
(sort)
 
(107 intermediate revisions by 49 users not shown)
Line 11:
*   [[Hello world/Text]]
<br><br>
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
<syntaxhighlight lang="aarch64 assembly">
/* 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"
 
</syntaxhighlight>
 
=={{header|Action!}}==
<syntaxhighlight lang="action!">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</syntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Hello_world_graphical.png Screenshot from Atari 8-bit computer]
 
=={{header|ActionScript}}==
<langsyntaxhighlight lang="actionscript">
var textField:TextField = new TextField();
stage.addChild(textField);
textField.text = "Goodbye, World!"
</syntaxhighlight>
</lang>
 
=={{header|Ada}}==
{{libheader|GTK|GtkAda}}
{{libheader|GtkAda}}
<langsyntaxhighlight lang="ada">with Gdk.Event; use Gdk.Event;
with Gtk.Label; use Gtk.Label;
with Gtk.Window; use Gtk.Window;
Line 68 ⟶ 363:
 
Gtk.Main.Main;
end Windowed_Goodbye_World;</langsyntaxhighlight>
 
=={{header|ALGOL 68}}==
The code below is a gentle re-write (including a bug fix) of that in
the Algol 68 Genie documentation.
<langsyntaxhighlight lang="algol68">
BEGIN
FILE window;
Line 84 ⟶ 380:
close (window)
END
</syntaxhighlight>
</lang>
[[Category:ALGOL 68#ALGOL 68]]
 
Line 97 ⟶ 393:
set Screen1.Title to "Goodbye World!"<br>
[https://lh6.googleusercontent.com/-0MGq3ZZTgT8/UuwF5KBd7-I/AAAAAAAAJ-c/HirntN5II9g/s1600/blocks.PNG VIEW THE BLOCKS AND ANDROID APP SCREEN]
 
=={{header|APL}}==
See [http://rosettacode.org/wiki/Simple_windowed_application Simple Windowed Application]
 
=={{header|AppleScript}}==
<langsyntaxhighlight lang="applescript">display dialog "Goodbye, World!" buttons {"Bye"}</langsyntaxhighlight>
 
=={{header|Applesoft BASIC}}==
<langsyntaxhighlight Applesoftlang="applesoft BASICbasic"> 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
Line 136 ⟶ 436:
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</langsyntaxhighlight>
 
=={{header|Arendelle}}==
Line 165 ⟶ 465:
 
// done</pre>
 
=={{header|Arturo}}==
 
<syntaxhighlight lang="rebol">popup "" "Goodbye, World!"</syntaxhighlight>
 
{{out}}
 
Here, you can see what the [https://i.ibb.co/Y35c1Wc/Screenshot-2022-05-13-at-10-57-16.png popup box with our message] looks like (on macOS).
 
=={{header|ATS}}==
<syntaxhighlight lang="ats">//
<lang ATS>//
#include
"share/atspre_define.hats"
Line 267 ⟶ 575:
val ((*void*)) = gtk_main ()
//
} (* end of [main0] *)</langsyntaxhighlight>
 
=={{header|AutoHotkey}}==
 
<syntaxhighlight lang ="autohotkey">MsgBox, Goodbye`, World!</langsyntaxhighlight>
<syntaxhighlight lang ="autohotkey">ToolTip, Goodbye`, World!</langsyntaxhighlight>
<langsyntaxhighlight lang="autohotkey">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</langsyntaxhighlight>
<langsyntaxhighlight lang="autohotkey">SplashTextOn, 100, 100, Rosetta Code, Goodbye, World!</langsyntaxhighlight>
 
=={{header|AutoHotKey V2}}==
<syntaxhighlight lang="autohotkey">
MsgBox("Goodbye, World!")
</syntaxhighlight>
 
=={{header|AutoIt}}==
<langsyntaxhighlight lang="autoit">#include <GUIConstantsEx.au3>
 
$hGUI = GUICreate("Hello World") ; Create the main GUI
Line 296 ⟶ 609:
EndSwitch
WEnd
</syntaxhighlight>
</lang>
 
<langsyntaxhighlight lang="autoit">MsgBox(0, "Goodbye", "Goodbye, World!")</langsyntaxhighlight>
 
<langsyntaxhighlight lang="autoit">ToolTip("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|AWK}}==
Line 310 ⟶ 623:
and [[Hello_world/Graphical#UNIX_Shell|UNIX_Shell]].
 
<langsyntaxhighlight lang="awk"># Usage: awk -f hi_win.awk
BEGIN { system("msg * Goodbye, Msgbox !") }
</syntaxhighlight>
</lang>
 
=={{header|Axe}}==
This example is almost identical to the [[#TI-83_BASIC|TI-83 BASIC version]].
<langsyntaxhighlight lang="axe">ClrHome
Text(0,0,"Goodbye, world!")
Pause 5000</langsyntaxhighlight>
 
=={{header|BaCon}}==
Using Xaw backend:
Uses HUG (High level Universal GUI) shipped in hug.bac
<syntaxhighlight lang="bacon">OPTION GUI TRUE
 
gui = GUIDEFINE("{ type=window name=window XtNtitle=\"Graphical\" } \
<lang qbasic>REM GUI greeting
{ type=labelWidgetClass name=label parent=window XtNlabel=\"Goodbye, World!\" } ")
 
CALL GUIEVENT$(gui)</syntaxhighlight>
INCLUDE "hug.bac"
 
Using GTK3 backend:
mainwindow = WINDOW("BaCon greeting", 225, 40)
<syntaxhighlight lang="bacon">OPTION GUI TRUE
PRAGMA GUI gtk3
 
gui = GUIDEFINE("{ type=WINDOW name=window callback=delete-event title=\"Graphical\" } \
greeting = ENTRY("Goodbye, World!", 115, 30)
{ type=LABEL name=label parent=window margin=5 label=\"Goodbye, World!\" } ")
ATTACH(mainwindow, greeting, 5, 5)
 
CALL GUIEVENT$(gui)</syntaxhighlight>
REM gtk event loop...
DISPLAY
</lang>
 
=={{header|BASIC}}==
{{works with|FreeBASIC}}
<langsyntaxhighlight lang="freebasic">' Demonstrate a simple Windows application using FreeBasic
 
#include once "windows.bi"
Line 354 ⟶ 669:
MessageBox(NULL, "Goodbye World", "Goodbye World", MB_ICONINFORMATION)
function = 0
End Function</langsyntaxhighlight>
 
<langsyntaxhighlight lang="freebasic">' Demonstrate a simple Windows/Linux application using GTK/FreeBasic
 
#INCLUDE "gtk/gtk.bi"
Line 369 ⟶ 684:
gtk_main()
 
END 0</langsyntaxhighlight>
 
=={{header|BASIC256}}==
<syntaxhighlight lang="basic256">clg
<lang BASIC256>clg
font "times new roman", 20,100
color orange
rect 10,10, 140,30
color red
text 10,10, "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Basicbatari CasioBasic}}==
<syntaxhighlight lang="batari basic"> playfield:
To configure the "Graphical screen"
................................
<lang Basic Casio>ViewWindow 1,127,1,1,63,1
................................
AxesOff
................................
CoordOff
.XX..XXX.XXX.XX..XX..X.X.XXX....
GridOff
.X.X.X.X.X.X.X.X.XXX..X..XX...X.
LabelOff</lang>
.XXX.XXX.XXX.XX..XXX..X..XXX.X..
ViewWindow parameters depend on the calculator resolution (These are the most common). <br>
................................
To print text on the "Graphical screen" of the calculator:
.....X.X.XXX.XX..X...XX...X.....
<lang Basic Casio>Text 1,1,"Goodbye, World!"
.....XXX.X.X.XXX.X...X.X..X.....
ClrGraph</lang>
.....XXX.XXX.X.X.XXX.XX..X......
................................
end
COLUPF = 15
COLUBK = 1
mainloop
drawscreen
goto mainloop
</syntaxhighlight>
 
=={{header|Batch File}}==
From Window 7 and later, pure Batch File does not completely provide GUI. However, <code>MSHTA.EXE</code> provides command-line JavaScript/VBScript access.
<langsyntaxhighlight lang="dos">@echo off
 
::Output to message box [Does not work in Window 7 and later]
Line 401 ⟶ 725:
@mshta javascript:alert("Goodbye, World!");code(close());
@mshta vbscript:Execute("msgbox(""Goodbye, World!""):code close")
pause</langsyntaxhighlight>
 
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
<langsyntaxhighlight lang="bbcbasic"> SYS "MessageBox", @hwnd%, "Goodbye, World!", "", 0</langsyntaxhighlight>
 
=={{header|Beads}}==
Beads specializes in graphical design and can use draw_str for html in the browser or alerts for popup boxes.
<syntaxhighlight lang="beads">beads 1 program 'Goodbye World'
calc main_init
alert('Goodbye, World!')
draw main_draw
draw_str('Goodbye, World!')</syntaxhighlight>
 
=={{header|BML}}==
<syntaxhighlight lang ="bml">msgbox Goodbye, World!</langsyntaxhighlight>
 
=={{header|C}}==
=== GTK ===
{{libheader|GTK}}
<langsyntaxhighlight lang="c">#include <gtk/gtk.h>
 
int main (int argc, char **argv) {
Line 425 ⟶ 759:
gtk_main();
return 0;
}</langsyntaxhighlight>
 
{{libheader|=== Win32}} ===
Where hWnd is a valid window handle corresponding to a control in the application
<lang c>#include <windows.h>
void SayGoodbyeWorld(HWND hWnd)
{
SetWindowText(hWnd, _T("Goodbye, World!"));
}</lang>
 
{{libheader|Win32}}
 
Or simplest way:
To compile with Visual C++: <code>cl /nologo hello.c user32.lib</code>, or with Open Watcom: <code>wcl386 /q hello.c user32.lib</code>.
<lang c>#include <windows.h>
 
MessageBox(NULL, _T("Goodbye, World!"), _T("Rosettacode"), MB_OK | MB_ICONINFORMATION);
<syntaxhighlight lang="c">#include <windows.h>
/* different buttons and icons can be used. please read MS documentation for details. */
 
</lang>
int main(void) {
MessageBox(NULL, TEXT("Goodbye, World!"), TEXT("Rosetta Code"), MB_OK | MB_ICONINFORMATION);
return 0;
}</syntaxhighlight>
 
=== OS/2 Presentation Manager ===
 
The following program shows a message box in OS/2 PM. Tested in ArcaOS.
 
To compile with Open Watcom:
 
<pre>wcc386 hello.c
wlink system os2v2_pm name hello file hello.obj</pre>
 
<syntaxhighlight lang="c">#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;
}</syntaxhighlight>
 
=== Turbo C for DOS ===
 
Using the graphics library included with Turbo C. The BGI driver and the font must be in the same directory as the program (<code>EGAVGA.BGI</code> and <code>SANS.CHR</code>). Compile with <code>tcc hellobgi.c graphics.lib</code>.
 
<syntaxhighlight lang="c">#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;
}</syntaxhighlight>
 
=={{header|C sharp|C#}}==
Line 446 ⟶ 836:
{{libheader|Windows Forms}}
 
<langsyntaxhighlight lang="csharp">using System;
using System.Windows.Forms;
 
Line 454 ⟶ 844:
MessageBox.Show("Goodbye, World!");
}
}</langsyntaxhighlight>
 
{{libheader|GTK}}
 
<langsyntaxhighlight lang="csharp">using Gtk;
using GtkSharp;
 
Line 469 ⟶ 859:
Application.Run();
}
}</langsyntaxhighlight>
 
=={{header|C++}}==
Line 475 ⟶ 865:
 
{{libheader|GTK}}<!-- c++ bindings -->
<langsyntaxhighlight lang="cpp">#include <gtkmm.h>
int main(int argc, char *argv[])
{
Line 481 ⟶ 871:
Gtk::MessageDialog msg("Goodbye, World!");
msg.run();
}</langsyntaxhighlight>
{{libheader|Win32}}
All Win32 APIs work in C++ the same way as they do in C. See the C example.
Line 487 ⟶ 877:
{{libheader|MFC}}
Where pWnd is a pointer to a CWnd object corresponding to a valid window in the application.
<langsyntaxhighlight lang="cpp">#include "afx.h"
void ShowGoodbyeWorld(CWnd* pWnd)
{
pWnd->SetWindowText(_T("Goodbye, World!"));
}</langsyntaxhighlight>
 
{{libheader|FLTK}}
 
<langsyntaxhighlight lang="cpp">
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
Line 511 ⟶ 901:
return Fl::run();
}
</syntaxhighlight>
</lang>
 
=={{header|C++/CLI}}==
<langsyntaxhighlight lang="cpp">
using namespace System::Windows::Forms;
 
Line 522 ⟶ 912:
return 0;
}
</syntaxhighlight>
</lang>
 
=={{header|Casio BASIC}}==
To configure the "Graphical screen"
<syntaxhighlight lang="basic casio">ViewWindow 1,127,1,1,63,1
AxesOff
CoordOff
GridOff
LabelOff</syntaxhighlight>
ViewWindow parameters depend on the calculator resolution (These are the most common). <br>
To print text on the "Graphical screen" of the calculator:
<syntaxhighlight lang="basic casio">Text 1,1,"Goodbye, World!"
ClrGraph</syntaxhighlight>
 
=={{header|Clean}}==
{{libheader|Object I/O}}
<langsyntaxhighlight lang="clean">import StdEnv, StdIO
 
Start :: *World -> *World
Line 532 ⟶ 934:
where
hello = Dialog "" (TextControl "Goodbye, World!" [])
[WindowClose (noLS closeProcess)]</langsyntaxhighlight>
 
=={{header|Clojure}}==
<langsyntaxhighlight lang="lisp">(ns experimentation.core
(:import (javax.swing JOptionPane JFrame JTextArea JButton)
(java.awt FlowLayout)))
Line 549 ⟶ 951:
(.pack)
(.setDefaultCloseOperation (JFrame/EXIT_ON_CLOSE))
(.setVisible true)))</langsyntaxhighlight>
 
=== With cljfx ===
{{libheader|cljfx}}
<syntaxhighlight lang="lisp">(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"}]}}}))</syntaxhighlight>
 
=={{header|COBOL}}==
Line 558 ⟶ 978:
{{libheader|Windows Forms}}
{{trans|C#}}
<langsyntaxhighlight lang="cobol"> CLASS-ID ProgramClass.
METHOD-ID Main STATIC.
PROCEDURE DIVISION.
Line 564 ⟶ 984:
INVOKE TYPE MessageBox::Show("Goodbye, World!")
END METHOD.
END CLASS.</langsyntaxhighlight>
 
{{libheader|Windows Presentation Foundation}}
gui.xaml.cbl:
<langsyntaxhighlight lang="cobol"> CLASS-ID GoodbyeWorldWPF.Window IS PARTIAL
INHERITS TYPE System.Windows.Window.
METHOD-ID NEW.
Line 574 ⟶ 994:
INVOKE self::InitializeComponent()
END METHOD.
END CLASS.</langsyntaxhighlight>
 
gui.xaml:
<langsyntaxhighlight lang="xaml"><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></langsyntaxhighlight>
 
===GTK===
{{works with|GnuCOBOL|2.0}}
{{libheader|cobweb-gtk}}
<langsyntaxhighlight lang="cobol"> *>
*> cobweb-gui-hello, using gtk-label
*> Tectonics:
Line 648 ⟶ 1,068:
 
goback.
end program cobweb-gui-hello.</langsyntaxhighlight>
 
===TUI===
Line 655 ⟶ 1,075:
The program gets the lines and columns of the screen and positions the text in the middle. Program waits for a return key.
 
<langsyntaxhighlight lang="cobol"> program-id. ghello.
data division.
working-storage section.
Line 673 ⟶ 1,093:
end-display
accept var end-accept
stop run.</langsyntaxhighlight>
 
=={{header|Cobra}}==
Line 679 ⟶ 1,099:
Requires {{libheader|GTK#}} GUI library.
 
<langsyntaxhighlight lang="cobra">
@args -pkg:gtk-sharp-2.0
 
Line 694 ⟶ 1,114:
dialog.run
dialog.destroy
</syntaxhighlight>
</lang>
 
=={{header|CoffeeScript}}==
<langsyntaxhighlight lang="coffeescript">alert "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Commodore BASIC}}==
===Commodore 64===
There are no text drawing routines in BASIC that apply to the high resolution bitmap mode on the Commodore 64. Therefore, it is necessary to either draw letterforms from designs stored in RAM, or copy the font contained in ROM. It should be noted that using BASIC to handle high resolution graphics is a slow process, and the same tasks are much more efficiently accomplished in assembly language/machine code.
 
This example will iterate through the string and copy the appropriate bitmap information from the Character ROM. In line 425 a conversion must take place since strings are stored in memory as bytes of ASCII (PETSCII) codes, however, the Character ROM is stored in order of the screen codes as found in [https://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference_guide-07-appendices.pdf Appendix B] of the Commodore 64 Programmer's Reference Guide... And even then the conversion given will work only for a limited set of the Character ROM. This could be remedied if the Character ROM (or some other font definition) was copied to RAM and indexed in ASCII/PETSCII order.
 
The POKE statements encapsulating the text drawing routine (lines 410-415 and 450-455) are necessary to make the Character ROM visible to BASIC without crashing the operating system. As such, keyboard scanning must be suspended during this time, preventing the routine from any user interruption until it is finished.
 
<syntaxhighlight lang="commodorebasicv2">
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
</syntaxhighlight>
 
 
=={{header|Common Lisp}}==
This can be done using the extension package ''ltk'' that provides an interface to the ''Tk'' library.
{{libheader|Tk}}
<langsyntaxhighlight lang="lisp">(use-package :ltk)
 
(defun show-message (text)
Line 716 ⟶ 1,197:
(mainloop))))
 
(show-message "Goodbye World")</langsyntaxhighlight>
 
This can also be done using the ''CLIM 2.0'' specification. The following code runs on both SBCL and the LispWorks
IDE:
{{libheader|CLIM}}
<langsyntaxhighlight lang="lisp">
((in-package :clim-user)
 
(defclass hello-world-pane
Line 749 ⟶ 1,230:
(run-frame-top-level
(make-application-frame 'hello-world
:width 200 :height 200))</langsyntaxhighlight>
 
=={{header|Creative Basic}}==
<syntaxhighlight lang="creative basic">
<lang Creative Basic>
DEF Win:WINDOW
DEF Close:CHAR
Line 775 ⟶ 1,256:
 
RETURN
</syntaxhighlight>
</lang>
 
=={{header|Crystal}}==
 
{{libheader|CrSFML}}
 
<syntaxhighlight lang="crystal">
require "crsfml"
 
window = SF::RenderWindow.new(SF::VideoMode.new(800, 600), "Hello world/Graphical")
 
# A font file(s) MUST be in the directory of the Crystal file itself.
# CrSFML does NOT load font files from the filesystem root!
font = SF::Font.from_file("DejaVuSerif-Bold.ttf")
 
text = SF::Text.new
text.font = font
 
text.string = "Goodbye, world!"
text.character_size = 24
 
text.color = SF::Color::Black
 
while window.open?
while event = window.poll_event
if event.is_a? SF::Event::Closed
window.close
end
end
window.clear(SF::Color::White)
window.draw(text)
window.display
end
</syntaxhighlight>
 
=={{header|D}}==
{{libheader|gtkD}}
<langsyntaxhighlight lang="d">import gtk.MainWindow, gtk.Label, gtk.Main;
 
class GoodbyeWorld : MainWindow {
Line 793 ⟶ 1,310:
new GoodbyeWorld();
Main.run();
}</langsyntaxhighlight>
 
=={{header|Dart}}==
===Flutter===
{{libheader|Flutter}}
Because Flutter works on the Web in addition to Mobiles and Desktop, you can view these examples on Dartpad! - https://dartpad.github.io
 
Simplest (and ugliest) solution
<syntaxhighlight lang="javascript">import 'package:flutter/material.dart';
 
main() => runApp( MaterialApp( home: Text( "Goodbye, World!" ) ) );
</syntaxhighlight>
 
A still bare bones but much better looking example that displays a white screen with the text centered
<syntaxhighlight lang="javascript">import 'package:flutter/material.dart';
 
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold (
body: Center (
child: Text( "Goodbye, World!")
)
)
)
);
}
</syntaxhighlight>
 
 
Html dom manipulation, Dart has first class support for compilation to JavaScript. This simply sets the innerHtml of the body to 'Goodbye, World!'
 
===Web/Javascript===
{{libheader|dart:html}}
<syntaxhighlight lang="javascript">import 'dart:html';
 
main() => document.body.innerHtml = '<p>Goodbye, World!</p>';
</syntaxhighlight>
 
{{trans|JavaScript}}
<syntaxhighlight lang="javascript">import 'dart:html';
 
main() => window.alert("Goodbye, World!");
</syntaxhighlight>
 
=={{header|Delphi}}==
<langsyntaxhighlight Delphilang="delphi">program HelloWorldGraphical;
 
uses
Line 803 ⟶ 1,364:
begin
ShowMessage('Goodbye, World!');
end.</langsyntaxhighlight>
 
=={{header|Diego}}==
To differentiate only a GUI message use the <code>display_</code> verb.
<syntaxhighlight lang="diego">display_me()_msg(Goodbye, World!);</syntaxhighlight>
However, using the <code>_msg</code> (short for 'message') action will send a string message to the callee who may decide to display the string graphically...
<syntaxhighlight lang="diego">me_msg(Goodbye, World!);</syntaxhighlight>
 
=={{header|Dylan}}==
(This works entered into the interactive shell):
<langsyntaxhighlight lang="dylan">notify-user("helloGoodbye, worldWorld!", frame: make(<frame>));</langsyntaxhighlight>
 
=={{header|E}}==
Line 815 ⟶ 1,382:
This is a complete application. If it were part of a larger application, the portions related to <code>interp</code> would be removed.
 
<langsyntaxhighlight lang="e">def <widget> := <swt:widgets.*>
def SWT := <swt:makeSWT>
 
Line 831 ⟶ 1,398:
frame.open()
 
interp.blockAtTop()</langsyntaxhighlight>
 
=={{header|EasyLang}}==
 
[https://easylang.dev/show/#cod=y80vS1UwNFAwMuAqSa0oUVByz89PSapM1VEIzy/KSVFU4gIA Run it]
<lang>move 10 20
 
text "Goodbye, World!"</lang>
<syntaxhighlight lang="text">
move 10 20
text "Goodbye, World!"
</syntaxhighlight>
 
=={{header|eC}}==
MessageBox:
 
<langsyntaxhighlight lang="ec">import "ecere"
MessageBox goodBye { contents = "Goodbye, World!" };</langsyntaxhighlight>
 
Label:
 
<langsyntaxhighlight lang="ec">import "ecere"
Label label { text = "Goodbye, World!", hasClose = true, opacity = 1, size = { 320, 200 } };</langsyntaxhighlight>
 
Titled Form + Surface Output:
 
<langsyntaxhighlight lang="ec">import "ecere"
 
class GoodByeForm : Window
Line 865 ⟶ 1,436:
}
 
GoodByeForm form {};</langsyntaxhighlight>
 
=={{header|EchoLisp}}==
<langsyntaxhighlight lang="lisp">
(alert "Good byeGoodbye, worldWorld!")
</syntaxhighlight>
</lang>
 
=={{header|EGL}}==
{{works with|EDT}}
Allows entry of any name into a text field (using "World" as the default entry). Then, when the "Say Goodbye" button is pressed, sets a text label to the value "Goodbye, <name>!".
<syntaxhighlight lang="egl">
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
</syntaxhighlight>
 
=={{header|Elena}}==
ELENA 46.x :
<langsyntaxhighlight lang="elena">import forms;
public class MainWindow : SDIDialog
Line 882 ⟶ 1,475:
constructor new()
<= super new()
{
goodByeWorldLabelself.Caption := new Label()"ELENA";
closeButton := new Button();
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() };
}
}</langsyntaxhighlight>
=== Alternative version using xforms script ===
 
<syntaxhighlight lang="elena">import xforms;
=={{header|Euphoria}}==
===Message box===
<lang euphoria>include msgbox.e
 
const layout = "
integer response
<Form X=""250"" Y=""200"" Height=""110"" Width=""200"" Caption=""ELENA"">
response = message_box("Goodbye, World!","Bye",MB_OK)</lang>
<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;
}</syntaxhighlight>
 
=={{header|EGLEmacs Lisp}}==
<syntaxhighlight lang="lisp">
{{works with|EDT}}
(message-box "Goodbye, World!")
Allows entry of any name into a text field (using "World" as the default entry). Then, when the "Say Goodbye" button is pressed, sets a text label to the value "Goodbye, <name>!".
</syntaxhighlight>
<lang egl>
import org.eclipse.edt.rui.widgets.*;
import dojo.widgets.*;
 
handler HelloWorld type RUIhandler{initialUI =[ui]}
 
=={{header|Euphoria}}==
ui Box {columns=1, children=[nameField, helloLabel, goButton]};
===Message box===
<syntaxhighlight lang="euphoria">include msgbox.e
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
</lang>
 
integer response
response = message_box("Goodbye, World!","Bye",MB_OK)</syntaxhighlight>
 
=={{header|F_Sharp|F#}}==
Just display the text in a message box.
<langsyntaxhighlight lang="fsharp">#light
open System
open System.Windows.Forms
Line 940 ⟶ 1,547:
let main _ =
MessageBox.Show("Hello World!") |> ignore
0</langsyntaxhighlight>
 
=={{header|Factor}}==
Line 948 ⟶ 1,555:
 
=={{header|Fantom}}==
<langsyntaxhighlight lang="fantom">
using fwt
 
Line 958 ⟶ 1,565:
}
}
</syntaxhighlight>
</lang>
 
=={{header|Fennel}}==
{{libheader|LÖVE}}
<syntaxhighlight lang="fennel">
(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)))
</syntaxhighlight>
To run this, you need to have LÖVE installed in your machine, and then run this command <code>fennel --compile love_test.fnl > main.lua; love .</code>. Since LÖVE has no compatibility with Fennel, we need to AOT-compile the file to a Lua file called <code>main.lua</code>, so then LÖVE can execute the program.
 
=={{header|Forth}}==
Line 964 ⟶ 1,584:
{{works with|SwiftForth}}
 
<langsyntaxhighlight lang="forth">HWND z" Goodbye, World!" z" (title)" MB_OK MessageBox</langsyntaxhighlight>
 
Alternative:
{{works with|Win32Forth|6.15.03}}
<langsyntaxhighlight lang="forth"> s" Goodbye, World!" MsgBox</langsyntaxhighlight>
 
=={{header|Fortran}}==
Line 976 ⟶ 1,596:
 
{{works with|Absoft Pro Fortran}}
<langsyntaxhighlight lang="fortran">program hello
use windows
integer :: res
res = MessageBoxA(0, LOC("Hello, World"), LOC("Window Title"), MB_OK)
end program</langsyntaxhighlight>
 
Compile with <code>af90 hello.f90 user32.lib</code> or for a 64-bit executable <code>af90 -i8 -m64 hello.f90 user32.lib</code>.
 
{{works with|Intel Fortran}}
<langsyntaxhighlight lang="fortran">program hello
use user32
integer :: res
res = MessageBox(0, "Hello, World", "Window Title", MB_OK)
end program</langsyntaxhighlight>
 
Compile with <code>ifort hello.f90</code>.
Line 996 ⟶ 1,616:
Using [https://github.com/jerryd/gtk-fortran gtk-fortran] library
{{works with|GNU Fortran}}
<langsyntaxhighlight lang="fortran">
module handlers_m
use iso_c_binding
Line 1,037 ⟶ 1,657:
end program test
</syntaxhighlight>
</lang>
Compile with
<code>gfortran gtk2_mini.f90 -o gtk2_mini.x `pkg-config --cflags --libs gtk-2-fortran`</code>
Line 1,044 ⟶ 1,664:
 
'''Graphics Mode'''
{{works with|QBasic}}
<lang FreeBASIC>screen 1 'Mode 320x200
<syntaxhighlight lang="freebasic">screen 1 'Mode 320x200
locate 12,15
? "Goodbye, World!"
sleep</langsyntaxhighlight>
 
'''Windows API'''
<langsyntaxhighlight FreeBASIClang="freebasic">#INCLUDE "windows.bi"
MessageBox(0, "Goodbye, World!", "Message",0)</langsyntaxhighlight>
 
=={{header|Frege}}==
 
<langsyntaxhighlight lang="frege">package HelloWorldGraphical where
 
import Java.Swing
Line 1,066 ⟶ 1,687:
cp.add label
frame.pack
frame.setVisible true</langsyntaxhighlight>
 
=={{header|Frink}}==
Line 1,075 ⟶ 1,696:
The graphics are infinitely-scalable and can be rendered at full quality to any resolution. This program "shows off" by rotating the text by 10 degrees, and also rendering it to a printer (which can include tiling across multiple pages) and rendering to a graphics file. (Frink can automatically render the same graphics object to many image formats, including PNG, JPG, SVG, HTML5 canvas, animated GIF, bitmapped image in memory, and more.)
 
<langsyntaxhighlight lang="frink">
g = new graphics
g.font["SansSerif", 10]
Line 1,083 ⟶ 1,704:
g.print[] // Optional: render to printer
g.write["GoodbyeWorld.png", 400, 300] // Optional: write to graphics file
</syntaxhighlight>
</lang>
 
=={{header|FunL}}==
<langsyntaxhighlight lang="funl">native javax.swing.{SwingUtilities, JPanel, JLabel, JFrame}
native java.awt.Font
 
Line 1,102 ⟶ 1,723:
f.setVisible( true )
 
SwingUtilities.invokeLater( createAndShowGUI.runnable('Goodbye, World!') )</langsyntaxhighlight>
 
 
=={{header|FutureBasic}}==
Easy peasy.
<syntaxhighlight lang="futurebasic">
alert 1, NSWarningAlertStyle, @"Goodbye, World!", @"It's been real.", @"See ya!", YES
 
HandleEvents
</syntaxhighlight>
 
 
 
=={{header|Gambas}}==
 
<langsyntaxhighlight lang="gambas">Message.Info("Goodbye, World!") ' Display a simple message box</langsyntaxhighlight>
 
=={{header|Genie}}==
<langsyntaxhighlight lang="genie">[indent=4]
/*
Genie GTK+ hello
Line 1,125 ⟶ 1,757:
window.show_all()
window.destroy.connect(Gtk.main_quit)
Gtk.main()</langsyntaxhighlight>
 
=={{header|GlovePIE}}==
The text is rendered using Braille text characters.
<langsyntaxhighlight GlovePIElang="glovepie">debug="⡧⢼⣟⣋⣇⣀⣇⣀⣏⣹⠀⠀⣇⣼⣏⣹⡯⡽⣇⣀⣏⡱⢘⠀"</langsyntaxhighlight>
 
=={{header|GML}}==
<langsyntaxhighlight lang="gml">draw_text(0,0,"Goodbye World!");</langsyntaxhighlight>
 
=={{header|Go}}==
{{libheader|go-gtk}}
<langsyntaxhighlight lang="go">package main
 
import "github.com/mattn/go-gtk/gtk"
Line 1,151 ⟶ 1,783:
win.ShowAll()
gtk.Main()
}</langsyntaxhighlight>
 
=={{header|Groovy}}==
{{trans|Java}}
<langsyntaxhighlight lang="groovy">import groovy.swing.SwingBuilder
import javax.swing.JFrame
 
Line 1,166 ⟶ 1,798:
}
}
</syntaxhighlight>
</lang>
 
=={{header|GUISS}}==
Line 1,172 ⟶ 1,804:
Here we display the message on the system notepad:
 
<langsyntaxhighlight lang="guiss">Start,Programs,Accessories,Notepad,Type:Goodbye[comma][space]World[pling]</langsyntaxhighlight>
 
=={{header|Harbour}}==
<langsyntaxhighlight lang="visualfoxpro">PROCEDURE Main()
RETURN wapi_MessageBox(,"Goodbye, World!","")
</syntaxhighlight>
</lang>
 
=={{header|Haskell}}==
Using {{libheader|gtk}} from [http://hackage.haskell.org/packages/hackage.html HackageDB]
<langsyntaxhighlight lang="haskell">import Graphics.UI.Gtk
import Control.Monad
 
Line 1,193 ⟶ 1,825:
dialog `onDestroy` mainQuit
mainGUI</langsyntaxhighlight>
Run in GHCi interpreter:
<syntaxhighlight lang ="haskell">*Main> messDialog</langsyntaxhighlight>
 
=={{header|HicEst}}==
<langsyntaxhighlight lang="hicest">WRITE(Messagebox='!') 'Goodbye, World!'</langsyntaxhighlight>
 
=={{header|HPPPL}}==
With an alert box:
<lang HPPPL>MSGBOX("Goodbye, World!");</lang>
By drawing directly to the screen:
<lang HPPPL>RECT();
TEXTOUT_P("Goodbye, World!", GROBW_P(G0)/4, GROBH_P(G0)/4, 7);
WAIT(-1);</lang>
 
=={{header|i}}==
<lang i>graphics {
display("Goodbye, World!")
}</lang>
 
=={{header|HolyC}}==
<langsyntaxhighlight lang="holyc">PopUpOk("Goodbye, World!");</langsyntaxhighlight>
 
== Icon and Unicon ==
 
==={{header|Icon}}===
<langsyntaxhighlight Iconlang="icon">link graphics
procedure main()
WOpen("size=100,20") | stop("No window")
WWrites("Goodbye, World!")
WDone()
end</langsyntaxhighlight>
{{libheader|Icon Programming Library}}
[http://www.cs.arizona.edu/icon/library/src/gprocs/graphics.icn graphics is required ]
Line 1,230 ⟶ 1,849:
==={{header|Unicon}}===
 
<langsyntaxhighlight lang="unicon">
import gui
$include "guih.icn"
Line 1,252 ⟶ 1,871:
w.show_modal ()
end
</syntaxhighlight>
</lang>
 
=={{header|HPPPL}}==
With an alert box:
<syntaxhighlight lang="hpppl">MSGBOX("Goodbye, World!");</syntaxhighlight>
By drawing directly to the screen:
<syntaxhighlight lang="hpppl">RECT();
TEXTOUT_P("Goodbye, World!", GROBW_P(G0)/4, GROBH_P(G0)/4, 7);
WAIT(-1);</syntaxhighlight>
 
=={{header|i}}==
<syntaxhighlight lang="i">graphics {
display("Goodbye, World!")
}</syntaxhighlight>
 
=={{header|Integer BASIC}}==
Line 1,258 ⟶ 1,890:
40&times;40 isn't great resolution, but it's enough!
 
<langsyntaxhighlight lang="basic">
10 REM FONT DERIVED FROM 04B-09 BY YUJI OSHIMOTO
20 GR
Line 1,326 ⟶ 1,958:
660 VLIN 32,33 AT 33 : VLIN 32,33 AT 34
670 END
</syntaxhighlight>
</lang>
 
=={{header|Ioke}}==
{{trans|Java}}
<langsyntaxhighlight lang="ioke">import(
:javax:swing, :JOptionPane, :JFrame, :JTextArea, :JButton
)
Line 1,345 ⟶ 1,977:
setDefaultCloseOperation(JFrame field:EXIT_ON_CLOSE)
visible = true
)</langsyntaxhighlight>
 
=={{header|IWBASIC}}==
<syntaxhighlight lang="iwbasic">
<lang IWBASIC>
DEF Win:WINDOW
DEF Close:CHAR
Line 1,371 ⟶ 2,004:
RETURN
ENDSUB
</syntaxhighlight>
</lang>
 
=={{header|J}}==
<syntaxhighlight lang ="j">wdinfo 'Goodbye, World!'</langsyntaxhighlight>
 
=={{header|Java}}==
{{libheader|Swing}}
<langsyntaxhighlight lang="java">import javax.swing.*;
import java.awt.*;
 
Line 1,401 ⟶ 2,034:
});
}
}</langsyntaxhighlight>
 
Using Java 8 lambdas syntax:
 
<langsyntaxhighlight lang="java">import javax.swing.*;
import java.awt.*;
 
Line 1,425 ⟶ 2,058:
});
}
}</langsyntaxhighlight>
 
=={{header|JavaScript}}==
<langsyntaxhighlight lang="javascript"> alert("Goodbye, World!");</langsyntaxhighlight>
 
=={{header|jq}}==
Line 1,441 ⟶ 2,074:
 
'''Part 1: Generic SVG-related functions'''
<langsyntaxhighlight lang="jq"># Convert a JSON object to a string suitable for use as a CSS style value
# e.g: "font-size: 40px; text-align: center;" (without the quotation marks)
def to_s:
Line 1,475 ⟶ 2,108:
| "<text x='\(x//0)' y='\(y//0)' style='\($style)'>
\(.)",
"</text>";</langsyntaxhighlight>
'''Part 2: "Goodbye, World!"'''
<langsyntaxhighlight lang="jq">def task:
svg(null;null), # use the defaults
linearGradient("gradient"; "rgb(255,255,0)"; "rgb(255,0,0)"), # define "gradient"
Line 1,483 ⟶ 2,116:
"</svg>";
 
task</langsyntaxhighlight>
{{out}}
jq -n -r -f Hello_word_Graphical.jq > Hello_word_Graphical.svg
 
=={{header|JSE}}==
<syntaxhighlight lang="jse">Text 25,10,"Goodbye, World!"</syntaxhighlight>
 
=={{header|Jsish}}==
Line 1,500 ⟶ 2,136:
That is based on JSI CData, a blend of typed Javascript and C, interwoven via a preprocessor.
 
<langsyntaxhighlight lang="c">extension JsiAgarGUI = { // libAgar GUI from Jsi
/*
Alert popup, via libAgar and Jsish CData
Line 1,542 ⟶ 2,178:
return rc;
}
};</langsyntaxhighlight>
 
Build rules are ''jsish -c'' preprocessor, query ''jsish'' for C compile time flags, compile the C, load the module into jsish via ''require''.
Line 1,575 ⟶ 2,211:
 
As listed at the top, this GUI can be called up while in the interactive console.
 
=={{header|Just Basic}}==
<lang Just Basic>
print "Goodbye, World!"
'Prints in the upper left corner of the default text window: mainwin, a window with scroll bars.
</lang>
 
=={{header|Julia}}==
{{libheader|Tk}}
 
<langsyntaxhighlight lang="julia">using Tk
 
window = Toplevel("Hello World", 200, 100, false)
Line 1,598 ⟶ 2,228:
set_visible(window, true)
 
# sleep(7)</langsyntaxhighlight>
 
=={{header|Just Basic}}==
<syntaxhighlight lang="just basic">
print "Goodbye, World!"
'Prints in the upper left corner of the default text window: mainwin, a window with scroll bars.
</syntaxhighlight>
 
=={{header|KonsolScript}}==
Popping a dialog-box.
<langsyntaxhighlight KonsolScriptlang="konsolscript">function main() {
Konsol:Message("Goodbye, World!", "")
}</langsyntaxhighlight>
 
Displaying it in a Window.
<langsyntaxhighlight KonsolScriptlang="konsolscript">function main() {
Screen:PrintString("Goodbye, World!")
while (B1 == false) {
Screen:Render()
}
}</langsyntaxhighlight>
 
=={{header|Kotlin}}==
{{trans|Java}}
{{libheader|Swing}}
<langsyntaxhighlight lang="scala">import java.awt.*
import javax.swing.*
 
Line 1,630 ⟶ 2,266:
isVisible = true
}
}</langsyntaxhighlight>
 
=={{header|LabVIEW}}==
{{VI solution|LabVIEW_Hello_world_Graphical.png}}
 
=={{header|Lambdatalk}}==
<syntaxhighlight lang="scheme">
1) we add a new "alert" primitive to the lambdatalk's dictionary
 
{script
LAMBDATALK.DICT["alert"] = function() {
var args = arguments[0];
alert( args )
};
}
 
2) and we call it
 
{alert GoodBye World}
-> display a standard Alert WIndow.
</syntaxhighlight>
 
=={{header|Lasso}}==
On OS X machines:
<langsyntaxhighlight lang="lasso">sys_process('/usr/bin/osascript', (: '-e', 'display dialog "Goodbye, World!"'))->wait</langsyntaxhighlight>
 
=={{header|Liberty BASIC}}==
<langsyntaxhighlight lang="lb">NOTICE "Goodbye, world!"</langsyntaxhighlight>
 
=={{header|Lingo}}==
 
Display in alert box:
<langsyntaxhighlight lang="lingo">_player.alert("Goodbye, World!")</langsyntaxhighlight>
 
Display in main window ("stage"):
<langsyntaxhighlight lang="lingo">-- create a field
m = new(#field)
m.rect = rect(0,0,320,240)
Line 1,662 ⟶ 2,315:
 
-- force immediate update
_movie.updateStage()</langsyntaxhighlight>
 
=={{header|LiveCodexTalk}}==
Works in HyperCard and other xTalk environments
<lang LiveCode>answer "Goodbye, World!"</lang>
<syntaxhighlight lang="hypertalk"> answer "Goodbye, World!"</syntaxhighlight>
A dialog box can be modified as appropriate for the context by setting a "iconType", button text and title
<langsyntaxhighlight LiveCodelang="livecode">answer warning "Goodbye, World!" with "Goodbye, World!" titled "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Lobster}}==
<langsyntaxhighlight Lobsterlang="lobster">gl_window("graphical hello world", 800, 600)
gl_setfontname("data/fonts/Droid_Sans/DroidSans.ttf")
gl_setfontsize(30)
Line 1,676 ⟶ 2,330:
while gl_frame():
gl_clear([ 0.0, 0.0, 0.0, 1.0 ])
gl_text("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|Logo}}==
Line 1,682 ⟶ 2,336:
 
Among the turtle commands are some commands for drawing text in the graphical area. Details and capabilities differ among Logo implementations.
<langsyntaxhighlight lang="logo">LABEL [Hello, World!]
SETLABELHEIGHT 2 * last LABELSIZE
LABEL [Goodbye, World!]</langsyntaxhighlight>
 
=={{header|Lua}}==
==={{libheader|IUPLua}}===
<langsyntaxhighlight lang="lua">require "iuplua"
 
dlg = iup.dialog{iup.label{title="Goodbye, World!"}; title="test"}
Line 1,695 ⟶ 2,349:
if (not iup.MainLoopLevel or iup.MainLoopLevel()==0) then
iup.MainLoop()
end</langsyntaxhighlight>
 
==={{libheader|LÖVE}}===
Line 1,708 ⟶ 2,362:
or a shortcut to love.exe.
 
<langsyntaxhighlight lang="lua">
function love.draw()
love.graphics.print("Goodbye, World!", 400, 300)
end
</syntaxhighlight>
</lang>
 
=={{header|M2000 Interpreter}}==
A window with a click event to open a message box, and print returned number to window form, scrolling at the lower part of form's layer.
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
Declare Simple Form
Line 1,744 ⟶ 2,398:
}
CheckIt
</syntaxhighlight>
</lang>
 
A simple Window only
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
Declare Simple Form
Line 1,755 ⟶ 2,409:
}
CheckIt
</syntaxhighlight>
</lang>
 
 
 
 
=={{header|Maple}}==
<syntaxhighlight lang="maple">
<lang Maple>
Maplets:-Display( Maplets:-Elements:-Maplet( [ "Goodbye, World!" ] ) );
</syntaxhighlight>
</lang>
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<langsyntaxhighlight Mathematicalang="mathematica">CreateDialog["Hello world"]</langsyntaxhighlight>
 
=={{header|MATLAB}}==
<syntaxhighlight lang ="matlab">msgbox('Goodbye, World!')</langsyntaxhighlight>
 
Add text to a graphical plot.
<langsyntaxhighlight Matlablang="matlab"> text(0.2,0.2,'Hello World!') </langsyntaxhighlight>
 
=={{header|MAXScript}}==
 
<langsyntaxhighlight lang="maxscript">messageBox "Goodbye world"</langsyntaxhighlight>
 
=={{header|MiniScript}}==
This implementation is for use with the [http://miniscript.org/MiniMicro Mini Micro] version of MiniScript.
<syntaxhighlight lang="miniscript">
import "textUtil"
 
hello = textUtil.Dialog.make("Hello, World Dialog", "Hello, World!")
hello.show
</syntaxhighlight>
 
=={{header|mIRC Scripting Language}}==
<langsyntaxhighlight lang="mirc">alias goodbyegui {
dialog -m Goodbye Goodbye
}
Line 1,788 ⟶ 2,448:
option dbu
text "Goodbye, World!", 1, 20 6 41 7
}</langsyntaxhighlight>
 
=={{header|Modula-3}}==
{{libheader|Trestle}}
<langsyntaxhighlight lang="modula3">MODULE GUIHello EXPORTS Main;
 
IMPORT TextVBT, Trestle;
Line 1,803 ⟶ 2,463:
Trestle.Install(v);
Trestle.AwaitDelete(v);
END GUIHello.</langsyntaxhighlight>
This code requires an m3makefile.
<pre>
Line 1,821 ⟶ 2,481:
{{works with|All implementations of TROFF}}
 
<syntaxhighlight lang N="n/t/roff">Goodbye, World!</langsyntaxhighlight>
 
=={{header|Neko}}==
The NekoVM uses a C FFI that requires marshaling of C types to Neko ''value'' types.
{{libheader|Agar}}
<langsyntaxhighlight lang="c">/*
Tectonics:
gcc -shared -fPIC -o nekoagar.ndll nekoagar.c `agar-config --cflags --libs`
Line 1,942 ⟶ 2,602:
return alloc_int(rc);
}
DEFINE_PRIM(agar_eventloop, 0);</langsyntaxhighlight>
 
The C file above is used to create a Neko friendly Dynamic Shared Object file, nekoagar.ndll.
Line 1,949 ⟶ 2,609:
The Neko program follows:
 
<syntaxhighlight lang="actionscript">/**
<lang ActionScript>/**
<doc><pre>
Hello world, graphical, in Neko, via Agar label
Line 1,982 ⟶ 2,642:
 
/* Run the event loop */
agar_eventloop();</langsyntaxhighlight>
 
{{out}}
Line 1,993 ⟶ 2,653:
=={{header|Nemerle}}==
Compile with:<pre>ncc -reference:System.Windows.Forms goodbye.n</pre>
<langsyntaxhighlight Nemerlelang="nemerle">using System;
using System.Windows.Forms;
 
MessageBox.Show("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|NetRexx}}==
Using [[Java|Java's]] [http://download.oracle.com/javase/6/docs/technotes/guides/swing/index.html Swing Foundation Classes].
{{libheader|Swing}}
<langsyntaxhighlight NetRexxlang="netrexx">/* NetRexx */
options replace format comments java crossref symbols binary
 
Line 2,008 ⟶ 2,668:
msgText = 'Goodbye, World!'
JOptionPane.showMessageDialog(null, msgText)
</syntaxhighlight>
</lang>
 
An alternative version using other Swing classes.
{{libheader|Swing}}
<langsyntaxhighlight NetRexxlang="netrexx">/* NetRexx */
options replace format comments java crossref symbols binary
 
Line 2,039 ⟶ 2,699:
method isFalse() public static returns boolean
return \isTrue
</syntaxhighlight>
</lang>
 
An example using [[Java|Java's]] [http://download.oracle.com/javase/6/docs/technotes/guides/awt/index.html Abstract Window Toolkit (AWT)]
{{libheader|AWT}}
 
<langsyntaxhighlight NetRexxlang="netrexx">/* NetRexx */
options replace format comments java crossref symbols binary
 
Line 2,132 ⟶ 2,792:
method isFalse() public static returns boolean
return \isTrue
</syntaxhighlight>
</lang>
 
=={{header|newLISP}}==
Line 2,138 ⟶ 2,798:
NewLISP uses a lightweight Java GUI server that it communicates with over a pipe, similar how some languages use Tcl/Tk. This takes advantage of Java's cross platform GUI capability.
 
<langsyntaxhighlight NewLISPlang="newlisp">; hello-gui.lsp
; oofoe 2012-01-18
 
Line 2,161 ⟶ 2,821:
 
(exit) ; NewLisp normally goes to listener after running script.
</syntaxhighlight>
</lang>
 
<langsyntaxhighlight NewLISPlang="newlisp"> ; Nehal-Singhal 2018-06-05
 
> (! "dialog --msgbox GoodbyeWorld! 5 20")
; A dialog message box appears on terminal similar to yes/no box. </langsyntaxhighlight>
 
=={{header|Nim}}==
==={{libheader|GTK2}}===
<langsyntaxhighlight lang="nim">import dialogs, gtk2
gtk2.nim_init()
 
info(nil, "Hello World")</langsyntaxhighlight>
==={{libheader|IUP}}===
<langsyntaxhighlight lang="nim">import iup
 
discard iup.open(nil, nil)
message("Hello", "Hello World")
close()</langsyntaxhighlight>
 
=={{header|NS-HUBASIC}}==
<syntaxhighlight lang="ns-hubasic">10 LOCATE 6,11
20 PRINT "GOODBYE, WORLD!"</syntaxhighlight>
 
=={{header|Nyquist}}==
===Audacity pluginplug-in (Lisp syntax)===
<langsyntaxhighlight Nyquistlang="lisp">;nyquist plug-in
;version 14
;type tool
;name "Goodbye, World!"
(print "Goodbye, World!")</lang>
 
(print "Goodbye, World!")</syntaxhighlight>
=={{header|Objective-C}}==
To show a modal alert (Mac):
<lang objc>NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Goodbye, World!"];
[alert runModal];</lang>
 
===Audacity plug-in (SAL syntax)===
To show a modal alert (iOS):
<syntaxhighlight lang="sal">;nyquist plug-in
<lang objc>UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Goodbye, World!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
;version 4
[alert show];</lang>
;type tool
;codetype sal
;name "Goodbye World"
 
return "Goodbye, World!"</syntaxhighlight>
 
=={{header|Objeck}}==
{{libheader|Qt}}
<langsyntaxhighlight lang="objeck">
use Qt;
 
Line 2,217 ⟶ 2,881:
}
}
</syntaxhighlight>
</lang>
 
=={{header|Objective-C}}==
To show a modal alert (Mac):
<syntaxhighlight lang="objc">NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Goodbye, World!"];
[alert runModal];</syntaxhighlight>
 
To show a modal alert (iOS):
<syntaxhighlight lang="objc">UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Goodbye, World!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];</syntaxhighlight>
 
=={{header|OCaml}}==
{{libheader|GTK}}
<langsyntaxhighlight lang="ocaml">let delete_event evt = false
 
let destroy () = GMain.Main.quit ()
Line 2,235 ⟶ 2,908:
;;
 
let _ = main () ;;</langsyntaxhighlight>
 
{{libheader|OCaml-Xlib}}
Line 2,244 ⟶ 2,917:
 
Just output as a label in a window:
<langsyntaxhighlight lang="ocaml">let () =
let main_widget = Tk.openTk () in
let lbl = Label.create ~text:"Goodbye, World" main_widget in
Tk.pack [lbl];
Tk.mainLoop();;</langsyntaxhighlight>
 
Output as text on a button that exits the current application:
<langsyntaxhighlight lang="ocaml">let () =
let action () = exit 0 in
let main_widget = Tk.openTk () in
Line 2,257 ⟶ 2,930:
Button.create main_widget ~text:"Goodbye, World" ~command:action in
Tk.pack [bouton_press];
Tk.mainLoop();;</langsyntaxhighlight>
 
=={{header|Ol}}==
{{libheader|Win32}}
<syntaxhighlight lang="ol">
<lang ol>
(import (lib winapi))
(MessageBox #f (c-string "Hello, World!") (c-string "Rosettacode") #x40)
</syntaxhighlight>
</lang>
 
 
=={{header|OpenEdge/Progress}}==
<syntaxhighlight lang="progress (openedge abl)">MESSAGE "Goodbye, World!" VIEW-AS ALERT-BOX.</syntaxhighlight>
 
=={{header|OxygenBasic}}==
Line 2,281 ⟶ 2,955:
<br clear=both>
Requires a Glade GUI description file. 'ere be one I produced earlier:
<langsyntaxhighlight lang="xml">
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.24.dtd">
Line 2,305 ⟶ 2,979:
 
</glade-interface>
</syntaxhighlight>
</lang>
And finally the Oxygene:
<langsyntaxhighlight lang="oxygene">
// Display a Message in a GUI Window
//
Line 2,355 ⟶ 3,029:
 
end.
</syntaxhighlight>
</lang>
===.NET===
[[File:OxygeneNEThw.jpg|left|HelloWorld]]
<br clear=both>
<langsyntaxhighlight lang="oxygene">
namespace HelloWorldNET;
 
Line 2,378 ⟶ 3,052:
end.
</syntaxhighlight>
</lang>
 
=={{header|Oz}}==
<langsyntaxhighlight lang="oz">declare
[QTk] = {Module.link ['x-oz://system/wp/QTk.ozf']}
Window = {QTk.build td(label(text:"Goodbye, World!"))}
in
{Window show}</langsyntaxhighlight>
 
=={{header|Panoramic}}==
<syntaxhighlight lang="panoramic">print "Goodbye, World!"
'Prints in the upper left corner of the window.
</syntaxhighlight>
 
=={{header|OpenEdge/Progress}}==
<lang Progress (OpenEdge ABL)>MESSAGE "Goodbye, World!" VIEW-AS ALERT-BOX.</lang>
=={{header|PARI/GP}}==
<langsyntaxhighlight lang="parigp">plotinit(1, 1, 1, 1);
plotstring(1, "Goodbye, World!");
plotdraw([1, 0, 15]);</langsyntaxhighlight>
 
=={{header|Panoramic}}==
<lang Panoramic>print "Goodbye, World!"
'Prints in the upper left corner of the window.
</lang>
 
=={{header|Pascal}}==
Line 2,403 ⟶ 3,075:
{{libheader|Gtk2}}
Variant of the C example:
<langsyntaxhighlight lang="pascal">program HelloWorldGraphical;
 
uses
Line 2,424 ⟶ 3,096:
gtk_main();
end.</langsyntaxhighlight>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="pascal">
// Hello world/Graphical. Nigel Galloway: January 16th., 2023
begin
System.Windows.Forms.MessageBox.Show('Farewell Cruel World!')
end.
</syntaxhighlight>
=={{header|Perl}}==
{{works with|Perl|5.8.8}}
Line 2,432 ⟶ 3,111:
Just output as a label in a window:
 
<langsyntaxhighlight lang="perl">
use strict;
use warnings;
Line 2,439 ⟶ 3,118:
my $main = MainWindow->new;
$main->Label(-text => 'Goodbye, World')->pack;
MainLoop();</langsyntaxhighlight>
 
Output as text on a button that exits the current application:
 
<langsyntaxhighlight lang="perl">use strict;
use warnings;
use Tk;
Line 2,452 ⟶ 3,131:
-command => \&exit,
)->pack;
MainLoop();</langsyntaxhighlight>
 
==={{libheader|Perl/Gtk2}}===
<langsyntaxhighlight lang="perl">use strict;
use warnings;
use Gtk2 '-init';
Line 2,469 ⟶ 3,148:
 
$window->show_all;
Gtk2->main;</langsyntaxhighlight>
 
==={{libheader|Perl/Qt}}===
<langsyntaxhighlight lang="perl">use strict;
use warnings;
use QtGui4;
Line 2,479 ⟶ 3,158:
my $label = Qt::Label('Goodbye, World');
$label->show;
exit $app->exec;</langsyntaxhighlight>
 
=={{header|Perl 6}}==
{{works with|Rakudo|2018.03}}
 
{{libheader|GTK}}
<lang perl6>use GTK::Simple;
use GTK::Simple::App;
 
my GTK::Simple::App $app .= new;
$app.border-width = 20;
$app.set-content( GTK::Simple::Label.new(text => "Goodbye, World!") );
$app.run;</lang>
 
=={{header|Phix}}==
{{libheader|pGUIPhix/basics}}
<lang {{libheader|Phix>include /pGUI.e}}
<!--<syntaxhighlight lang="phix">(phixonline)-->
IupOpen()
<span style="color: #008080;">include</span> <span style="color: #000000;">pGUI</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
IupMessage("Bye","Goodbye, World!")
<span style="color: #7060A8;">IupOpen</span><span style="color: #0000FF;">()</span>
IupClose()</lang>
<span style="color: #7060A8;">IupMessage</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Bye"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Goodbye, World!"</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">IupClose</span><span style="color: #0000FF;">()</span>
<!--</syntaxhighlight>-->
=== better ===
{{libheader|Phix/online}}
You can run this online [http://phix.x10.mx/p2js/hello_world.htm here]. A few improvements are probably warranted, as in changes to pGUI.js and/or pGUI.css, but at least the language/transpiler side of things is pretty much complete.
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">--
-- pwa\phix\hello_world.exw
-- ========================
--</span>
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">include</span> <span style="color: #000000;">pGUI</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
<span style="color: #7060A8;">IupOpen</span><span style="color: #0000FF;">()</span>
<span style="color: #004080;">Ihandle</span> <span style="color: #000000;">lbl</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">IupFlatLabel</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"World!"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"EXPAND=YES, ALIGNMENT=ACENTER"</span><span style="color: #0000FF;">)</span>
<span style="color: #004080;">Ihandln</span> <span style="color: #000000;">dlg</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">IupDialog</span><span style="color: #0000FF;">(</span><span style="color: #000000;">lbl</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"TITLE=Hello, RASTERSIZE=215x85"</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">IupShow</span><span style="color: #0000FF;">(</span><span style="color: #000000;">dlg</span><span style="color: #0000FF;">)</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">platform</span><span style="color: #0000FF;">()!=</span><span style="color: #004600;">JS</span> <span style="color: #008080;">then</span>
<span style="color: #7060A8;">IupMainLoop</span><span style="color: #0000FF;">()</span>
<span style="color: #000000;">dlg</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">IupDestroy</span><span style="color: #0000FF;">(</span><span style="color: #000000;">dlg</span><span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">IupClose</span><span style="color: #0000FF;">()</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<!--</syntaxhighlight>-->
 
=={{header|PHP}}==
{{libheader|PHP-GTK}}
<langsyntaxhighlight lang="php">if (!class_exists('gtk'))
{
die("Please load the php-gtk2 module in your php.ini\r\n");
Line 2,515 ⟶ 3,206:
$wnd->show_all();
Gtk::main();</langsyntaxhighlight>
 
=={{header|PicoLisp}}==
<langsyntaxhighlight PicoLisplang="picolisp">(call 'dialog "--msgbox" "Goodbye, World!" 5 20)</langsyntaxhighlight>
 
=={{header|Plain English}}==
<syntaxhighlight lang="plainenglish">To run:
Start up.
Clear the screen.
Write "Goodbye, World!".
Refresh the screen.
Wait for the escape key.
Shut down.</syntaxhighlight>
 
=={{header|Portugol}}==
<syntaxhighlight lang="portugol">
programa {
// includes graphics library and use an alias
inclua biblioteca Graficos --> g
 
// define WIDTH and HEIGHT integer constants
const inteiro WIDTH = 200
const inteiro HEIGHT = 100
 
// main entry
funcao inicio() {
// begin graphical mode (verdadeiro = true)
g.iniciar_modo_grafico(verdadeiro)
 
// define window title
g.definir_titulo_janela("Hello")
// define window dimesions
g.definir_dimensoes_janela(WIDTH, HEIGHT)
 
// while loop
enquanto (verdadeiro) {
// define color to black(preto) and clear window
g.definir_cor(g.COR_PRETO)
g.limpar()
 
// define color to white(branco)
g.definir_cor(g.COR_BRANCO)
// set text font size
g.definir_tamanho_texto(32.0)
// draws text
g.desenhar_texto(0, HEIGHT / 3, "Hello, world!")
// calls render function
g.renderizar()
}
 
// end graphical mode
g.encerrar_modo_grafico()
}
}
 
</syntaxhighlight>
 
=={{header|PostScript}}==
In the general Postscript context, the <tt>show</tt> command will render the string that is topmost on the stack at the <tt>currentpoint</tt> in the previously <tt>setfont</tt>. Thus a minimal PostScript file that will print on a PostScript printer or previewer might look like this:
 
<langsyntaxhighlight lang="postscript">%!PS
% render in Helvetica, 12pt:
/Helvetica findfont 12 scalefont setfont
Line 2,531 ⟶ 3,276:
(Goodbye, World!) show
% wrap up page display:
showpage</langsyntaxhighlight>
 
=={{header|PowerBASIC}}==
{{works with|PB/Win}}
 
<langsyntaxhighlight lang="powerbasic">FUNCTION PBMAIN() AS LONG
MSGBOX "Goodbye, World!"
END FUNCTION</langsyntaxhighlight>
 
=={{header|PowerShell}}==
{{libheader|WPK}}<br/>
{{works with|PowerShell|2}}
<langsyntaxhighlight lang="powershell">New-Label "Goodbye, World!" -FontSize 24 -Show</langsyntaxhighlight>
{{libheader|Windows Forms}}
<langsyntaxhighlight lang="powershell">$form = New-Object System.Windows.Forms.Form
$label = New-Object System.Windows.Forms.Label
 
Line 2,553 ⟶ 3,298:
$form.Controls.Add($label)
 
$Form.ShowDialog() | Out-Null</langsyntaxhighlight>
Alternatively, simply as a message box:
 
{{libheader|Windows Forms}}
<langsyntaxhighlight lang="powershell">[System.Windows.Forms.MessageBox]::Show("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|Processing}}==
Uses default Processing methods and variables.
<syntaxhighlight lang="processing">
<lang Processing> text("Goodbye, World!",0,height/2);</lang>
fill(0, 0, 0);
text("Goodbye, World!",0,height/2);
</syntaxhighlight>
 
=={{header|Prolog}}==
Works with SWI-Prolog and XPCE. <br><br>
A simple message box :
<langsyntaxhighlight Prologlang="prolog">send(@display, inform, 'Goodbye, World !').</langsyntaxhighlight>
A more sophisticated window :
<langsyntaxhighlight Prologlang="prolog">goodbye :-
new(D, window('Goodbye')),
send(D, size, size(250, 100)),
Line 2,580 ⟶ 3,328:
send(D, display, T, point(XT, YT)),
send(D, open).
</syntaxhighlight>
</lang>
 
=={{header|PureBasic}}==
<lang PureBasic>MessageRequester("Hello","Goodbye, World!")</lang>
Using the Windows API:
<lang PureBasic>MessageBox_(#Null,"Goodbye, World!","Hello")</lang>
 
=={{header|Pure Data}}==
Line 2,598 ⟶ 3,341:
* While there is no easy (intuitive) way to print a comma (or semicolon) this pd script will do.
* When writing messages to the terminal window, Pd prepends the name of the print object and a colon, or "print: " if no name is specified, which can be avoided by using "-n" instead of a name. This behaviour, however, has not been adopted by Pd-extended :-(
 
=={{header|PureBasic}}==
<syntaxhighlight lang="purebasic">MessageRequester("Hello","Goodbye, World!")</syntaxhighlight>
Using the Windows API:
<syntaxhighlight lang="purebasic">MessageBox_(#Null,"Goodbye, World!","Hello")</syntaxhighlight>
 
=={{header|Python}}==
{{works with|Python & Blender|3.x}}
==={{libheader|Blender}}===
<syntaxhighlight lang="python">import bpy
 
# select default cube
bpy.data.objects['Cube'].select_set(True)
 
# delete default cube
bpy.ops.object.delete(True)
# add text to Blender scene
bpy.data.curves.new(type="FONT", name="Font Curve").body = "Hello World"
font_obj = bpy.data.objects.new(name="Font Object", object_data=bpy.data.curves["Font Curve"])
bpy.context.scene.collection.objects.link(font_obj)
# camera center to text
bpy.context.scene.camera.location = (2.5,0.3,10)
 
# camera orient angle to text
bpy.context.scene.camera.rotation_euler = (0,0,0)
 
# change 3D scene to view from the camera
area = next(area for area in bpy.context.screen.areas if area.type == 'VIEW_3D')
area.spaces[0].region_3d.view_perspective = 'CAMERA'</syntaxhighlight>
 
{{works with|Python|2.x}}
==={{libheader|Tkinter}}===
<langsyntaxhighlight lang="python">import tkMessageBox
 
result = tkMessageBox.showinfo("Some Window Label", "Goodbye, World!")</langsyntaxhighlight>
 
'''Note:''' The result is a string of the button that was pressed.
Line 2,610 ⟶ 3,383:
{{works with|Python|3.x}}
{{libheader|Tkinter}}
<langsyntaxhighlight lang="python">from tkinter import messagebox
 
result = messagebox.showinfo("Some Window Label", "Goodbye, World!")</langsyntaxhighlight>
 
 
==={{libheader|PyQt}}===
<langsyntaxhighlight lang="python">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_())</langsyntaxhighlight>
 
==={{libheader|PyGTK}}===
<langsyntaxhighlight lang="python">import pygtk
pygtk.require('2.0')
import gtk
Line 2,632 ⟶ 3,405:
window.connect('delete-event', gtk.main_quit)
window.show_all()
gtk.main()</langsyntaxhighlight>
 
==={{libheader|VPython}}===
{{works with|Python|2.7.5}}
<langsyntaxhighlight lang="python">
# HelloWorld for VPython - HaJo Gurt - 2014-09-20
from visual import *
Line 2,691 ⟶ 3,464:
S.rotate( angle=rot, axis=(0,1,0) )
 
</syntaxhighlight>
</lang>
 
==={{libheader|WxPython}}===
<langsyntaxhighlight lang="python">import wx
 
app = wx.App(False)
frame = wx.Frame(None, wx.ID_ANY, "Hello, World")
frame.Show(True)
app.MainLoop()</langsyntaxhighlight>
 
 
==={{libheader|Kivy}}===
<langsyntaxhighlight lang="python">
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
Line 2,724 ⟶ 3,497:
 
GoodByeApp().run()
</syntaxhighlight>
</lang>
 
 
==={{libheader|Kivy}}===
With kv language
<langsyntaxhighlight lang="python">
 
from kivy.app import App
Line 2,760 ⟶ 3,533:
 
GoodByeApp().run()
</syntaxhighlight>
</lang>
 
=={{header|RapidQQuackery}}==
 
<lang rapidq>MessageBox("Goodbye, World!", "RapidQ example", 0)</lang>
<syntaxhighlight lang="Quackery"> [ $ "turtleduck.qky" loadfile ] now!
 
[ $ /
import turtle
size = from_stack()
words = string_from_stack()
turtle.write(words,align="center",
font=("Arial", size, "normal"))
/ python ] is write
 
turtle 0 frames
255 times
[ clear
i^ 3 of colour
$ "Goodbye, World!"
i write
frame ]</syntaxhighlight>
 
{{out}}
[[File:Quackery Goodbye World.gif]]
 
=={{header|R}}==
{{libheader|GTK}}
Rather minimalist, but working...
<langsyntaxhighlight Rlang="r">library(RGtk2) # bindings to Gtk
w <- gtkWindowNew()
l <- gtkLabelNew("Goodbye, World!")
w$add(l)</langsyntaxhighlight>
 
=={{header|Racket}}==
 
<langsyntaxhighlight Racketlang="racket"> #lang racket/gui
(require racket/gui/base)
 
Line 2,793 ⟶ 3,586:
; Show the frame by calling its show method
(send frame show #t)</langsyntaxhighlight>
 
=={{header|Raku}}==
(formerly Perl 6)
{{works with|Rakudo|2018.03}}
 
{{libheader|GTK}}
<syntaxhighlight lang="raku" line>use GTK::Simple;
use GTK::Simple::App;
 
my GTK::Simple::App $app .= new;
$app.border-width = 20;
$app.set-content( GTK::Simple::Label.new(text => "Goodbye, World!") );
$app.run;</syntaxhighlight>
 
=={{header|RapidQ}}==
<syntaxhighlight lang="rapidq">MessageBox("Goodbye, World!", "RapidQ example", 0)</syntaxhighlight>
 
=={{header|Rascal}}==
<langsyntaxhighlight lang="rascal">
import vis::Figure;
import vis::Render;
Line 2,802 ⟶ 3,611:
public void GoodbyeWorld() =
render(box(text("Goodbye World")));
</syntaxhighlight>
</lang>
Output:
[[File:Goodbyeworld.png]]
 
=={{header|REALbasic}}==
<syntaxhighlight lang="vb">
<lang vb>
MsgBox("Goodbye, World!")
</syntaxhighlight>
</lang>
 
=={{header|REBOL}}==
<langsyntaxhighlight REBOLlang="rebol">alert "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Red}}==
<langsyntaxhighlight Redlang="red">>> view [ text "Hello World !"]</langsyntaxhighlight>
 
=={{header|REXX}}==
Line 2,822 ⟶ 3,631:
:::* &nbsp; PC/REXX
:::* &nbsp; Personal REXX
<langsyntaxhighlight lang="rexx">/*REXX (using PC/REXX) to display a message in a window (which is bordered). */
if fcnPkg('rxWindow') ¬== 1 then do
say 'RXWINDOW function package not loaded.'
Line 2,834 ⟶ 3,643:
call w_put window#, 2, 2, center("Goodbye, World!", 80-2)
 
/*stick a fork in it, all we're done. */</langsyntaxhighlight>
'''output'''
<pre>
Line 2,849 ⟶ 3,658:
<br>and it creates two windows, the first (main) window contains the &nbsp; '''Goodbye, World!''' &nbsp; text,
<br>the other "help" window contains a message about how to close the windows.
<langsyntaxhighlight lang="rexx">/*REXX program shows a "hello world" window (and another to show how to close)*/
parse upper version !ver .; !pcrexx= !ver=='REXX/PERSONAL' | !ver=='REXX/PC'
if ¬!pcrexx then call ser "This isn't PC/REXX" /*this isn't PC/REXX ? */
Line 2,877 ⟶ 3,686:
parse var curPos row col
call cursor row, col
/*stick a fork in it, we're all done. */</langsyntaxhighlight>
 
=={{header|Ring}}==
<langsyntaxhighlight lang="ring">
Load "guilib.ring"
New qApp {
Line 2,889 ⟶ 3,698:
exec()
}
</syntaxhighlight>
</lang>
 
=={{header|Robotic}}==
Since visuals are already built in, [[Hello world/Newbie#Robotic|this link]] does the same thing.
 
=={{header|RPL}}==
{{works with|HP|48G}}
"Goodbye world!" MSGBOX
 
=={{header|Ruby}}==
{{libheader|GTK}}
<langsyntaxhighlight lang="ruby">require 'gtk2'
 
window = Gtk::Window.new
Line 2,900 ⟶ 3,716:
window.show_all
 
Gtk.main</langsyntaxhighlight>
 
{{libheader|Ruby/Tk}}
<langsyntaxhighlight lang="ruby">require 'tk'
root = TkRoot.new("title" => "User Output")
TkLabel.new(root, "text"=>"CHUNKY BACON!").pack("side"=>'top')
Tk.mainloop</langsyntaxhighlight>
 
{{libheader|Shoes}}
<langsyntaxhighlight lang="ruby">#_Note: this code MUST be executed through the Shoes GUI!!
 
Shoes.app do
para "CHUNKY BACON!", :size => 72
end</langsyntaxhighlight>
 
{{libheader|Gosu}}
<langsyntaxhighlight lang="ruby">
require 'gosu'
 
Line 2,932 ⟶ 3,748:
end
 
Window.new.show</langsyntaxhighlight>
 
{{libheader|Green shoes}}
<langsyntaxhighlight lang="ruby">
#_Note: this code must not be executed through a GUI
require 'green_shoes'
Line 2,942 ⟶ 3,758:
para "Hello world"
end
</syntaxhighlight>
</lang>
 
{{libheader|Win32ole}}
<langsyntaxhighlight lang="ruby">
require 'win32ole'
WIN32OLE.new('WScript.Shell').popup("Hello world")
</syntaxhighlight>
</lang>
 
=={{header|Run BASIC}}==
<langsyntaxhighlight lang="runbasic">' do it with javascript
html "<script>alert('Goodbye, World!');</script>"</langsyntaxhighlight>
 
=={{header|Rust}}==
==={{libheader|GTK}}===
<langsyntaxhighlight lang="rust">// cargo-deps: gtk
extern crate gtk;
use gtk::traits::*;
Line 2,977 ⟶ 3,793:
window.show_all();
gtk::main();
}</langsyntaxhighlight>
 
=={{header|Scala}}==
Line 2,984 ⟶ 3,800:
===Ad hoc REPL solution===
Ad hoc solution as [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] script:
<langsyntaxhighlight lang="scala">swing.Dialog.showMessage(message = "Goodbye, World!")</langsyntaxhighlight>
===JVM Application===
Longer example, as an application:
<langsyntaxhighlight lang="scala">import swing._
 
object GoodbyeWorld extends SimpleSwingApplication {
Line 2,998 ⟶ 3,814:
}
}
}</langsyntaxhighlight>
===.Net Framework===
<langsyntaxhighlight Scalalang="scala">import swing._
object HelloDotNetWorld {
Line 3,007 ⟶ 3,823:
("Goodbye, World!")
}
}</langsyntaxhighlight>
 
=={{header|Scilab}}==
<lang scilab>messagebox("Goodbye, World!")</lang>
 
=={{header|Scheme}}==
Line 3,016 ⟶ 3,829:
{{libheader|Scheme/PsTk}}
 
<langsyntaxhighlight lang="ruby">
#!r6rs
 
Line 3,032 ⟶ 3,845:
 
(tk-event-loop tk)
</syntaxhighlight>
</lang>
 
=={{header|ScratchScilab}}==
<syntaxhighlight lang="scilab">messagebox("Goodbye, World!")</syntaxhighlight>
 
=={{header|Scratch}}==
[[File:Scratch_Hello_World_Graphical.png]]
 
=={{header|ScratchScript}}==
<syntaxhighlight lang="scratchscript">pos -100 70
print "Goodbye, World!"</syntaxhighlight>
This example waits until the mouse is clicked for the program to end. This can be useful if the program executes too fast for "Hello world!" to be visible on the screen long enough for it to be comfortable.
<syntaxhighlight lang="scratchscript">pos -100 70
print "Goodbye, World!"
delayOnClick</syntaxhighlight>
 
=={{header|Seed7}}==
Line 3,047 ⟶ 3,870:
the area is currently covered or off screen.
 
<langsyntaxhighlight lang="seed7">$ include "seed7_05.s7i";
include "draw.s7i";
include "keybd.s7i";
Line 3,067 ⟶ 3,890:
write(screen, "Goodbye, World");
ignore(getc(KEYBOARD));
end func;</langsyntaxhighlight>
 
=={{header|SenseTalk}}==
<syntaxhighlight lang="sensetalk">Answer "Good Bye" </syntaxhighlight>
 
=={{header|Sidef}}==
{{libheader|Tk}}
<langsyntaxhighlight lang="ruby">var tk = require('Tk');
var main = %s'O<MainWindow'>.new;
main.Button(
'-text' => 'Goodbye, World!',
'-command' => 'exit',
).pack;
tk.MainLoop;</langsyntaxhighlight>
 
{{libheader|Gtk2}}
<langsyntaxhighlight lang="ruby">var gtk2 = require('Gtk2') -> init;
 
var window = %O<Gtk2::Window>.new
var label = %O<Gtk2::Label>.new('Goodbye, World!')
 
window.set_title('Goodbye, World!')
window.signal_connect(destroy => { gtk2.main_quit })
 
window.add(label)
window.show_all
 
gtk2.main</syntaxhighlight>
 
{{libheader|Gtk3}}
var window = %s'Gtk2::Window'.new;
<syntaxhighlight lang="ruby">use('Gtk3 -init')
var label = %s'Gtk2::Label'.new('Goodbye, World!');
 
var gtk3 = %O'Gtk3'
var window = %O'Gtk3::Window'.new
var label = %O'Gtk3::Label'.new('Goodbye, World!')
 
window.set_title('Goodbye, World!')
window.signal_connect(destroy => { gtk3.main_quit })
 
window.add(label)
window.show_all
 
gtk3.main</syntaxhighlight>
window.set_title('Goodbye, World!');
window.signal_connect(destroy => func(*_){ gtk2.main_quit });
 
=={{header|Slope}}==
window.add(label);
The gui module is an optional module when you compile the slope interpreter. With the module installed the following will produce a window with the text "Goodbye, world!" and the title of the window will be "Goodbye".
window.show_all;
 
<syntaxhighlight lang="slope">
gtk2.main;</lang>
(define gui (gui-create))
(gui-add-window gui "Goodbye")
(window-set-content
gui
"Goodbye"
(container
"max"
(widget-make-label "Goodbye, world!")))
(window-show-and-run gui "Goodbye")</syntaxhighlight>
 
=={{header|Smalltalk}}==
{{works with|GNU Smalltalk}}
<langsyntaxhighlight lang="smalltalk">MessageBox show: 'Goodbye, world.'</langsyntaxhighlight>
{{works with|Pharo}}
<syntaxhighlight lang="smalltalk">'Hello World' asMorph openInWindow</syntaxhighlight>
{{works with|Smalltalk/X}}
{{works with|VisualWorks Smalltalk}}
<langsyntaxhighlight lang="smalltalk">Dialog information: 'Goodbye, world.'</langsyntaxhighlight>
 
=={{header|SmileBASIC}}==
<langsyntaxhighlight lang="smilebasic">DIALOG "Goodbye, world."</langsyntaxhighlight>
 
=={{header|SSEM}}==
Ok, I know this is cheating. But it isn't <i>completely</i> cheating: the SSEM uses Williams tube storage, so the memory is basically a CRT device; and this is an executable program, up to a point, because the first line includes a <tt>111 Stop</tt> instruction (disguised as a little flourish joining the tops of the <b>d</b> and the <b>b</b>).
<langsyntaxhighlight lang="ssem">01100000000001110000000000000000
10000000000001010000000000000000
10011101110111011101010111000000
Line 3,122 ⟶ 3,979:
00100100101010100010010100000000
00100100101110100011011100100000
00011011000000000000000000000000</langsyntaxhighlight>
Once you've keyed it in, the first eighteen words of storage will look a bit like this:
<pre> oo ooo
Line 3,142 ⟶ 3,999:
o o o ooo o oo ooo o
oo oo</pre>
 
=={{header|Standard ML}}==
Works with PolyML
<syntaxhighlight lang="standard ml">open XWindows ;
open Motif ;
val helloWindow = fn () =>
let
val shell = XtAppInitialise "" "demo" "top" [] [XmNwidth 400, XmNheight 300 ] ;
val main = XmCreateMainWindow shell "main" [XmNmappedWhenManaged true ] ;
val text = XmCreateLabel main "show" [ XmNlabelString "Hello World!"]
in
(
XtManageChildren [text];
XtManageChild main;
XtRealizeWidget shell
)
end;
</syntaxhighlight>
call
helloWindow ();
 
=={{header|Stata}}==
<langsyntaxhighlight lang="stata">window stopbox note "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Supernova}}==
<langsyntaxhighlight Supernovalang="supernova">I want window and the window title is "Goodbye, World".</langsyntaxhighlight>
 
=={{header|Swift}}==
{{trans|Objective-C}}
<langsyntaxhighlight Swiftlang="swift">import Cocoa
 
let alert = NSAlert()
alert.messageText = "Goodbye, World!"
alert.runModal()</langsyntaxhighlight>
 
=={{header|Tcl}}==
{{libheader|Tk}}
Just output as a label in a window:
<langsyntaxhighlight lang="tcl">pack [label .l -text "Goodbye, World"]</langsyntaxhighlight>
 
Output as text on a button that exits the current application:
<langsyntaxhighlight lang="tcl">pack [button .b -text "Goodbye, World" -command exit]</langsyntaxhighlight>
''Note:'' If you name this program "button.tcl", you might get strange errors. <br>
Don't use the name of any internal tcl/tk-command as a filename for a tcl-script.
 
This shows our text in a message box:
<langsyntaxhighlight lang="tcl">tk_messageBox -message "Goodbye, World"</langsyntaxhighlight>
 
=={{header|TI-83 BASIC}}==
<langsyntaxhighlight lang="ti83b">PROGRAM:GUIHELLO
:Text(0,0,"GOODBYE, WORLD!")</langsyntaxhighlight>
 
=={{header|TI-89 BASIC}}==
 
<langsyntaxhighlight lang="ti89b">Dialog
Text "Goodbye, World!"
EndDlog</langsyntaxhighlight>
 
=={{header|Tosh}}==
<syntaxhighlight lang="tosh">when flag clicked
say "Goodbye, World!"
stop this script</syntaxhighlight>
 
=={{header|True BASIC}}==
<syntaxhighlight lang="qbasic">SET WINDOW 0, 320, 0, 200
SET COLOR "YELLOW"
BOX AREA 20,50,40,60
SET COLOR "GREEN"
PLOT TEXT, AT 25, 45: "Goodbye, World!"
END</syntaxhighlight>
 
 
=={{header|TXR}}==
Line 3,183 ⟶ 4,079:
==== Microsoft Windows ====
 
<langsyntaxhighlight lang="txrlisp">(with-dyn-lib "user32.dll"
(deffi messagebox "MessageBoxW" int (cptr wstr wstr uint)))
 
(messagebox cptr-null "Hello" "World" 0) ;; 0 is MB_OK</langsyntaxhighlight>
 
=={{header|VBScript}}==
 
<lang vbscript>
MsgBox("Goodbye, World!")
</lang>
 
=={{header|Vedit macro language}}==
Displaying the message on status line. The message remains visible until the next keystroke, but macro execution continues.
<lang vedit>Statline_Message("Goodbye, World!")</lang>
 
Displaying a dialog box with the message and default OK button:
<lang vedit>Dialog_Input_1(1,"`Vedit example`,`Goodbye, World!`")</lang>
 
=={{header|UNIX Shell}}==
===In a virtual terminal===
Using whiptail or dialog
<langsyntaxhighlight lang="bash">
whiptail --title 'Farewell' --msgbox 'Goodbye, World!' 7 20
</syntaxhighlight>
</lang>
<langsyntaxhighlight lang="bash">
dialog --title 'Farewell' --msgbox 'Goodbye, World!' 7 20
</syntaxhighlight>
</lang>
===In a graphical environment===
Using the simple dialog command xmessage, which uses the X11 Athena Widget library
<langsyntaxhighlight lang="bash">
xmessage 'Goodbye, World!'
</syntaxhighlight>
</lang>
Using the zenity modal dialogue command (wraps GTK library) available with many distributions of [[Linux]]
<langsyntaxhighlight lang="bash">
zenity --info --text='Goodbye, World!'
</syntaxhighlight>
</lang>
Using yad (a fork of zenity with many more advanced options)
<langsyntaxhighlight lang="bash">
yad --title='Farewell' --text='Goodbye, World!'
</syntaxhighlight>
</lang>
 
 
=={{header|Ultimate++}}==
{{works with|TheIDE}}
The following code is altered from the TheIDE example page. It displays a blank GUI with a menu. Click on about from the menu and the goodbye world prompt appears.
 
<syntaxhighlight lang="cpp">
#include <CtrlLib/CtrlLib.h>
// submitted by Aykayayciti (Earl Lamont Montgomery)
 
using namespace Upp;
 
class GoodbyeWorld : public TopWindow {
MenuBar menu;
StatusBar status;
 
void FileMenu(Bar& bar);
void MainMenu(Bar& bar);
void About();
 
public:
typedef GoodbyeWorld CLASSNAME;
 
GoodbyeWorld();
};
 
void GoodbyeWorld::About()
{
PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Goodbye World sample}}");
}
 
void GoodbyeWorld::FileMenu(Bar& bar)
{
bar.Add("About..", THISBACK(About));
bar.Separator();
bar.Add("Exit", THISBACK(Close));
}
 
void GoodbyeWorld::MainMenu(Bar& bar)
{
menu.Add("File", THISBACK(FileMenu));
}
 
GoodbyeWorld::GoodbyeWorld()
{
AddFrame(menu);
AddFrame(status);
menu.Set(THISBACK(MainMenu));
status = "So long from the Ultimate++ !";
}
 
GUI_APP_MAIN
{
SetLanguage(LNG_ENGLISH);
GoodbyeWorld().Run();
}
</syntaxhighlight>
 
 
 
 
 
=={{header|Vala}}==
<langsyntaxhighlight lang="vala">#!/usr/local/bin/vala --pkg gtk+-3.0
using Gtk;
 
Line 3,244 ⟶ 4,188:
 
Gtk.main();
}</langsyntaxhighlight>
 
=={{header|VBA}}==
{{trans|Visual Basic}}
<langsyntaxhighlight lang="vb">Public Sub hello_world_gui()
MsgBox "Goodbye, World!"
End Sub</langsyntaxhighlight>
 
=={{header|VBScript}}==
 
<syntaxhighlight lang="vbscript">
MsgBox("Goodbye, World!")
</syntaxhighlight>
 
=={{header|Vedit macro language}}==
Displaying the message on status line. The message remains visible until the next keystroke, but macro execution continues.
<syntaxhighlight lang="vedit">Statline_Message("Goodbye, World!")</syntaxhighlight>
 
Displaying a dialog box with the message and default OK button:
<syntaxhighlight lang="vedit">Dialog_Input_1(1,"`Vedit example`,`Goodbye, World!`")</syntaxhighlight>
 
=={{header|Visual Basic}}==
<langsyntaxhighlight lang="vb">Sub Main()
MsgBox "Goodbye, World!"
End Sub</langsyntaxhighlight>
 
=={{header|Visual Basic .NET}}==
{{works with|Visual Basic|2005}}
<langsyntaxhighlight lang="vbnet">Imports System.Windows.Forms
 
Module GoodbyeWorld
Line 3,264 ⟶ 4,222:
Messagebox.Show("Goodbye, World!")
End Sub
End Module</langsyntaxhighlight>
 
=={{header|Visual FoxPro}}==
<langsyntaxhighlight lang="vfp">* Version 1:
MESSAGEBOX("Goodbye, World!")
* Version 2:
? "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|V (Vlang)}}==
<syntaxhighlight lang="v (vlang)">import ui
 
fn main() {
ui.message_box('Hello World')
}</syntaxhighlight>
 
=={{header|Web 68}}==
<syntaxhighlight lang="web68">@1Introduction.
Define the structure of the program.
 
@aPROGRAM goodbye world CONTEXT VOID USE standard
BEGIN
@<Included declarations@>
@<Logic at the top level@>
END
FINISH
 
@ Include the graphical header file.
 
@iforms.w@>
 
@ Program code.
 
@<Logic...@>=
open(LOC FILE,"",arg channel);
fl initialize(argc,argv,NIL,0);
fl show messages("Goodbye World!");
fl finish
 
@ Declare the necessary macros.
 
@<Include...@>=
macro fl initialize;
macro fl show messages;
macro fl finish;
 
@ The end.</syntaxhighlight>
 
=={{header|Wee Basic}}==
<langsyntaxhighlight Weelang="wee Basicbasic">print 1 at 10,12 "Hello world!"
end</langsyntaxhighlight>
 
=={{header|Wren}}==
{{libheader|DOME}}
<syntaxhighlight lang="wren">import "graphics" for Canvas, Color
 
class Game {
static init() {
Canvas.print("Goodbye, World!", 10, 10, Color.white)
}
 
static update() {}
 
static draw(alpha) {}
}</syntaxhighlight>
 
=={{header|X86 Assembly}}==
Line 3,284 ⟶ 4,295:
function parameters onto the stack and the stack has been fixed up
when the callee returns.
<langsyntaxhighlight lang="assembly">;;; hellowin.asm
;;;
;;; nasm -fwin32 hellowin.asm
Line 3,310 ⟶ 4,321:
title:
db 'RosettaCode sample',0
</syntaxhighlight>
</lang>
{{works with|FASM on Windows}}
 
<langsyntaxhighlight lang="assembly">
;use win32ax for 32 bit
;use win64ax for 64 bit
Line 3,323 ⟶ 4,334:
invoke ExitProcess,0
.end start
</syntaxhighlight>
</lang>
 
=={{header|WebX86-64 68Assembly}}==
===UASM 2.52===
<lang web68>@1Introduction.
Not sure if ncurses counts as 'graphical', but whatver..
Define the structure of the program.
===={{libheader|ncurses}}====
<syntaxhighlight lang="asm">
option casemap:none
 
printf proto :qword, :vararg
@aPROGRAM goodbye world CONTEXT VOID USE standard
exit proto :dword
BEGIN
;; curses.h stuff
@<Included declarations@>
initscr proto ;; WINDOW *initsrc(void);
@<Logic at the top level@>
endwin proto ;; int endwin(void);
END
start_color proto ;; int start_color(void);
FINISH
wrefresh proto :qword ;; int wrefresh(WINDOW *w);
wgetch proto :qword ;; int wgetch(WINDOW *w)
waddnstr proto :qword, :qword, :dword ;; int waddnstr(WINDOW *w, const char *str, int n);
;; Just a wrapper to make printing easier..
println proto :qword, :qword
 
.code
@ Include the graphical header file.
main proc
local stdscr:qword
 
call initscr
@iforms.w@>
mov stdscr, rax
call start_color
invoke println, stdscr, CSTR("Goodbye, World!",10)
invoke wgetch, stdscr
call endwin
invoke exit, 0
ret
main endp
 
println proc wnd:qword, pstr:qword
@ Program code.
invoke waddnstr, wnd, pstr, -1
invoke wrefresh, wnd
ret
println endp
 
end
@<Logic...@>=
</syntaxhighlight>
open(LOC FILE,"",arg channel);
fl initialize(argc,argv,NIL,0);
fl show messages("Goodbye World!");
fl finish
 
===={{libheader|GTK}}====
@ Declare the necessary macros.
<syntaxhighlight lang="asm">
option casemap:none
 
gtk_main proto
gtk_main_quit proto
gtk_window_get_type proto
gtk_widget_show_all proto :qword
exit proto :dword
gtk_window_new proto :dword
printf proto :dword, :vararg
g_type_check_instance_cast proto :qword, :qword
gtk_init proto :qword, :qword
gtk_window_set_title proto :qword, :qword
g_signal_connect_data proto :qword, :qword, :qword, :dword, :dword, :dword
 
del_event proto
@<Include...@>=
 
macro fl initialize;
.data
macro fl show messages;
tlt db "hello_gtk",0
macro fl finish;
agc dq 1
agv dq ags
ags dq tlt
dq 0
 
.code
main proc
local hwnd:qword
local tmp:qword
 
invoke printf, CSTR("-> Starting GTK with argc:%i - argv ptr: 0x%x",10), agc, agv
lea rax, agc
lea rbx, agv
invoke gtk_init, rax, rbx
invoke gtk_window_new, 0
mov hwnd, rax
invoke printf, CSTR("-> Main window handle: %d",10), hwnd
call gtk_window_get_type
mov tmp, rax
invoke printf, CSTR("-> Window type: %d",10), tmp
invoke g_type_check_instance_cast, hwnd, tmp
mov tmp, rax
invoke gtk_window_set_title, tmp, CSTR("Goodbye, World.")
invoke g_type_check_instance_cast, hwnd, 0x50
mov tmp, rax
lea rax, del_event
invoke g_signal_connect_data, tmp, CSTR("delete-event"), rax, 0, 0, 0
invoke gtk_widget_show_all, hwnd
call gtk_main
;invoke exit, 0
ret
main endp
 
del_event proc
invoke printf, CSTR("-> Exit event called..",10)
call gtk_main_quit
ret
del_event endp
end
</syntaxhighlight>
 
=={{header|XPL0}}==
@ The end.</lang>
This sets up a 320x200x8 (VGA) graphics screen and writes text on it.
<syntaxhighlight lang="xpl0">[SetVid($13); Text(6, "Goodbye, World!")]</syntaxhighlight>
 
=={{header|XSLT}}==
Line 3,361 ⟶ 4,447:
The output is an SVG document. The idea is that it's straightforward to use XSLT to turn an existing SVG into an instantiable template.
 
<langsyntaxhighlight lang="xml"><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/*">
Line 3,381 ⟶ 4,467:
</svg>
</xsl:template>
</xsl:stylesheet></langsyntaxhighlight>
 
Sample input:
 
<langsyntaxhighlight lang="xml"><message>Goodbye, World!</message></langsyntaxhighlight>
 
Sample output (with formatting non-destructively adjusted):
 
<langsyntaxhighlight lang="xml"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200">
<rect x="0" y="0" width="400" height="200" fill="cyan"/>
<circle cx="200" cy="100" r="50" fill="yellow"/>
Line 3,396 ⟶ 4,482:
text-anchor: middle;
fill: black;">Goodbye, World!</text>
</svg></langsyntaxhighlight>
 
=={{header|Yabasic}}==
<langsyntaxhighlight Yabasiclang="yabasic">open window 200, 100
text 10, 20, "Hello world"
color 255, 0, 0 : text 10, 40, "Good bye world", "roman14"</langsyntaxhighlight>
 
=={{header|zkl}}==
zkl doesn't have a decent GUI ffi but, on my Linux box, the following work:
<langsyntaxhighlight lang="zkl">System.cmd(0'|zenity --info --text="Goodbye, World!"|); // GTK+ pop up
System.cmd(0'|notify-send "Goodbye, World!"|); // desktop notification
System.cmd(0'|xmessage -buttons Ok:0,"Not sure":1,Cancel:2 -default Ok -nearmouse "Goodbye, World!" -timeout 10|); // X Windows dialog</langsyntaxhighlight>
The quote quote syntax is 0'<char>text<char> or you can use \ (eg "\"Goodbye, World!\"")
 
{{omit from|ACL2}}
{{omit from|Commodore BASIC}}
{{omit from|LFE}}
{{omit from|Logtalk}}
62

edits