Window creation: Difference between revisions

Rename Perl 6 -> Raku, alphabetize, minor clean-up
(Nim - added wxWidgets example)
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 91:
END
FINISH</lang>
 
=={{header|Arturo}}==
{{libheader|GTK}}
Line 102 ⟶ 103:
app @main "TestWindow" mainWindow #{}
main.run</lang>
 
=={{header|AurelBasic}}==
<lang AurelBasic>WIN 0 0 400 300 "New Window"</lang>
 
=={{header|AutoHotkey}}==
Line 118 ⟶ 122:
EndSwitch
Until False</lang>
 
=={{header|AurelBasic}}==
<lang AurelBasic>WIN 0 0 400 300 "New Window"</lang>
 
=={{header|BaCon}}==
Line 267 ⟶ 268:
 
</lang>
 
=={{header|C sharp|C#}}==
 
{{libheader|Windows Forms}}
{{uses from|library|.NET Framework|component1=System.Windows.Forms|component2=System.Windows.Forms.Window|component3=System.Windows.Forms.Form|component4=System.Windows.Forms.Application}}
<lang csharp>using System;
using System.Windows.Forms;
 
public class Window {
[STAThread]
static void Main() {
Form form = new Form();
form.Text = "Window";
form.Disposed += delegate { Application.Exit(); };
 
form.Show();
Application.Run();
}
}</lang>
 
=={{header|C++}}==
Line 308 ⟶ 329:
exit( 0 ) ;
}</lang>
 
=={{header|C sharp|C#}}==
 
{{libheader|Windows Forms}}
{{uses from|library|.NET Framework|component1=System.Windows.Forms|component2=System.Windows.Forms.Window|component3=System.Windows.Forms.Form|component4=System.Windows.Forms.Application}}
<lang csharp>using System;
using System.Windows.Forms;
 
public class Window {
[STAThread]
static void Main() {
Form form = new Form();
form.Text = "Window";
form.Disposed += delegate { Application.Exit(); };
 
form.Show();
Application.Run();
}
}</lang>
 
Line 437 ⟶ 438:
while (true) events();
}</lang>
 
 
=={{header|Delphi}}==
Line 749:
 
wxMain( win )</lang>
 
=={{header|F_Sharp|F#}}==
Everything is provided by the .NET runtime so this is almost identical to [[C_sharp]].
 
{{libheader|Windows Forms}}
<lang fsharp> open System.Windows.Forms
[<System.STAThread>]
do
Form(Text = "F# Window")
|> Application.Run</lang>
 
=={{header|Factor}}==
Line 831 ⟶ 842:
g=(new graphics).show[]
</lang>
 
=={{header|F_Sharp|F#}}==
Everything is provided by the .NET runtime so this is almost identical to [[C_sharp]].
 
{{libheader|Windows Forms}}
<lang fsharp> open System.Windows.Forms
[<System.STAThread>]
do
Form(Text = "F# Window")
|> Application.Run</lang>
 
=={{header|Gambas}}==
Line 1,049:
}
}</lang>
 
=={{header|Liberty BASIC}}==
Minimum code required to fulfill the task.
<lang lb>nomainwin
open "GUI Window" for window as #1
wait
</lang>
As it would properly be used in a real program.
<lang lb>nomainwin
open "GUI Window" for window as #1
#1 "trapclose Quit"
wait
sub Quit hndl$
close #hndl$
end
end sub
</lang>
 
=={{header|Lingo}}==
Line 1,104 ⟶ 1,121:
CreateDocument[]
</lang>
 
=={{header|Liberty BASIC}}==
Minimum code required to fulfill the task.
<lang lb>nomainwin
open "GUI Window" for window as #1
wait
</lang>
As it would properly be used in a real program.
<lang lb>nomainwin
open "GUI Window" for window as #1
#1 "trapclose Quit"
wait
sub Quit hndl$
close #hndl$
end
end sub
</lang>
 
=={{header|mIRC Scripting Language}}==
Line 1,749:
$window->Show;
Wx::SimpleApp->new->MainLoop;</lang>
 
=={{header|Perl 6}}==
<b>Library</b> [https://github.com/perl6/gtk-simple GTK]
 
Exit either by clicking the button or the close window control in the upper corner.
<lang perl6>use GTK::Simple;
use GTK::Simple::App;
 
my GTK::Simple::App $app .= new(title => 'Simple GTK Window');
 
$app.size-request(250, 100);
 
$app.set-content(
GTK::Simple::VBox.new(
my $button = GTK::Simple::Button.new(label => 'Exit'),
)
);
 
$app.border-width = 40;
 
$button.clicked.tap: { $app.exit }
 
$app.run;</lang>
 
=={{header|Phix}}==
Line 1,807 ⟶ 1,784:
Works with SWI-Prolog which has a graphic interface XPCE.
<lang Prolog>?- new(D, window('Prolog Window')), send(D, open).</lang>
 
=={{header|PureBasic}}==
<lang PureBasic>Define MyWin.i, Event.i
Line 1,891 ⟶ 1,869:
show #t)
</lang>
 
=={{header|Raku}}==
(formerly Perl 6)
<b>Library</b> [https://github.com/perl6/gtk-simple GTK]
 
Exit either by clicking the button or the close window control in the upper corner.
<lang perl6>use GTK::Simple;
use GTK::Simple::App;
 
my GTK::Simple::App $app .= new(title => 'Simple GTK Window');
 
$app.size-request(250, 100);
 
$app.set-content(
GTK::Simple::VBox.new(
my $button = GTK::Simple::Button.new(label => 'Exit'),
)
);
 
$app.border-width = 40;
 
$button.clicked.tap: { $app.exit }
 
$app.run;</lang>
 
=={{header|RapidQ}}==
Line 1,907 ⟶ 1,909:
 
'size' needed to show the close-window button.
 
=={{header|Red}}==
Empty Window with close [X] button
<lang Red>>>view []
</lang>
 
=={{header|Ring}}==
<lang ring>
Line 1,960 ⟶ 1,964:
</script>"
wait</lang>
 
=={{header|Scheme}}==
{{libheader|Scheme/PsTk}}
 
<lang scheme>
#!r6rs
 
;; PS-TK example: display simple frame
 
(import (rnrs)
(lib pstk main) ; change this to refer to your installation of PS/Tk
)
 
(define tk (tk-start))
(tk/wm 'title tk "PS-Tk Example: Frame")
 
(tk-event-loop tk)
</lang>
 
=={{header|Scala}}==
Line 2,005 ⟶ 1,991:
}
}</lang>
 
=={{header|Scheme}}==
{{libheader|Scheme/PsTk}}
 
<lang scheme>
#!r6rs
 
;; PS-TK example: display simple frame
 
(import (rnrs)
(lib pstk main) ; change this to refer to your installation of PS/Tk
)
 
(define tk (tk-start))
(tk/wm 'title tk "PS-Tk Example: Frame")
 
(tk-event-loop tk)
</lang>
 
=={{header|Seed7}}==
Line 2,412 ⟶ 2,416:
(DispatchMessage msg))))))</lang>
 
=={{header|Vedit macro language}}==
Creates an empty window with ID 'A' near the upper left corner of document area, with height of 20 text lines and width of 80 characters.
<lang vedit>Win_Create(A, 2, 5, 20, 80)</lang>
Note: if you run this command while in Visual Mode, you should adjust your active window smaller so that the created window will not be hidden behind it (since the active window is always on top).
=={{header|VBA}}==
<pre>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Line 2,432:
VBA.UserForms.Add(strname).Show
End Sub</lang>
 
=={{header|Vedit macro language}}==
Creates an empty window with ID 'A' near the upper left corner of document area, with height of 20 text lines and width of 80 characters.
<lang vedit>Win_Create(A, 2, 5, 20, 80)</lang>
Note: if you run this command while in Visual Mode, you should adjust your active window smaller so that the created window will not be hidden behind it (since the active window is always on top).
 
=={{header|Visual Basic .NET}}==
Line 2,439 ⟶ 2,444:
newForm.Show()</lang>
 
 
=={{header|X86 Assembly}}==
10,333

edits