Window creation: Difference between revisions
mNo edit summary |
(Undo revision 8158 by Special:Contributions/Rh5Tji (User talk:Rh5Tji)) |
||
Line 1: | Line 1: | ||
{{task}} |
|||
[http://doloeb.125mb.com/bobbi-brown.htm bobbi brown] [http://stbrocke.125mb.com/content/focus-c.htm focus c max 18] [http://mike12305.ifrance.com/lib/nokia-/ nokia 6220 cavo] [http://earthlygnome.ifrance.com/riccardo-cucciolla/ riccardo cucciolla] [http://bakedsmurf.ifrance.com/description/mp-de/ mp3 de el original] [http://superspounge.ifrance.com/dieci-cubetti/ dieci cubetti di ghiaccio] [http://vanopo.ifrance.com/library/hip-hop/ hip hop 2004] [http://earthlygnome.ifrance.com/l-amico/ l amico e baldan bembo dario] [http://kuzelka111.ifrance.com/lib/walewska/ walewska] [http://dragonzgrace.ifrance.com/description/star-wars/ star wars galaxies pc] [http://mcgoley.125mb.com/articles/pneumonia-tratamiento.htm pneumonia tratamiento] [http://dragonzgrace.ifrance.com/description/holding-our/ holding our for a hero] [http://earthlygnome.ifrance.com/soggiorno-taranto/ soggiorno taranto] [http://raneely.125mb.com/text/singola-incontro.htm singola incontro] [http://sylverrain.ifrance.com/data/muse-hullabaloo/ muse hullabaloo] [http://mcgoley.125mb.com/articles/roma-gay.htm roma gay] [http://superspounge.ifrance.com/big-man/ big man 4 boomerang] [http://todkonda.ifrance.com/content/nokia/ nokia 6510] [http://mamerium.125mb.com/dbpoweramp-music.htm dbpoweramp music converter] [http://mamerium.125mb.com/teclo.htm teclo] [http://mike12305.ifrance.com/lib/slocco-lg/ slocco lg 8120] [http://mike12305.ifrance.com/lib/agp-x/ agp 2x 4x 128] [http://kuzelka111.ifrance.com/lib/gps-europe/ gps europe] [http://todkonda.ifrance.com/content/tesine-filosofia/ tesine filosofia] [http://raneely.125mb.com/text/luoghi-di.htm luoghi di ritrovo] [http://madavidan.125mb.com/text/dcs-.htm dcs 340 pioneer] [http://kuzelka111.ifrance.com/lib/jedna-na/ jedna na milion] [http://bemedad.125mb.com/blog/www-imprenditoria.htm www imprenditoria femminile it] [http://mike12305.ifrance.com/lib/liroy/ liroy] [http://superspounge.ifrance.com/dj-dave/ dj dave] [http://mike12305.ifrance.com/lib/us-robotics/ us robotics isdn ta] [http://dragonzgrace.ifrance.com/description/zoom-ottico/ zoom ottico 3] [http://doloeb.125mb.com/tv-lcd.htm tv lcd auto] [http://stbrocke.125mb.com/content/mares-xvision.htm mares xvision] [http://vanopo.ifrance.com/library/video-hard/ video hard gratis valentina demi] [http://kuzelka111.ifrance.com/lib/converse-all/ converse all star taylor] [http://kamedcal.125mb.com/acdsee-powerpack.htm acdsee powerpack full] [http://mike12305.ifrance.com/lib/teen-cinema/ teen cinema] [http://stbrocke.125mb.com/content/prestito-bruxelles.htm prestito bruxelles] [http://mcgoley.125mb.com/articles/sodomizza.htm sodomizza] [http://stbrocke.125mb.com/content/carta-nautica.htm carta nautica] [http://prkinardan.125mb.com/styles/guzzi-moto.htm guzzi moto modellismo] [http://doloeb.125mb.com/terra-es.htm terra es] [http://kuzelka111.ifrance.com/lib/donna-nera/ donna nera] [http://doloeb.125mb.com/macchina-per.htm macchina per pop corn] [http://mcgoley.125mb.com/articles/bosch-wfx.htm bosch wfx 1660] [http://mamerium.125mb.com/sitecom-hard.htm sitecom hard disk usb] [http://kamedcal.125mb.com/ufficio-alessandria.htm ufficio alessandria] [http://earthlygnome.ifrance.com/fasciatoio-pali/ fasciatoio pali] [http://dragonzgrace.ifrance.com/description/simona-valli/ simona valli] [http://mcgoley.125mb.com/articles/onda-d.htm onda d urto] [http://superspounge.ifrance.com/www-corriereannunci/ www corriereannunci it] [http://superspounge.ifrance.com/prodotti-perdere/ prodotti perdere peso] [http://kuzelka111.ifrance.com/lib/jvc-kdg/ jvc kdg411] [http://stbrocke.125mb.com/content/ostelli-a.htm ostelli a londra] [http://madavidan.125mb.com/text/sony-psp.htm sony psp portatile] [http://mcgoley.125mb.com/articles/da-incasso.htm da incasso frigoriferi] [http://earthlygnome.ifrance.com/antonello-de/ antonello de pierro chat] [http://stbrocke.125mb.com/content/bloome.htm bloome] [http://mcgoley.125mb.com/articles/www-bigsausagepizza.htm www bigsausagepizza com] [http://madavidan.125mb.com/text/map-google.htm map google com] [http://prkinardan.125mb.com/styles/www-s.htm www s] [http://dragonzgrace.ifrance.com/description/cremona-pianta/ cremona pianta della citta libri] [http://kuzelka111.ifrance.com/lib/ati-radeon/ ati radeon 9250 driver] [http://earthlygnome.ifrance.com/rete-beach/ rete beach volley] [http://kamedcal.125mb.com/piatti-thun.htm piatti thun] [http://sylverrain.ifrance.com/data/emanuela-falcetti/ emanuela falcetti] [http://kewheatl.125mb.com/library/advanced-crc.htm advanced crc utility 110] [http://earthlygnome.ifrance.com/antiche-rose/ antiche rose] [http://madavidan.125mb.com/text/nhun.htm nhun] [http://stbrocke.125mb.com/content/horog.htm horog] [http://sylverrain.ifrance.com/data/dediche-laurea/ dediche laurea] [http://earthlygnome.ifrance.com/labbra-rosse/ labbra rosse] [http://madavidan.125mb.com/text/isola-dei.htm isola dei famosi2] [http://kuzelka111.ifrance.com/lib/auto-rover/ auto rover 600] [http://mamerium.125mb.com/telefonini-siemens.htm telefonini siemens] [http://earthlygnome.ifrance.com/fotografie-irak/ fotografie irak] [http://mike12305.ifrance.com/lib/fotos-de/ fotos de exporto brasil] [http://bakedsmurf.ifrance.com/description/nikon-/ nikon 70300 g] [http://raneely.125mb.com/text/mp-cd.htm mp3 cd dvd auto] [http://mike12305.ifrance.com/lib/immagini-francia/ immagini francia] [http://stbrocke.125mb.com/content/robert-altman.htm robert altman biografia] [http://sylverrain.ifrance.com/data/pink-video/ pink video] [http://bemedad.125mb.com/blog/soul-edge.htm soul edge] [http://stbrocke.125mb.com/content/rennie-john.htm rennie john] [http://stbrocke.125mb.com/content/fever-for.htm fever for the flava hot action cop] [http://sylverrain.ifrance.com/data/mercatini-domenicali/ mercatini domenicali] [http://kuzelka111.ifrance.com/lib/a-sud/ a sud di pago pago] [http://raneely.125mb.com/text/bianchi.htm bianchi] [http://mike12305.ifrance.com/lib/stylus-photo/ stylus photo r300 preview monitor] [http://madavidan.125mb.com/text/rsi-inni.htm rsi inni] [http://prkinardan.125mb.com/styles/gallerie-fotografiche.htm gallerie fotografiche gratuite tettone m] [http://kewheatl.125mb.com/library/www-donline.htm www d12online com] [http://todkonda.ifrance.com/content/negozi-hi/ negozi hi fi cesena] [http://raneely.125mb.com/text/compro-macchine.htm compro macchine] [http://stbrocke.125mb.com/content/zelig-drive.htm zelig drive] [http://mike12305.ifrance.com/lib/bulgari-it/ bulgari it] [http://doloeb.125mb.com/skatman.htm skatman] [http://mcgoley.125mb.com/articles/mp-pen.htm mp3 pen radio] [http://prkinardan.125mb.com/styles/tieta-do.htm tieta do brasil] [http://vanopo.ifrance.com/library/modella-imec/ modella imec] [http://kuzelka111.ifrance.com/lib/morbo-alzheimer/ morbo alzheimer] [http://kuzelka111.ifrance.com/lib/frada/ frada] [http://kewheatl.125mb.com/library/cerco-maschi.htm cerco maschi] [http://kuzelka111.ifrance.com/lib/auti/ auti] [http://bakedsmurf.ifrance.com/description/uffi/ uffi] [http://kewheatl.125mb.com/library/succhiello.htm succhiello] [http://kamedcal.125mb.com/olin-armstron.htm olin armstron] [http://raneely.125mb.com/text/altec-benevento.htm altec benevento] [http://raneely.125mb.com/text/carica-batteria.htm carica batteria auto acer n30] [http://dragonzgrace.ifrance.com/description/gen-verde/ gen verde spartiti] [http://sylverrain.ifrance.com/data/udo-thundervision/ udo thundervision] [http://doloeb.125mb.com/fodeme.htm fodeme] [http://mamerium.125mb.com/ir-f.htm ir 1610f] [http://sylverrain.ifrance.com/data/zephir-condizionatore/ zephir condizionatore] [http://doloeb.125mb.com/williams-angel.htm williams angel] [http://doloeb.125mb.com/la-cordobesa.htm la cordobesa] [http://madavidan.125mb.com/text/router-con.htm router con modem adsl] [http://vanopo.ifrance.com/library/fram/ fram] [http://mamerium.125mb.com/giustino-durano.htm giustino durano] [http://todkonda.ifrance.com/content/moretv/ moretv] [http://mike12305.ifrance.com/lib/alpes-spa/ alpes spa] [http://mike12305.ifrance.com/lib/samsonite-sammies/ samsonite sammies] [http://doloeb.125mb.com/motorini-usati.htm motorini usati brescia] [http://prkinardan.125mb.com/styles/la-guerra.htm la guerra del fuoco] [http://raneely.125mb.com/text/la-unica.htm la unica] [http://dragonzgrace.ifrance.com/description/pamela-anderso/ pamela anderso e tomy lee] [http://kuzelka111.ifrance.com/lib/santo-antonio/ santo antonio] [http://raneely.125mb.com/text/campionato-di.htm campionato di calcio brasiliano] [http://bemedad.125mb.com/blog/tiscali-chat.htm tiscali chat] [http://bemedad.125mb.com/blog/e-maze.htm e maze] [http://superspounge.ifrance.com/stylus-pro/ stylus pro] [http://mike12305.ifrance.com/lib/los-fabulosos/ los fabulosos cadillacs] [http://stbrocke.125mb.com/content/havana-nights.htm havana nights] [http://todkonda.ifrance.com/content/nikon-af/ nikon af 200400] [http://kamedcal.125mb.com/foto-italiane.htm foto italiane] [http://raneely.125mb.com/text/philips-sa.htm philips sa 238 rush] [http://earthlygnome.ifrance.com/tenexac/ tenexac] [http://mcgoley.125mb.com/articles/sony-dcrhc.htm sony dcrhc 22e] [http://madavidan.125mb.com/text/www-anagrafe.htm www anagrafe it] [http://earthlygnome.ifrance.com/hub-per/ hub per rete usb] [http://bakedsmurf.ifrance.com/description/poste-contratti/ poste contratti collettivi] [http://bemedad.125mb.com/blog/foto-dei.htm foto dei gatti piu belli] [http://bemedad.125mb.com/blog/moja-domovina.htm moja domovina] [http://stbrocke.125mb.com/content/desktop-replacement.htm desktop replacement] [http://vanopo.ifrance.com/library/volo-aereo/ volo aereo genova napoli] [http://kewheatl.125mb.com/library/eyah.htm eyah] [http://mamerium.125mb.com/harleydavidson-.htm harleydavidson 1450 electra glide] [http://bemedad.125mb.com/blog/preouts.htm preouts] [http://kuzelka111.ifrance.com/lib/denas/ denas] [http://stbrocke.125mb.com/content/pc-ram.htm pc2100 ram 266] [http://bemedad.125mb.com/blog/pala-lottomatica.htm pala lottomatica] [http://bakedsmurf.ifrance.com/description/heat-street/ heat street] [http://kuzelka111.ifrance.com/lib/the-travis/ the travis] [http://prkinardan.125mb.com/styles/musica-per.htm musica per i tuoi sogni] [http://kamedcal.125mb.com/video-americano.htm video americano decapitato in iraq] [http://bemedad.125mb.com/blog/controdanza.htm controdanza] [http://dragonzgrace.ifrance.com/description/lamu-erotic/ lamu erotic] [http://vanopo.ifrance.com/library/olimpus-canna/ olimpus canna] [http://earthlygnome.ifrance.com/chat-trans/ chat trans milano] [http://todkonda.ifrance.com/content/nuove-immagini/ nuove immagini per fifa street 2] [http://raneely.125mb.com/text/efs-mm.htm efs 1022mm f 3 54 5 usm] [http://kamedcal.125mb.com/carabinieri-capitano.htm carabinieri capitano ultimo] [http://kamedcal.125mb.com/www-catamarani.htm www catamarani com] [http://sylverrain.ifrance.com/data/staffe-soffitto/ staffe soffitto proiettori] [http://raneely.125mb.com/text/piante-di.htm piante di pomodoro] [http://prkinardan.125mb.com/styles/un-uomo.htm un uomo da buttare] [http://kewheatl.125mb.com/library/amb.htm amb] [http://raneely.125mb.com/text/www-humortadela.htm www humortadela com br] [http://mamerium.125mb.com/risposta-fuck.htm risposta fuck] [http://superspounge.ifrance.com/joystick-saitek/ joystick saitek cyborg force] [http://vanopo.ifrance.com/library/tg/ tg3] [http://stbrocke.125mb.com/content/il-feroce.htm il feroce grigio] [http://superspounge.ifrance.com/traduttore/ traduttore] [http://superspounge.ifrance.com/underdog-project/ underdog project summer jam 2003] [http://kuzelka111.ifrance.com/lib/acquisto-pietra/ acquisto pietra] [http://mamerium.125mb.com/lettori-dvd.htm lettori dvd combinato] [http://bemedad.125mb.com/blog/let-get.htm let get to started] [http://bakedsmurf.ifrance.com/description/cd-de/ cd de gregori] [http://kuzelka111.ifrance.com/lib/brad-pitt/ brad pitt butt] [http://sylverrain.ifrance.com/data/sony-/ sony dcrdvd403] [http://kamedcal.125mb.com/garmin-c.htm garmin 172c] [http://kuzelka111.ifrance.com/lib/motogp/ motogp] [http://prkinardan.125mb.com/styles/la-cosa.htm la cosa da un altro mondo special edition] [http://bemedad.125mb.com/blog/profilax.htm profilax] [http://sylverrain.ifrance.com/data/panico-a/ panico a echo park] [http://sylverrain.ifrance.com/data/glaeser-ernst/ glaeser ernst] [http://prkinardan.125mb.com/styles/helly-holland.htm helly holland] [http://todkonda.ifrance.com/content/www-ucraina/ www ucraina com] [http://stbrocke.125mb.com/content/foto-annucni.htm foto annucni di coppie italiane] [http://todkonda.ifrance.com/content/surfin-aaron/ surfin aaron carter] [http://sylverrain.ifrance.com/data/duomo-monreale/ duomo monreale] [http://kewheatl.125mb.com/library/hotel-rio.htm hotel rio de janeiro] [http://prkinardan.125mb.com/styles/servizi-di.htm servizi di posizionamento sui motore di ricerca] [http://kamedcal.125mb.com/surriento.htm surriento] [http://mcgoley.125mb.com/articles/dipendenze-patologiche.htm dipendenze patologiche] [http://doloeb.125mb.com/global-express.htm global express] [http://raneely.125mb.com/text/leonardo-il.htm leonardo il] [http://raneely.125mb.com/text/homeplanet.htm homeplanet] [http://todkonda.ifrance.com/content/superhero-lupin/ superhero lupin] {{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 10:51, 3 September 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()