[Question]
  [
Please read the rules, **and the bold areas as well**.
Write a program in any language, so long as it has GUI support for a window system (cannot be text-consoles, etc., and must be a GUI/toolkit/window).
The program must say hello world in any manner (splash image, menu bar, status bar, title, video, message box, other widget stuff, etc.), **so long as a GUI-compliant window appears and shows this text for three seconds**. The person who can code this in the least amount of code used, counted in bytes, will take the cake.
  
[Answer]
# Unix shell, 31 characters
```
xmessage -timeout 3 hello world
```
![message "hello world" with button "okay"](https://i.stack.imgur.com/yJIxS.png)
This program requires the [xmessage(1)](http://www.openbsd.org/cgi-bin/man.cgi?query=xmessage&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html) utility from X.Org. It uses the traditional black-and-white X Athena Widgets (Xaw).
[Answer]
# Shell and gedit - 27 characters
```
timeout 3 gedit Hello World
```
> 
> ![](https://i.stack.imgur.com/JtTxV.png)
> 
> 
> 
If Hello World needs to be displayed as a single string, then its **28** characters:
```
timeout 3 gedit Hello\ World
```
`timeout` utility runs a command for the duration specified. It ensures that gedit runs for 3 seconds, assuming minimal startup time.
Any editor can be used in place of `gedit`. If a shorter named editor is used like `gvim`, the length can be reduced by 1 or more characters.
Using an editor initially thought of by [user80551](https://codegolf.stackexchange.com/a/28425/8395).
[Answer]
# Applescript, 45 bytes:
Not often Applescript is one of the shorter answers:
```
display alert "hello world" giving up after 3
```
Paste into the Applescript Editor and run, or run using `osascript` at the command line:
```
osascript -e 'display alert "hello world" giving up after 3'
```
![enter image description here](https://i.stack.imgur.com/b3g6r.png)
[Answer]
# HTML+Javascript, 73 60 characters
```
<script>setTimeout("open('','_self','');close()",3e3)</script>Hello world
```
This works in Chrome, but may not be portable to other browsers.
Suggestions from the comments take this further:
```
<body onload=open('',name=setTimeout(close,3e3))>Hello world
```
[Answer]
## shell script, 31
Not sure whether it qualifies. Requires `notify-send`. Works at least on Ubuntu 12.04.
```
notify-send -t 3000 Hello world
```
![screenshot](https://i.stack.imgur.com/J0UZ5.png)
[Answer]
## shell + gedit / geany, 34
```
gedit Hello\ World&sleep 3;kill $!
```
![Hello World in gedit](https://i.stack.imgur.com/58xZf.png)
This assumes that gedit pops up instantly since the 3 seconds are counted from the start of issuing the command. Could be smaller if there's a GUI text editor shorter than `gedit`.
`geany` works too for the same number of chars, just `s/gedit/geany/g`
![Hello World in geany](https://i.stack.imgur.com/YZYvu.png)
EDIT: Using `timeout` is shorter. <https://codegolf.stackexchange.com/a/28477/8766>
EDIT2: Can anyone confirm if this works with `kate` ?
---
## meld , 32
If exactly `Hello World` is not required, then `meld` can be used.
```
meld Hello World&sleep 3;kill $!
```
![Hello : World - Meld](https://i.stack.imgur.com/yUnaH.png)
[Answer]
## VBScript, 58
```
WScript.CreateObject("WScript.Shell").Popup"Hello world",3
```
![screenshot](https://i.stack.imgur.com/YBxWB.png)
[Answer]
## Python (pygame), 87
```
import pygame.display as d,time
d.set_mode()
d.set_caption('Hello world')
time.sleep(3)
```
![screenshot](https://i.stack.imgur.com/qksU3.png)
[Answer]
## Tcl - 32 bytes
I noticed that some of these submissions, like the shell or javascript ones, allow you to type the code into the console. If that's the case I can shorten it to:
```
wm ti . hello\ world;af 3000 exi
```
Must be typed into the console **after** running wish. Meaning, run `wish` without arguments which will give you a REPL console and then type the code above. This makes use of the fact that tcl can be lenient and autocomplete command/function names but only in interactive mode. So that `af` actually exectues the `after` command and `exi` executes `exit`. I wanted to use `ex` but my system has the `ex` editor installed.
---
## Original submission - 36 bytes
```
wm ti . hello\ world;after 3000 exit
```
Run using `wish` instead of `tclsh`.
[Answer]
## ~~52~~ 51 chars with Mathematica
(Hope it counts as a GUI-compliant.)
```
NotebookClose/@{CreateDialog@"Hello world",Pause@3}
```
![Mathematica GUI Golf code](https://i.stack.imgur.com/kOyyw.jpg)
[Answer]
# Java, 136 bytes
```
class F{public static void main(String[]a)throws Exception{new java.awt.Frame("Hello World").show();Thread.sleep(3000);System.exit(0);}}
```
Displays the message `Hello World` as the title of a frame. After `3` seconds, the program closes.
Looks like this:
![enter image description here](https://i.stack.imgur.com/durlm.png)
Drag it bigger:
![enter image description here](https://i.stack.imgur.com/HsFAx.png)
---
Expanded code (ie readable):
```
class F {
    public static void main(String[] a) throws Exception {
        new java.awt.Frame("Hello World").show();
        Thread.sleep(3000);
        System.exit(0);
    }
}
```
[Answer]
## R, 44
```
x11(ti="Hello World");Sys.sleep(3);dev.off()
```
![enter image description here](https://i.stack.imgur.com/SF3DM.png)
[Answer]
## PowerShell - 63 52
```
(new-object -c wscript.shell).popup('Hello World',3)
```
[Answer]
# Visual FoxPro - 23 characters
```
WAIT"hello world"TIME 3
```
![Hello world in VFP](https://i.stack.imgur.com/gshsO.png)
This abuses the fact that VFP allows to not to put a space between the string to be printed (which I just discovered) and that it allows to shorten every keyword to up to its first 4 characters.
Ungolfed version:
```
WAIT "hello world" TIMEOUT 3
```
[Answer]
# GTK+, ~~47~~ 45
```
zenity --info --text=Hello\ World --timeout=3
```
![Hello World](https://i.stack.imgur.com/gjUmd.png)
---
Old version (score 47):
```
zenity --info --title="Hello World" --timeout=3
```
![Hello World](https://i.stack.imgur.com/QeE6K.png)
For some reason, zenity display a text which can be translated as *All update are done*.
[Answer]
## Batch (24)
```
msg/time:3 * hello world
```
Tested on Windows 7, but should work on any NT-based version of Windows, assuming you have MSG.EXE in your System32 folder.
EDIT: Apparently MSG.EXE is not available by default on home versions of Windows. On Windows 7, for example, this is only available in the Ultimate or Business editions. However, you can copy the file over to your System32 folder and get it to work. (You must also copy over the appropriate MSG.EXE.MUI file to get proper error messages, but my "script" works without them.)
You have to install software for most of these other responses to work, too, so I don't think that should be a disqualifier.
[Answer]
## C, 151 characters
```
#include<allegro.h>
main(){textout_ex(screen,font,"Hello World",0,0,7,set_gfx_mode('SAFE',8,8,install_timer(),
allegro_init()));rest(3e3);}END_OF_MAIN()
```
Not the smallest answer. I like it though.
[Answer]
# C# 101 151
This will for sure not be the shortest answer (since there are already other good answers being way shorter) but codegolf.SE needs a lot more C# contributions in my opinion!
```
using t=System.Threading;class P{static void Main(){using(t.Tasks.Task.Run(()=>System.Windows.MessageBox.Show("hello world"))){t.Thread.Sleep(3000);}}}
```
# C# 121
An alternative based on [Bob's answer](https://codegolf.stackexchange.com/a/28480/21478), but with WPF instead of WinForms:
```
class P{static void Main(){new System.Windows.Window(){Title="hello world"}.Show();System.Threading.Thread.Sleep(3000);}}
```
Saves 3 characters thanks to the shorter namespace ...
[Answer]
## bash + ImageMagick (36 bytes)
```
timeout 3 display label:Hello\ world
```
Tested on Ubuntu 14.04 LTS and on Fedora 20.
Nicer-looking, but 10 bytes larger:
```
timeout 3 display -size 800 label:Hello\ world
```
[Answer]
## CMD / Batch - 33 Bytes
I believe the window that the Windows CMD terminal runs in counts as GUI compliant.
```
start "Hello world" cmd /csleep 3
```
If you don't have the `sleep` command on your system - then you can use `timeout` which comes default in Windows 7. For two more bytes.
```
start "Hello world" cmd /ctimeout 3
```
Starts a new CMD window with the title "Hello World" (**NOT** displayed in the terminal itself, but as the title of the GUI window that the terminal runs in), this window will close as soon as all parsed commands have executed - so after `sleep 3` or `timeout 3` has completed.
The window looks like this -
![Bloke](https://i.stack.imgur.com/vWFKL.png)
Note; `start` runs the given commands in a new window - not the window that you are running the above commands from.
[Answer]
# [Autohotkey](https://autohotkey.com/), 22 Bytes
```
msgbox,,hello world,,3
```
Ahk's [msgbox](https://autohotkey.com/docs/commands/MsgBox.htm) is pretty powerful and has a built-in timeout option.
![msgbox](https://i.stack.imgur.com/ZQmmX.png)
[Answer]
# [Red](http://www.red-lang.org), 49 bytes
```
view[text"hello world"rate 0:0:3 on-time[unview]]
```
[Answer]
## APL (40)
```
X.Close‚ä£‚éïDL 3‚ä£'X'‚éïWC'Form' 'Hello World'
```
[Answer]
## Lua + L√ñVE, 67 bytes
```
l=love l.window.setTitle"hello world"l.timer.sleep(3)l.event.quit()
```
![enter image description here](https://i.stack.imgur.com/TZnXa.png)
[Answer]
# Perl on Windows (56)
```
use Win32;fork?kill+sleep+3,$$:Win32'MsgBox"Hello World"
```
[Answer]
## Perl 5, 47
Using [Perl/Tk](http://search.cpan.org/~srezic/Tk-804.032/Tk.pod):
```
perl -MTk -e'alarm 3;tkinit-title,"Hello World!";MainLoop'
#     123    45678901234567890123456789012345678901234567
```
[Answer]
# Rebol View (r3gui), 49
```
view/no-wait[title"hello world"]wait 3 unview/all
```
!["hello world" from Rebol 3 View](https://i.stack.imgur.com/xXSRU.png)
Ungolfed:
```
view/no-wait [title "hello world"]
wait 3
unview/all
```
[Answer]
# Processing, 77
```
int x=millis();void draw(){text("Hello world",0,9);if(millis()>x+3e3)exit();}
```
Screenshot:
![enter image description here](https://i.stack.imgur.com/of5Oi.png)
**Edit 1:** Y position of the text can be 9 instead of 10, like noted by @ace.
**Edit 2:** 3000 can be represented as 3e3 to shave one character off, also noted by @ace
[Answer]
### Python with turtle module (69 66 bytes)
```
import turtle as t,time
t.title("Hello World")
t.fd(1)
time.sleep(3)
```
Note that if you run this in an interactive console, you don't need the `t.fd(9)` line. However, for some reason when running this non-interactively, the title doesn't change unless you run the extra line.
### Edit (66 bytes)
```
import turtle as t
t.title("Hello World")
t.ontimer(t.fd(1),3000)
```
[Answer]
# QML - 98 bytes
Here's the code. Works on all supported platforms (including Android and iOS):
```
import QtQuick 1.0;Text{text:"Hello world";Timer{interval:3000;onTriggered:Qt.quit();running:1>0}}
```
![enter image description here](https://i.stack.imgur.com/xafJN.png)
]