Hello world/Graphical: Difference between revisions

sort
mNo edit summary
(sort)
 
(42 intermediate revisions by 29 users not shown)
Line 14:
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
<syntaxhighlight lang="aarch64 assembly">
<lang AArch64 Assembly>
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program disMessGraph64.s */
Line 225:
.include "../includeARM64.inc"
 
</syntaxhighlight>
</lang>
 
=={{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 283 ⟶ 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 300 ⟶ 380:
close (window)
END
</syntaxhighlight>
</lang>
[[Category:ALGOL 68#ALGOL 68]]
 
Line 313 ⟶ 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 353 ⟶ 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 382 ⟶ 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 484 ⟶ 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 513 ⟶ 609:
EndSwitch
WEnd
</syntaxhighlight>
</lang>
 
<langsyntaxhighlight lang="autoit">MsgBox(0, "Goodbye", "Goodbye, World!")</langsyntaxhighlight>
 
<langsyntaxhighlight lang="autoit">ToolTip("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|AWK}}==
Line 527 ⟶ 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:
<langsyntaxhighlight lang="bacon">OPTION GUI TRUE
 
gui = GUIDEFINE("{ type=window name=window XtNtitle=\"Graphical\" } \
{ type=labelWidgetClass name=label parent=window XtNlabel=\"Goodbye, World!\" } ")
 
CALL GUIEVENT$(gui)</langsyntaxhighlight>
 
Using GTK3 backend:
<langsyntaxhighlight lang="bacon">OPTION GUI TRUE
PRAGMA GUI gtk3
 
Line 553 ⟶ 649:
{ type=LABEL name=label parent=window margin=5 label=\"Goodbye, World!\" } ")
 
CALL GUIEVENT$(gui)</langsyntaxhighlight>
 
=={{header|BASIC}}==
{{works with|FreeBASIC}}
<langsyntaxhighlight lang="freebasic">' Demonstrate a simple Windows application using FreeBasic
 
#include once "windows.bi"
Line 573 ⟶ 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 588 ⟶ 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|batari Basic}}==
<langsyntaxhighlight lang="batari Basicbasic"> playfield:
................................
................................
Line 617 ⟶ 713:
drawscreen
goto mainloop
</syntaxhighlight>
</lang>
 
=={{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 629 ⟶ 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.
<langsyntaxhighlight Beadslang="beads">beads 1 program 'Goodbye World'
calc main_init
alert('Goodbye, World!')
draw main_draw
draw_str('Goodbye, World!')</langsyntaxhighlight>
 
=={{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 663 ⟶ 759:
gtk_main();
return 0;
}</langsyntaxhighlight>
 
=== Win32 ===
Line 671 ⟶ 767:
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>.
 
<langsyntaxhighlight lang="c">#include <windows.h>
 
int main(void) {
MessageBox(NULL, TEXT("Goodbye, World!"), TEXT("Rosetta Code"), MB_OK | MB_ICONINFORMATION);
return 0;
}</langsyntaxhighlight>
 
=== OS/2 Presentation Manager ===
Line 687 ⟶ 783:
wlink system os2v2_pm name hello file hello.obj</pre>
 
<langsyntaxhighlight lang="c">#include <os2.h>
 
int main(void) {
Line 706 ⟶ 802:
WinTerminate(hab);
return 0;
}</langsyntaxhighlight>
 
=== Turbo C for DOS ===
Line 712 ⟶ 808:
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>.
 
<langsyntaxhighlight lang="c">#include <conio.h>
#include <graphics.h>
 
Line 734 ⟶ 830:
closegraph();
return 0;
}</langsyntaxhighlight>
 
=={{header|C sharp|C#}}==
Line 740 ⟶ 836:
{{libheader|Windows Forms}}
 
<langsyntaxhighlight lang="csharp">using System;
using System.Windows.Forms;
 
Line 748 ⟶ 844:
MessageBox.Show("Goodbye, World!");
}
}</langsyntaxhighlight>
 
{{libheader|GTK}}
 
<langsyntaxhighlight lang="csharp">using Gtk;
using GtkSharp;
 
Line 763 ⟶ 859:
Application.Run();
}
}</langsyntaxhighlight>
 
=={{header|C++}}==
Line 769 ⟶ 865:
 
{{libheader|GTK}}<!-- c++ bindings -->
<langsyntaxhighlight lang="cpp">#include <gtkmm.h>
int main(int argc, char *argv[])
{
Line 775 ⟶ 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 781 ⟶ 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 805 ⟶ 901:
return Fl::run();
}
</syntaxhighlight>
</lang>
 
=={{header|C++/CLI}}==
<langsyntaxhighlight lang="cpp">
using namespace System::Windows::Forms;
 
Line 816 ⟶ 912:
return 0;
}
</syntaxhighlight>
</lang>
 
=={{header|Casio BASIC}}==
To configure the "Graphical screen"
<langsyntaxhighlight Basiclang="basic Casiocasio">ViewWindow 1,127,1,1,63,1
AxesOff
CoordOff
GridOff
LabelOff</langsyntaxhighlight>
ViewWindow parameters depend on the calculator resolution (These are the most common). <br>
To print text on the "Graphical screen" of the calculator:
<langsyntaxhighlight Basiclang="basic Casiocasio">Text 1,1,"Goodbye, World!"
ClrGraph</langsyntaxhighlight>
 
=={{header|Clean}}==
{{libheader|Object I/O}}
<langsyntaxhighlight lang="clean">import StdEnv, StdIO
 
Start :: *World -> *World
Line 838 ⟶ 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 855 ⟶ 951:
(.pack)
(.setDefaultCloseOperation (JFrame/EXIT_ON_CLOSE))
(.setVisible true)))</langsyntaxhighlight>
 
=== With cljfx ===
{{libheader|cljfx}}
<langsyntaxhighlight lang="lisp">(ns example
(:require [cljfx.api :as fx]))
 
Line 873 ⟶ 969:
:alignment :center
:children [{:fx/type :label
:text "Goodbye, world"}]}}}))</langsyntaxhighlight>
 
=={{header|COBOL}}==
Line 882 ⟶ 978:
{{libheader|Windows Forms}}
{{trans|C#}}
<langsyntaxhighlight lang="cobol"> CLASS-ID ProgramClass.
METHOD-ID Main STATIC.
PROCEDURE DIVISION.
Line 888 ⟶ 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 898 ⟶ 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 972 ⟶ 1,068:
 
goback.
end program cobweb-gui-hello.</langsyntaxhighlight>
 
===TUI===
Line 979 ⟶ 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 997 ⟶ 1,093:
end-display
accept var end-accept
stop run.</langsyntaxhighlight>
 
=={{header|Cobra}}==
Line 1,003 ⟶ 1,099:
Requires {{libheader|GTK#}} GUI library.
 
<langsyntaxhighlight lang="cobra">
@args -pkg:gtk-sharp-2.0
 
Line 1,018 ⟶ 1,114:
dialog.run
dialog.destroy
</syntaxhighlight>
</lang>
 
=={{header|CoffeeScript}}==
<langsyntaxhighlight lang="coffeescript">alert "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Commodore BASIC}}==
Line 1,031 ⟶ 1,127:
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">
<lang CommodoreBASICv2>
1 rem hello world on graphics screen
2 rem commodore 64 version
Line 1,081 ⟶ 1,177:
530 poke mem,peek(mem) or 2^px
540 return
</langsyntaxhighlight>
 
 
Line 1,087 ⟶ 1,183:
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 1,101 ⟶ 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)
 
Line 1,134 ⟶ 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 1,160 ⟶ 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 1,178 ⟶ 1,310:
new GoodbyeWorld();
Main.run();
}</langsyntaxhighlight>
 
=={{header|Dart}}==
Line 1,186 ⟶ 1,318:
 
Simplest (and ugliest) solution
<langsyntaxhighlight lang="javascript">import 'package:flutter/material.dart';
 
main() => runApp( MaterialApp( home: Text( "Goodbye, World!" ) ) );
</syntaxhighlight>
</lang>
 
A still bare bones but much better looking example that displays a white screen with the text centered
<langsyntaxhighlight lang="javascript">import 'package:flutter/material.dart';
 
void main() {
Line 1,206 ⟶ 1,338:
);
}
</syntaxhighlight>
</lang>
 
 
Line 1,213 ⟶ 1,345:
===Web/Javascript===
{{libheader|dart:html}}
<langsyntaxhighlight lang="javascript">import 'dart:html';
 
main() => document.body.innerHtml = '<p>Goodbye, World!</p>';
</syntaxhighlight>
</lang>
 
{{trans|JavaScript}}
<langsyntaxhighlight lang="javascript">import 'dart:html';
 
main() => window.alert("Goodbye, World!");
</syntaxhighlight>
</lang>
 
=={{header|Delphi}}==
<langsyntaxhighlight Delphilang="delphi">program HelloWorldGraphical;
 
uses
Line 1,232 ⟶ 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("Goodbye, World!", frame: make(<frame>));</langsyntaxhighlight>
 
=={{header|E}}==
Line 1,244 ⟶ 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 1,260 ⟶ 1,398:
frame.open()
 
interp.blockAtTop()</langsyntaxhighlight>
 
=={{header|EasyLang}}==
 
[https://easylang.onlinedev/ideshow/?run#cod=move_pen%2010%2020%0Adraw_text%20%22Goodbye%2C%20World%21%22y80vS1UwNFAwMuAqSa0oUVByz89PSapM1VEIzy/KSVFU4gIA Run it]
 
<syntaxhighlight lang="text">
<lang>move_pen 10 20
move 10 20
draw_text "Goodbye, World!"</lang>
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 1,296 ⟶ 1,436:
}
 
GoodByeForm form {};</langsyntaxhighlight>
 
=={{header|EchoLisp}}==
<langsyntaxhighlight lang="lisp">
(alert "Goodbye, World!")
</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>!".
<langsyntaxhighlight lang="egl">
import org.eclipse.edt.rui.widgets.*;
import dojo.widgets.*;
Line 1,323 ⟶ 1,463:
 
end
</syntaxhighlight>
</lang>
 
=={{header|Elena}}==
ELENA 56.0x :
<langsyntaxhighlight lang="elena">import forms;
public class MainWindow : SDIDialog
Line 1,335 ⟶ 1,475:
constructor new()
<= super new()
{
self.Caption := "ELENA";
Line 1,355 ⟶ 1,495:
closeButton.onClick := (args){ forward program.stop() };
}
}</langsyntaxhighlight>
=== Alternative version using xforms script ===
 
<langsyntaxhighlight lang="elena">import xforms;
 
const layout = "
Line 1,384 ⟶ 1,524:
dispatch() => Form;
}</langsyntaxhighlight>
 
=={{header|Emacs Lisp}}==
<syntaxhighlight lang="lisp">
(message-box "Goodbye, World!")
</syntaxhighlight>
 
 
=={{header|Euphoria}}==
===Message box===
<langsyntaxhighlight lang="euphoria">include msgbox.e
 
integer response
response = message_box("Goodbye, World!","Bye",MB_OK)</langsyntaxhighlight>
 
=={{header|F_Sharp|F#}}==
Just display the text in a message box.
<langsyntaxhighlight lang="fsharp">#light
open System
open System.Windows.Forms
Line 1,401 ⟶ 1,547:
let main _ =
MessageBox.Show("Hello World!") |> ignore
0</langsyntaxhighlight>
 
=={{header|Factor}}==
Line 1,409 ⟶ 1,555:
 
=={{header|Fantom}}==
<langsyntaxhighlight lang="fantom">
using fwt
 
Line 1,419 ⟶ 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 1,425 ⟶ 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 1,437 ⟶ 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 1,457 ⟶ 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,498 ⟶ 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>
=={{header|Fennel}}==
==={{libheader|LÖVE}}===
<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)))
</lang>
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|FreeBASIC}}==
 
'''Graphics Mode'''
{{works with|QBasic}}
<langsyntaxhighlight FreeBASIClang="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,539 ⟶ 1,687:
cp.add label
frame.pack
frame.setVisible true</langsyntaxhighlight>
 
=={{header|Frink}}==
Line 1,548 ⟶ 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,556 ⟶ 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,575 ⟶ 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,598 ⟶ 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,624 ⟶ 1,783:
win.ShowAll()
gtk.Main()
}</langsyntaxhighlight>
 
=={{header|Groovy}}==
{{trans|Java}}
<langsyntaxhighlight lang="groovy">import groovy.swing.SwingBuilder
import javax.swing.JFrame
 
Line 1,639 ⟶ 1,798:
}
}
</syntaxhighlight>
</lang>
 
=={{header|GUISS}}==
Line 1,645 ⟶ 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,666 ⟶ 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|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,690 ⟶ 1,849:
==={{header|Unicon}}===
 
<langsyntaxhighlight lang="unicon">
import gui
$include "guih.icn"
Line 1,712 ⟶ 1,871:
w.show_modal ()
end
</syntaxhighlight>
</lang>
 
=={{header|HPPPL}}==
With an alert box:
<langsyntaxhighlight HPPPLlang="hpppl">MSGBOX("Goodbye, World!");</langsyntaxhighlight>
By drawing directly to the screen:
<langsyntaxhighlight HPPPLlang="hpppl">RECT();
TEXTOUT_P("Goodbye, World!", GROBW_P(G0)/4, GROBH_P(G0)/4, 7);
WAIT(-1);</langsyntaxhighlight>
 
=={{header|i}}==
<langsyntaxhighlight lang="i">graphics {
display("Goodbye, World!")
}</langsyntaxhighlight>
 
=={{header|Integer BASIC}}==
Line 1,731 ⟶ 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,799 ⟶ 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,818 ⟶ 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,845 ⟶ 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,875 ⟶ 2,034:
});
}
}</langsyntaxhighlight>
 
Using Java 8 lambdas syntax:
 
<langsyntaxhighlight lang="java">import javax.swing.*;
import java.awt.*;
 
Line 1,899 ⟶ 2,058:
});
}
}</langsyntaxhighlight>
 
=={{header|JavaScript}}==
<langsyntaxhighlight lang="javascript"> alert("Goodbye, World!");</langsyntaxhighlight>
 
=={{header|jq}}==
Line 1,915 ⟶ 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,949 ⟶ 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,957 ⟶ 2,116:
"</svg>";
 
task</langsyntaxhighlight>
{{out}}
jq -n -r -f Hello_word_Graphical.jq > Hello_word_Graphical.svg
 
=={{header|JSE}}==
<langsyntaxhighlight JSElang="jse">Text 25,10,"Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Jsish}}==
Line 1,977 ⟶ 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 2,019 ⟶ 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 2,056 ⟶ 2,215:
{{libheader|Tk}}
 
<langsyntaxhighlight lang="julia">using Tk
 
window = Toplevel("Hello World", 200, 100, false)
Line 2,069 ⟶ 2,228:
set_visible(window, true)
 
# sleep(7)</langsyntaxhighlight>
 
=={{header|Just Basic}}==
<syntaxhighlight lang="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.
</syntaxhighlight>
</lang>
 
=={{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 2,107 ⟶ 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 2,139 ⟶ 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 2,153 ⟶ 2,330:
while gl_frame():
gl_clear([ 0.0, 0.0, 0.0, 1.0 ])
gl_text("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|Logo}}==
Line 2,159 ⟶ 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 2,172 ⟶ 2,349:
if (not iup.MainLoopLevel or iup.MainLoopLevel()==0) then
iup.MainLoop()
end</langsyntaxhighlight>
 
==={{libheader|LÖVE}}===
Line 2,185 ⟶ 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 2,221 ⟶ 2,398:
}
CheckIt
</syntaxhighlight>
</lang>
 
A simple Window only
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
Declare Simple Form
Line 2,232 ⟶ 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 2,262 ⟶ 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 2,277 ⟶ 2,463:
Trestle.Install(v);
Trestle.AwaitDelete(v);
END GUIHello.</langsyntaxhighlight>
This code requires an m3makefile.
<pre>
Line 2,295 ⟶ 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 2,416 ⟶ 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 2,423 ⟶ 2,609:
The Neko program follows:
 
<syntaxhighlight lang="actionscript">/**
<lang ActionScript>/**
<doc><pre>
Hello world, graphical, in Neko, via Agar label
Line 2,456 ⟶ 2,642:
 
/* Run the event loop */
agar_eventloop();</langsyntaxhighlight>
 
{{out}}
Line 2,467 ⟶ 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,482 ⟶ 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,513 ⟶ 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,606 ⟶ 2,792:
method isFalse() public static returns boolean
return \isTrue
</syntaxhighlight>
</lang>
 
=={{header|newLISP}}==
Line 2,612 ⟶ 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,635 ⟶ 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}}==
<langsyntaxhighlight NSlang="ns-HUBASIChubasic">10 LOCATE 6,11
20 PRINT "GOODBYE, WORLD!"</langsyntaxhighlight>
 
=={{header|Nyquist}}==
===Audacity plug-in (Lisp syntax)===
<langsyntaxhighlight lang="lisp">;nyquist plug-in
;version 4
;type tool
;name "Goodbye World"
 
(print "Goodbye, World!")</langsyntaxhighlight>
 
===Audacity plug-in (SAL syntax)===
<langsyntaxhighlight SALlang="sal">;nyquist plug-in
;version 4
;type tool
Line 2,675 ⟶ 2,861:
;name "Goodbye World"
 
return "Goodbye, World!"</langsyntaxhighlight>
 
=={{header|Objeck}}==
{{libheader|Qt}}
<langsyntaxhighlight lang="objeck">
use Qt;
 
Line 2,695 ⟶ 2,881:
}
}
</syntaxhighlight>
</lang>
 
=={{header|Objective-C}}==
To show a modal alert (Mac):
<langsyntaxhighlight lang="objc">NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Goodbye, World!"];
[alert runModal];</langsyntaxhighlight>
 
To show a modal alert (iOS):
<langsyntaxhighlight lang="objc">UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Goodbye, World!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];</langsyntaxhighlight>
 
=={{header|OCaml}}==
{{libheader|GTK}}
<langsyntaxhighlight lang="ocaml">let delete_event evt = false
 
let destroy () = GMain.Main.quit ()
Line 2,722 ⟶ 2,908:
;;
 
let _ = main () ;;</langsyntaxhighlight>
 
{{libheader|OCaml-Xlib}}
Line 2,731 ⟶ 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,744 ⟶ 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}}==
<langsyntaxhighlight Progresslang="progress (OpenEdgeopenedge ABLabl)">MESSAGE "Goodbye, World!" VIEW-AS ALERT-BOX.</langsyntaxhighlight>
 
=={{header|OxygenBasic}}==
Line 2,769 ⟶ 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,793 ⟶ 2,979:
 
</glade-interface>
</syntaxhighlight>
</lang>
And finally the Oxygene:
<langsyntaxhighlight lang="oxygene">
// Display a Message in a GUI Window
//
Line 2,843 ⟶ 3,029:
 
end.
</syntaxhighlight>
</lang>
===.NET===
[[File:OxygeneNEThw.jpg|left|HelloWorld]]
<br clear=both>
<langsyntaxhighlight lang="oxygene">
namespace HelloWorldNET;
 
Line 2,866 ⟶ 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}}==
<langsyntaxhighlight Panoramiclang="panoramic">print "Goodbye, World!"
'Prints in the upper left corner of the window.
</syntaxhighlight>
</lang>
 
=={{header|PARI/GP}}==
<langsyntaxhighlight lang="parigp">plotinit(1, 1, 1, 1);
plotstring(1, "Goodbye, World!");
plotdraw([1, 0, 15]);</langsyntaxhighlight>
 
=={{header|Pascal}}==
Line 2,889 ⟶ 3,075:
{{libheader|Gtk2}}
Variant of the C example:
<langsyntaxhighlight lang="pascal">program HelloWorldGraphical;
 
uses
Line 2,910 ⟶ 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,918 ⟶ 3,111:
Just output as a label in a window:
 
<langsyntaxhighlight lang="perl">
use strict;
use warnings;
Line 2,925 ⟶ 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,938 ⟶ 3,131:
-command => \&exit,
)->pack;
MainLoop();</langsyntaxhighlight>
 
==={{libheader|Perl/Gtk2}}===
<langsyntaxhighlight lang="perl">use strict;
use warnings;
use Gtk2 '-init';
Line 2,955 ⟶ 3,148:
 
$window->show_all;
Gtk2->main;</langsyntaxhighlight>
 
==={{libheader|Perl/Qt}}===
<langsyntaxhighlight lang="perl">use strict;
use warnings;
use QtGui4;
Line 2,965 ⟶ 3,158:
my $label = Qt::Label('Goodbye, World');
$label->show;
exit $app->exec;</langsyntaxhighlight>
 
=={{header|Phix}}==
{{libheader|Phix/basics}}
{{libheader|Phix/pGUI}}
<!--<langsyntaxhighlight Phixlang="phix">(phixonline)-->
<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: #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>
<!--</langsyntaxhighlight>-->
=== 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,992 ⟶ 3,206:
$wnd->show_all();
Gtk::main();</langsyntaxhighlight>
 
=={{header|PicoLisp}}==
<langsyntaxhighlight PicoLisplang="picolisp">(call 'dialog "--msgbox" "Goodbye, World!" 5 20)</langsyntaxhighlight>
 
=={{header|Plain English}}==
<langsyntaxhighlight lang="plainenglish">To run:
Start up.
Clear the screen.
Line 3,004 ⟶ 3,218:
Refresh the screen.
Wait for the escape key.
Shut down.</langsyntaxhighlight>
 
=={{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 3,017 ⟶ 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 3,039 ⟶ 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 3,066 ⟶ 3,328:
send(D, display, T, point(XT, YT)),
send(D, open).
</syntaxhighlight>
</lang>
 
=={{header|Pure Data}}==
Line 3,081 ⟶ 3,343:
 
=={{header|PureBasic}}==
<langsyntaxhighlight PureBasiclang="purebasic">MessageRequester("Hello","Goodbye, World!")</langsyntaxhighlight>
Using the Windows API:
<langsyntaxhighlight PureBasiclang="purebasic">MessageBox_(#Null,"Goodbye, World!","Hello")</langsyntaxhighlight>
 
=={{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 3,096 ⟶ 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 3,118 ⟶ 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 3,177 ⟶ 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 3,210 ⟶ 3,497:
 
GoodByeApp().run()
</syntaxhighlight>
</lang>
 
 
==={{libheader|Kivy}}===
With kv language
<langsyntaxhighlight lang="python">
 
from kivy.app import App
Line 3,246 ⟶ 3,533:
 
GoodByeApp().run()
</syntaxhighlight>
</lang>
 
=={{header|Quackery}}==
 
<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 3,276 ⟶ 3,586:
; Show the frame by calling its show method
(send frame show #t)</langsyntaxhighlight>
 
=={{header|Raku}}==
Line 3,283 ⟶ 3,593:
 
{{libheader|GTK}}
<syntaxhighlight lang="raku" perl6line>use GTK::Simple;
use GTK::Simple::App;
 
Line 3,289 ⟶ 3,599:
$app.border-width = 20;
$app.set-content( GTK::Simple::Label.new(text => "Goodbye, World!") );
$app.run;</langsyntaxhighlight>
 
=={{header|RapidQ}}==
<langsyntaxhighlight lang="rapidq">MessageBox("Goodbye, World!", "RapidQ example", 0)</langsyntaxhighlight>
 
=={{header|Rascal}}==
<langsyntaxhighlight lang="rascal">
import vis::Figure;
import vis::Render;
Line 3,301 ⟶ 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 3,321 ⟶ 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 3,333 ⟶ 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 3,348 ⟶ 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 3,376 ⟶ 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 3,388 ⟶ 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 3,402 ⟶ 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 3,434 ⟶ 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 3,444 ⟶ 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 3,479 ⟶ 3,793:
window.show_all();
gtk::main();
}</langsyntaxhighlight>
 
=={{header|Scala}}==
Line 3,486 ⟶ 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 3,500 ⟶ 3,814:
}
}
}</langsyntaxhighlight>
===.Net Framework===
<langsyntaxhighlight Scalalang="scala">import swing._
object HelloDotNetWorld {
Line 3,509 ⟶ 3,823:
("Goodbye, World!")
}
}</langsyntaxhighlight>
 
=={{header|Scheme}}==
Line 3,515 ⟶ 3,829:
{{libheader|Scheme/PsTk}}
 
<langsyntaxhighlight lang="ruby">
#!r6rs
 
Line 3,531 ⟶ 3,845:
 
(tk-event-loop tk)
</syntaxhighlight>
</lang>
 
=={{header|Scilab}}==
<langsyntaxhighlight lang="scilab">messagebox("Goodbye, World!")</langsyntaxhighlight>
 
=={{header|Scratch}}==
Line 3,540 ⟶ 3,854:
 
=={{header|ScratchScript}}==
<langsyntaxhighlight ScratchScriptlang="scratchscript">pos -100 70
print "Goodbye, World!"</langsyntaxhighlight>
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.
<langsyntaxhighlight ScratchScriptlang="scratchscript">pos -100 70
print "Goodbye, World!"
delayOnClick</langsyntaxhighlight>
 
=={{header|Seed7}}==
Line 3,556 ⟶ 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,576 ⟶ 3,890:
write(screen, "Goodbye, World");
ignore(getc(KEYBOARD));
end func;</langsyntaxhighlight>
 
=={{header|SenseTalk}}==
<langsyntaxhighlight lang="sensetalk">Answer "Good Bye" </langsyntaxhighlight>
 
=={{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</langsyntaxhighlight>
{{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,636 ⟶ 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,659 ⟶ 4,002:
=={{header|Standard ML}}==
Works with PolyML
<langsyntaxhighlight Standardlang="standard MLml">open XWindows ;
open Motif ;
Line 3,677 ⟶ 4,020:
end;
</syntaxhighlight>
</lang>
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}}==
<langsyntaxhighlight Toshlang="tosh">when flag clicked
say "Goodbye, World!"
stop this script</langsyntaxhighlight>
 
=={{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,727 ⟶ 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|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>
 
 
Line 3,760 ⟶ 4,112:
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">
<lang Cpp>
#include <CtrlLib/CtrlLib.h>
// submitted by Aykayayciti (Earl Lamont Montgomery)
Line 3,810 ⟶ 4,162:
GoodbyeWorld().Run();
}
</syntaxhighlight>
</lang>
 
 
Line 3,817 ⟶ 4,169:
 
=={{header|Vala}}==
<langsyntaxhighlight lang="vala">#!/usr/local/bin/vala --pkg gtk+-3.0
using Gtk;
 
Line 3,836 ⟶ 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}}==
 
<langsyntaxhighlight lang="vbscript">
MsgBox("Goodbye, World!")
</syntaxhighlight>
</lang>
 
=={{header|Vedit macro language}}==
Displaying the message on status line. The message remains visible until the next keystroke, but macro execution continues.
<langsyntaxhighlight lang="vedit">Statline_Message("Goodbye, World!")</langsyntaxhighlight>
 
Displaying a dialog box with the message and default OK button:
<langsyntaxhighlight lang="vedit">Dialog_Input_1(1,"`Vedit example`,`Goodbye, World!`")</langsyntaxhighlight>
 
=={{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,870 ⟶ 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}}==
<langsyntaxhighlight lang="web68">@1Introduction.
Define the structure of the program.
 
Line 3,909 ⟶ 4,268:
macro fl finish;
 
@ The end.</langsyntaxhighlight>
 
=={{header|Wee Basic}}==
<langsyntaxhighlight Weelang="wee Basicbasic">print 1 at 10,12 "Hello world!"
end</langsyntaxhighlight>
 
=={{header|Wren}}==
{{libheader|DOME}}
<langsyntaxhighlight ecmascriptlang="wren">import "graphics" for Canvas, Color
 
class Game {
Line 3,927 ⟶ 4,286:
 
static draw(alpha) {}
}</langsyntaxhighlight>
 
=={{header|X86 Assembly}}==
Line 3,936 ⟶ 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,962 ⟶ 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,975 ⟶ 4,334:
invoke ExitProcess,0
.end start
</syntaxhighlight>
</lang>
 
=={{header|X86-64 Assembly}}==
Line 3,981 ⟶ 4,340:
Not sure if ncurses counts as 'graphical', but whatver..
===={{libheader|ncurses}}====
<langsyntaxhighlight lang="asm">
option casemap:none
 
printf proto :qword, :vararg
exit proto :dword
;; curses.h stuff
 
initscr proto ;; WINDOW *initsrc(void);
;; curses.h stuff
initscrendwin proto ;; WINDOWint *initsrcendwin(void);
endwin start_color proto ;; int endwinstart_color(void);
start_colorwrefresh proto :qword ;; int start_colorwrefresh(voidWINDOW *w);
wrefreshwgetch proto :qword ;; int wrefreshwgetch(WINDOW *w);
wgetch waddnstr proto :qword, :qword, :dword ;; int wgetchwaddnstr(WINDOW *w, const char *str, int n);
;; Just a wrapper to make printing easier..
waddnstr proto :qword, :qword, :dword ;; int waddnstr(WINDOW *w, const char *str, int n);
println proto :qword, :qword
 
;; Just a wrapper to make printing easier..
println proto :qword, :qword
 
.code
Line 4,019 ⟶ 4,376:
 
end
</syntaxhighlight>
</lang>
 
===={{libheader|GTK}}====
<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
 
.data
tlt db "hello_gtk",0
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}}==
This sets up a 320x200x8 (VGA) graphics screen and writes text on it.
<langsyntaxhighlight XPL0lang="xpl0">[SetVid($13); Text(6, "Goodbye, World!")]</langsyntaxhighlight>
 
=={{header|XSLT}}==
Line 4,029 ⟶ 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 4,049 ⟶ 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 4,064 ⟶ 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!\"")
 
62

edits