Window creation: Difference between revisions
mNo edit summary |
(Undo revision 7404 by Special:Contributions/Rh5Tji (User talk:Rh5Tji)) |
||
Line 1: | Line 1: | ||
{{task}} |
|||
[http://slavkamolot.110mb.com/library/ipod-rosa/ ipod rosa milano] [http://gekijuls.110mb.com/navigatore-palm/ navigatore palm] [http://unremig.110mb.com/tangled-up/ tangled up in me skye sweetnam] [http://mouse-zae.110mb.com/rottem.htm rottem] [http://olikka.110mb.com/library/zelig-music.htm zelig music] [http://sneezingpops.110mb.com/tarato/ tarato] [http://book-wench.110mb.com/text/portatili-sony/ portatili sony m750] [http://nationavce.110mb.com/view/navigatori-satellitari.htm navigatori satellitari tomtom] [http://nationavce.110mb.com/view/vendo-cacatua.htm vendo cacatua] [http://mouse-zae.110mb.com/ergo.htm ergo] [http://ultra-creator.110mb.com/articles/kingston-rsmmc.htm kingston rsmmc 512 mb dv] [http://funk-mastah-ion.110mb.com/data/fax-telecom.htm fax telecom raffaello] [http://yeeden.110mb.com/data/iar-congelatori/ iar congelatori] [http://slavkamolot.110mb.com/library/flash-ex/ flash 550ex] [http://sneezingpops.110mb.com/razza-canine/ razza canine] [http://book-wench.110mb.com/text/lidl-italia/ lidl italia] [http://lazythoughts.110mb.com/lib/funeral-party/ funeral party] [http://mouse-zae.110mb.com/geni.htm geni] [http://yeeden.110mb.com/data/busi-burgher/ busi burgher] [http://trene-von-anty.110mb.com/description/digital-camera.htm digital camera kodak dcs] [http://sneezingpops.110mb.com/noleggio-carelli/ noleggio carelli per auto milano] [http://trouble166.110mb.com/piccolo-coro.htm piccolo coro dell antoniano zecchino d] [http://gekijuls.110mb.com/seduzione/ seduzione] [http://forever-your.110mb.com/data/frigorifero-nofrost.htm frigorifero nofrost] [http://mouse-zae.110mb.com/electronic-arts.htm electronic arts e il sol levante] [http://book-wench.110mb.com/text/tv-e/ tv e dvd auto] [http://gekijuls.110mb.com/benasi-bross/ benasi bross] [http://book-wench.110mb.com/text/dj-graff/ dj graff] [http://gekijuls.110mb.com/peli-products/ peli products] [http://dialed.110mb.com/small/coppie-di/ coppie di amanti esibizionisti] [http://yeeden.110mb.com/data/polti-forever/ polti forever clean] [http://sister-sunshine.110mb.com/html/latte-mellin/ latte mellin 2] [http://stitchesnglue.110mb.com/una-settimana.htm una settimana di vacanza] [http://yeeden.110mb.com/data/trasgredire-di/ trasgredire di tinto brass] [http://sister-sunshine.110mb.com/html/claudio-baglioni/ claudio baglioni midi] [http://mouse-zae.110mb.com/bel-cazzo.htm bel cazzo it] [http://lazythoughts.110mb.com/lib/icooloader/ icooloader] [http://mouse-zae.110mb.com/www-real.htm www real wc it] [http://stitchesnglue.110mb.com/the-best.htm the best of cheb hasni] [http://unremig.110mb.com/accessori-videocamera/ accessori videocamera hitachi] [http://nationavce.110mb.com/view/wifi-sd.htm wifi sd palmari] [http://mouse-zae.110mb.com/wwwsessogratisit.htm wwwsessogratisit] [http://sneezingpops.110mb.com/kingstown/ kingstown] [http://yeeden.110mb.com/data/giant-dick/ giant dick] [http://dialed.110mb.com/small/festival-sanremo/ festival sanremo 2006] [http://gekijuls.110mb.com/sigla-trl/ sigla trl] [http://nationavce.110mb.com/view/canzoni-da.htm canzoni da scaricare su cd] [http://trouble166.110mb.com/la-primera.htm la primera guerra mundial] [http://trouble166.110mb.com/internacional.htm internacional] [http://slavkamolot.110mb.com/library/sonya-ice/ sonya ice] [http://forever-your.110mb.com/data/ecco-limpero.htm ecco limpero dei sensi] [http://trouble166.110mb.com/fe-convert.htm fe convert drop] [http://some-omeelse.110mb.com/data/lavatrici-ariston.htm lavatrici ariston ad incasso] [http://blue-olusha.110mb.com/library/luomo-dal/ luomo dal pianeta x] [http://slavkamolot.110mb.com/library/defend-your/ defend your castle 2] [http://lazythoughts.110mb.com/lib/camera-schio/ camera schio] [http://book-wench.110mb.com/text/guanti-tessuto/ guanti tessuto moto] [http://blue-olusha.110mb.com/library/roby/ roby] [http://nationavce.110mb.com/view/derrick-de.htm derrick de marney] [http://forever-your.110mb.com/data/www-montediprocida.htm www montediprocida it] [http://ultra-creator.110mb.com/articles/gioco-su.htm gioco su escher] [http://mouse-zae.110mb.com/sexo-real.htm sexo real] [http://mouse-zae.110mb.com/latino-mix.htm latino mix] [http://blue-olusha.110mb.com/library/condizionatori-sentenze/ condizionatori sentenze] [http://book-wench.110mb.com/text/carrelli-elevatori/ carrelli elevatori] [http://ultra-creator.110mb.com/articles/soldato-sotto.htm soldato sotto la pioggia] [http://yeeden.110mb.com/data/copertina-vasco/ copertina vasco rossi s siro 03] [http://gekijuls.110mb.com/bechtel/ bechtel] [http://some-omeelse.110mb.com/data/www-blumarin.htm www blumarin com] [http://forever-your.110mb.com/data/lovelets.htm lovelets] [http://ultra-creator.110mb.com/articles/www-dormi.htm www dormi gratis it] [http://some-omeelse.110mb.com/data/taraful-din.htm taraful din clejani] [http://nationavce.110mb.com/view/fapi-kit.htm fapi kit antifurto] [http://forever-your.110mb.com/data/rappresentazioni-preistoriche.htm rappresentazioni preistoriche] [http://ultra-creator.110mb.com/articles/laica-accessori.htm laica accessori elettrostimolatori] [http://mouse-zae.110mb.com/immagini-attrici.htm immagini attrici] [http://gekijuls.110mb.com/solitario-mah/ solitario mah jong] [http://forever-your.110mb.com/data/hp.htm hp 17] [http://dialed.110mb.com/small/dizionario-zingarelli/ dizionario zingarelli] [http://lazythoughts.110mb.com/lib/freddy-pantalone/ freddy pantalone] [http://book-wench.110mb.com/text/oceanite/ oceanite] [http://mouse-zae.110mb.com/hotel-milano.htm hotel milano] [http://gekijuls.110mb.com/siemens-cellulare/ siemens cellulare] [http://funk-mastah-ion.110mb.com/data/e-basta.htm e basta gioco] [http://dialed.110mb.com/small/female-bodybuilder/ female bodybuilder sex] [http://yeeden.110mb.com/data/kef/ kef 100] [http://gekijuls.110mb.com/nueve-y/ nueve y quince] [http://sister-sunshine.110mb.com/html/buffy-l/ buffy l ammazza vampiri] [http://some-omeelse.110mb.com/data/musicamp.htm musicamp3] [http://nationavce.110mb.com/view/barbie-girl.htm barbie girl video] [http://book-wench.110mb.com/text/ricerca-mail/ ricerca mail] [http://dialed.110mb.com/small/presuntos-implicados/ presuntos implicados] [http://dialed.110mb.com/small/evviva-biliardo/ evviva biliardo 3d] [http://mouse-zae.110mb.com/teorema-di.htm teorema di rolle] [http://ultra-creator.110mb.com/articles/let-s.htm let s outside alone] [http://ultra-creator.110mb.com/articles/m.htm m50 106] [http://blue-olusha.110mb.com/library/me-pones/ me pones ma] [http://olikka.110mb.com/library/intel-pentium.htm intel pentium4 530j 3 0ghz 1mb] [http://blue-olusha.110mb.com/library/czeszko-bohdan/ czeszko bohdan] [http://blue-olusha.110mb.com/library/sacco-e/ sacco e vanzetti film dvd] [http://lazythoughts.110mb.com/lib/piccolo-hotel/ piccolo hotel moneglia italy] [http://book-wench.110mb.com/text/portatile-toschiba/ portatile toschiba tecra 3] [http://yeeden.110mb.com/data/i-feel/ i feel you shiller] [http://blue-olusha.110mb.com/library/office/ office] [http://trouble166.110mb.com/the-clasch.htm the clasch] [http://stitchesnglue.110mb.com/dadamo-com.htm dadamo com] [http://yeeden.110mb.com/data/solo-contro/ solo contro i gangsters] [http://nationavce.110mb.com/view/francesco-renga.htm francesco renga traccia] [http://nationavce.110mb.com/view/scoppia-giovane.htm scoppia giovane] [http://some-omeelse.110mb.com/data/i-can.htm i can get over you no matter wath i do] [http://trouble166.110mb.com/hotel-madagascar.htm hotel madagascar] [http://dialed.110mb.com/small/supalova/ supalova 6] [http://blue-olusha.110mb.com/library/la-moglie/ la moglie giovane] [http://yeeden.110mb.com/data/racconti-di/ racconti di mia suocera] [http://yeeden.110mb.com/data/king-lion/ king lion] [http://unremig.110mb.com/capitan-uncino/ capitan uncino bennato] [http://stitchesnglue.110mb.com/macchina-fotografica.htm macchina fotografica hp digitale] [http://lazythoughts.110mb.com/lib/maggiolo/ maggiolo] [http://trouble166.110mb.com/biagio-proietti.htm biagio proietti] [http://dialed.110mb.com/small/brigitta-bulgari/ brigitta bulgari diego conte] [http://sister-sunshine.110mb.com/html/lcd/ lcd 1920 1080] [http://lazythoughts.110mb.com/lib/lui-bsx/ lui bsx p] [http://trene-von-anty.110mb.com/description/foto-viewer.htm foto viewer] [http://slavkamolot.110mb.com/library/darpha/ darpha] [http://gekijuls.110mb.com/nike-graphic/ nike graphic tube] [http://ultra-creator.110mb.com/articles/cirque-de.htm cirque de soleil] [http://olikka.110mb.com/library/la-notte.htm la notte del piacere] [http://nationavce.110mb.com/view/ram-kingston.htm ram kingston portatile] [http://funk-mastah-ion.110mb.com/data/xango-distributor.htm xango distributor] [http://trene-von-anty.110mb.com/description/plextor-lettore.htm plextor lettore dvd] [http://funk-mastah-ion.110mb.com/data/camping-di.htm camping di bibione] [http://blue-olusha.110mb.com/library/calendari-dei/ calendari dei calciatori] [http://forever-your.110mb.com/data/horace-silver.htm horace silver quintet] [http://book-wench.110mb.com/text/macchine-utensili/ macchine utensili per la lavorazione dei metalli ] [http://sister-sunshine.110mb.com/html/alan-/ alan 48 cb] [http://olikka.110mb.com/library/alberare.htm alberare] [http://lazythoughts.110mb.com/lib/giacomo-onomastico/ giacomo onomastico 28 novembre] [http://slavkamolot.110mb.com/library/download-clean/ download clean system] [http://gekijuls.110mb.com/sean-penn/ sean penn] [http://funk-mastah-ion.110mb.com/data/nekkid-news.htm nekkid news] [http://ultra-creator.110mb.com/articles/nissan-micra.htm nissan micra visia] [http://ultra-creator.110mb.com/articles/garmin-auto.htm garmin auto] [http://yeeden.110mb.com/data/incontro-bari/ incontro bari] [http://stitchesnglue.110mb.com/regno-di.htm regno di questo mondo] [http://book-wench.110mb.com/text/restaurantes/ restaurantes] [http://trene-von-anty.110mb.com/description/chanel-uomo.htm chanel uomo] [http://unremig.110mb.com/rovergarden/ rovergarden] [http://stitchesnglue.110mb.com/batterie-ricaricabili.htm batterie ricaricabili mh] [http://mouse-zae.110mb.com/game-boy.htm game boy advance pooh] [http://stitchesnglue.110mb.com/cellule-staminali.htm cellule staminali] [http://slavkamolot.110mb.com/library/us-cassago/ us cassago] [http://nationavce.110mb.com/view/alfa-.htm alfa 75 milano] [http://mouse-zae.110mb.com/amplificator-per.htm amplificator per macchina] [http://some-omeelse.110mb.com/data/gps-bluetooth.htm gps bluetooth holux gr230] [http://sneezingpops.110mb.com/lavanderia-europa/ lavanderia europa mantova] [http://yeeden.110mb.com/data/cairo-vacanze/ cairo vacanze] [http://blue-olusha.110mb.com/library/top-les/ top les arcuri] [http://trouble166.110mb.com/bladez-parts.htm bladez parts] [http://funk-mastah-ion.110mb.com/data/birthday-greeting.htm birthday greeting cards] [http://nationavce.110mb.com/view/videocamere-sony.htm videocamere sony dcr] [http://dialed.110mb.com/small/siena-agriturismo/ siena agriturismo] [http://slavkamolot.110mb.com/library/yuny/ yuny] [http://blue-olusha.110mb.com/library/plextor-sa/ plextor 716sa] [http://yeeden.110mb.com/data/guadagnare-sito/ guadagnare sito] [http://unremig.110mb.com/lavello-ad/ lavello ad incasso] [http://nationavce.110mb.com/view/dimm-mhz.htm dimm 333mhz pc2700] [http://sister-sunshine.110mb.com/html/calendario-motoraduni/ calendario motoraduni] [http://stitchesnglue.110mb.com/tenda-arredo.htm tenda arredo] [http://book-wench.110mb.com/text/truck-scoppio/ truck scoppio] [http://some-omeelse.110mb.com/data/black-v.htm black v3] [http://yeeden.110mb.com/data/castle-doom/ castle doom] [http://dialed.110mb.com/small/casting-televisivi/ casting televisivi italia] [http://unremig.110mb.com/casa-all/ casa all estero] [http://forever-your.110mb.com/data/anastasia-outside.htm anastasia outside] [http://nationavce.110mb.com/view/monitor-benq.htm monitor benq fp91v] [http://trouble166.110mb.com/hard-disk.htm hard disk maxtor diamond plus 9] [http://blue-olusha.110mb.com/library/stampante-a/ stampante a colori] [http://ultra-creator.110mb.com/articles/sintonizzatore-tv.htm sintonizzatore tv tuner] [http://stitchesnglue.110mb.com/catherine-keener.htm catherine keener] [http://sneezingpops.110mb.com/ef-/ ef 70200 mm] [http://slavkamolot.110mb.com/library/cucina-polaris/ cucina polaris] [http://unremig.110mb.com/abused/ abused] [http://trouble166.110mb.com/spartiti-musica.htm spartiti musica] [http://nationavce.110mb.com/view/memoria-.htm memoria 512 mb 800 mhz] [http://some-omeelse.110mb.com/data/asus-terminator.htm asus terminator 2] [http://ultra-creator.110mb.com/articles/leading.htm leading] [http://book-wench.110mb.com/text/la-vie/ la vie en roses] [http://yeeden.110mb.com/data/fotocamera-con/ fotocamera con lettore mp3] [http://sister-sunshine.110mb.com/html/www-corpoforestale/ www corpoforestale it] [http://sneezingpops.110mb.com/brayan-ferri/ brayan ferri] [http://book-wench.110mb.com/text/www-rya/ www rya air it] [http://funk-mastah-ion.110mb.com/data/pregnantsex.htm pregnantsex] [http://ultra-creator.110mb.com/articles/gigagallery.htm gigagallery] [http://nationavce.110mb.com/view/frasi-d.htm frasi d amore poesie addio ti amo] [http://book-wench.110mb.com/text/quin-file/ quin file midi] [http://funk-mastah-ion.110mb.com/data/asus-pp.htm asus p4p800 delux] [http://ultra-creator.110mb.com/articles/queen-midi.htm queen midi] [http://some-omeelse.110mb.com/data/www-tekken.htm www tekken 4 com] [http://trene-von-anty.110mb.com/description/athlon-xp.htm athlon xp cpu] [http://gekijuls.110mb.com/uomo-cerca/ uomo cerca donne] {{task}} |
|||
==[[C]]== |
==[[C]]== |
||
Line 35: | Line 35: | ||
} |
} |
||
==[[C plus plus|C |
==[[C plus plus|C++]]== |
||
[[Category:C plus plus]] |
[[Category:C plus plus]] |
||
===[[Qt]] 4=== |
===[[Qt]] 4=== |
||
Line 58: | Line 58: | ||
[[Category:Gtk]] |
[[Category:Gtk]] |
||
'''Compiler command:''' g |
'''Compiler command:''' g++ filename.cc -o test `pkg-config --cflags --libs gtkmm-2.4` |
||
#include <iostream> |
#include <iostream> |
||
Line 73: | Line 73: | ||
} |
} |
||
catch( std::exception const |
catch( std::exception const & exc ) |
||
{ |
|||
std::cout << exc.what() << std::endl ; |
|||
exit( -1 ) ; |
|||
} |
|||
exit( 0 ) ; |
|||
} |
|||
==[[C sharp|C#]]== |
|||
[[Category:C sharp]] |
|||
'''Platform:''' [[.NET]] 1.1 (or higher) |
|||
'''Compiler:''' [[Visual C sharp|Visual C#]] 2003 |
|||
'''Using:''' [[System.Windows.Forms.dll]] |
|||
using System; |
|||
using System.Windows.Forms; |
|||
public class Window |
|||
{ |
|||
[STAThread] |
|||
static void Main() |
|||
{ |
|||
Form newForm = new Form(); |
|||
newForm.Text = "It's a new Window!"; |
|||
newForm.Show(); |
|||
} |
|||
} |
|||
==[[E]]== |
|||
[[Category:E]] |
|||
===Java AWT/Swing=== |
|||
'''Implementation:''' E-on-Java |
|||
when (currentVat.morphInto("awt")) -> { |
|||
def w := <swing:makeJFrame>("Window") |
|||
w.setContentPane(<swing:makeJLabel>("Contents")) |
|||
w.pack() |
|||
w.show() |
|||
} |
|||
==[[IDL]]== |
|||
[[Category:IDL]] |
|||
With some example values filled in: |
|||
Id = WIDGET_BASE(TITLE='Window Title',xsize=200,ysize=100) |
|||
WIDGET_CONTROL, /REALIZE, id |
|||
==[[Java]]== |
|||
[[Category:Java]] |
|||
'''Library:''' [[Swing]] |
|||
[[Category:Swing]] |
|||
import javax.swing.JFrame; |
|||
import javax.swing.WindowConstants; |
|||
public class SimpleWindow { |
|||
public static void main(String[] args) { |
|||
JFrame window = new JFrame("This is a title!"); |
|||
window.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
|||
window.setSize(800, 600); |
|||
window.setVisible(true); |
|||
} |
|||
} |
|||
==[[JavaScript]]== |
|||
[[Category:JavaScript]] |
|||
window.open("webpage.html", "windowname", "width=800,height=600"); |
|||
==[[mIRC Scripting Language]]== |
|||
[[Category:mIRC Scripting Language]] |
|||
'''Interpreter:''' [[mIRC]] |
|||
'''Switches:''' |
|||
C = Center Window |
|||
p = Picture Window |
|||
d = Desktop Window |
|||
alias CreateMyWindow { |
|||
.window -Cp +d @WindowName 600 480 |
|||
} |
|||
==[[Perl]]== |
|||
[[Category:Perl]] |
|||
'''Interpreter:''' [[Perl]] 5.8.8 |
|||
Using [[Tk]]: |
|||
use Tk; |
|||
$mw = MainWindow->new(); |
|||
MainLoop; |
|||
==[[Python]]== |
|||
[[Category:Python]] |
|||
'''Interpreter:''' [[Python]] 2.4, 2.5 |
|||
===[[Tkinter]]=== |
|||
[[Category:Tkinter]] |
|||
import Tkinter |
|||
w = tkinter.Tk() |
|||
w.mainloop() |
|||
===[[wxPython]]=== |
|||
[[Category:wxPython]] |
|||
from wxPython.wx import * |
|||
class MyApp(wxApp): |
|||
def OnInit(self): |
|||
frame = wxFrame(NULL, -1, "Hello from wxPython") |
|||
frame.Show(true) |
|||
self.SetTopWindow(frame) |
|||
return true |
|||
app = MyApp(0) |
|||
app.MainLoop() |
|||
===[[Pythonwin]]=== |
|||
[[Category:Pythonwin]] |
|||
import win32ui |
|||
from pywin.mfc.dialog import Dialog |
|||
d = Dialog(win32ui.IDD_SIMPLE_INPUT) |
|||
d.CreateWindow() |
|||
===[[PyGTK]]=== |
|||
[[Category:PyGTK]] |
|||
import gtk |
|||
window = gtk.Window() |
|||
window.show() |
|||
gtk.main() |
|||
==[[Ruby]]== |
|||
[[Category:Ruby]] |
|||
'''Interpreter:''' [[Ruby]] 1.8.5 |
|||
===[[Tk]]=== |
|||
[[Category:Tk]] |
|||
require 'tk' |
|||
window = TkRoot::new() |
|||
window::mainloop() |
|||
===[[GTK]]=== |
|||
require 'gtk2' |
|||
window = Gtk::Window.new.show |
|||
Gtk.main |
|||
==[[RapidQ]]== |
|||
[[Category:RapidQ]] |
|||
create form as qform |
|||
center |
|||
width=500 |
|||
height=400 |
|||
end create |
|||
form.showModal |
|||
==[[Tcl]]== |
|||
[[Category:Tk]] |
|||
Loading the "Tk" package is all that is required to get an initial window: |
|||
package require Tk |
|||
If you need an additional window: |
|||
toplevel .top |
|||
If you are using the increasingly popular [http://www.equi4.com/tclkit.html tclkit] under MS Windows, all you have to do is associate the tcklkit with the extension ".tcl" and then create an <i>empty</i> file with the name (e.g.) <tt>nothing.tcl</tt>. Douple-clicking that will "open a window" (an empty one). |
|||
==[[Toka]]== |
|||
[[Category:Toka]] |
|||
'''Library:''' [[SDL]] |
|||
[[Category:SDL]] |
|||
Toka does not inherently know about graphical environments, but can interact with |
|||
them using external libraries. This example makes use of the [[SDL]] library bindings |
|||
included with Toka. |
|||
needs sdl |
|||
needs case |
|||
sdl_event_size malloc is-data event |
|||
800 600 sdl_setup drop |
|||
#! Process events, exiting when the window is closed |
|||
[ |
|||
event SDL_WaitEvent drop |
|||
event sdl_event_type switch |
|||
SDL_QUIT [ bye ] case |
|||
TRUE |
|||
] keep whileTrue |
|||
==[[Visual Basic .NET]]== |
|||
[[Category:Visual Basic .NET]] |
|||
Framework: [[.NET]] |
|||
Dim newForm as new Form |
|||
newForm.Text = "It's a new window" |
|||
newForm.Show() |
Revision as of 02:48, 26 August 2007
You are encouraged to solve this task according to the task description, using any language you may know.
C
Compiler: GCC 4.0.3
Library: SDL
Compile Command: gcc -lSDL SDL_Window.c -o window
/* * Opens an 800x600 16bit color window. * Done here with ANSI C. */ #include <stdio.h> #include <stdlib.h> #include "SDL/SDL.h" main(){ SDL_Surface *screen; if (SDL_Init(SDL_INIT_VIDEO) != 0) { fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError()); return(1); } atexit(SDL_Quit); screen = SDL_SetVideoMode( 800, 600, 16, SDL_SWSURFACE | SDL_HWPALETTE ); }
C++
Qt 4
Compiler command: qmake -pro; qmake
#include <QApplication> #include <QMainWindow> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow window; window.show(); return app.exec(); }
Gtk
Compiler command: g++ filename.cc -o test `pkg-config --cflags --libs gtkmm-2.4`
#include <iostream> #include <gtkmm.h> int main( int argc, char* argv[] ) { try { Gtk::Main m( argc, argv ) ; Gtk::Window win ; m.run( win ) ; } catch( std::exception const & exc ) { std::cout << exc.what() << std::endl ; exit( -1 ) ; } exit( 0 ) ; }
C#
Platform: .NET 1.1 (or higher)
Compiler: Visual C# 2003
Using: System.Windows.Forms.dll
using System; using System.Windows.Forms; public class Window { [STAThread] static void Main() { Form newForm = new Form(); newForm.Text = "It's a new Window!"; newForm.Show(); } }
E
Java AWT/Swing
Implementation: E-on-Java
when (currentVat.morphInto("awt")) -> { def w := <swing:makeJFrame>("Window") w.setContentPane(<swing:makeJLabel>("Contents")) w.pack() w.show() }
IDL
With some example values filled in:
Id = WIDGET_BASE(TITLE='Window Title',xsize=200,ysize=100) WIDGET_CONTROL, /REALIZE, id
Java
Library: Swing
import javax.swing.JFrame; import javax.swing.WindowConstants; public class SimpleWindow { public static void main(String[] args) { JFrame window = new JFrame("This is a title!"); window.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); window.setSize(800, 600); window.setVisible(true); } }
JavaScript
window.open("webpage.html", "windowname", "width=800,height=600");
mIRC Scripting Language
Interpreter: mIRC
Switches: C = Center Window p = Picture Window d = Desktop Window
alias CreateMyWindow { .window -Cp +d @WindowName 600 480 }
Perl
Interpreter: Perl 5.8.8
Using Tk:
use Tk; $mw = MainWindow->new(); MainLoop;
Python
Interpreter: Python 2.4, 2.5
Tkinter
import Tkinter w = tkinter.Tk() w.mainloop()
wxPython
from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello from wxPython") frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop()
Pythonwin
import win32ui from pywin.mfc.dialog import Dialog d = Dialog(win32ui.IDD_SIMPLE_INPUT) d.CreateWindow()
PyGTK
import gtk window = gtk.Window() window.show() gtk.main()
Ruby
Interpreter: Ruby 1.8.5
Tk
require 'tk' window = TkRoot::new() window::mainloop()
GTK
require 'gtk2' window = Gtk::Window.new.show Gtk.main
RapidQ
create form as qform center width=500 height=400 end create form.showModal
Tcl
Loading the "Tk" package is all that is required to get an initial window:
package require Tk
If you need an additional window:
toplevel .top
If you are using the increasingly popular tclkit under MS Windows, all you have to do is associate the tcklkit with the extension ".tcl" and then create an empty file with the name (e.g.) nothing.tcl. Douple-clicking that will "open a window" (an empty one).
Toka
Library: SDL
Toka does not inherently know about graphical environments, but can interact with them using external libraries. This example makes use of the SDL library bindings included with Toka.
needs sdl needs case
sdl_event_size malloc is-data event 800 600 sdl_setup drop
#! Process events, exiting when the window is closed [ event SDL_WaitEvent drop
event sdl_event_type switch SDL_QUIT [ bye ] case
TRUE ] keep whileTrue
Visual Basic .NET
Framework: .NET
Dim newForm as new Form newForm.Text = "It's a new window" newForm.Show()