Window creation: Difference between revisions
mNo edit summary |
(revert spam) |
||
Line 1: | Line 1: | ||
{{task}} |
|||
[http://dj-deus.somee.com/lib/epson-s.htm epson s3] [http://rimarsh.t35.com/images/small/stupendo.htm stupendo] [http://itgurney.t35.com/view/new/finanziamento-lione/ finanziamento lione] [http://jututor.125mb.com/lib/midnight-club/ midnight club 3 filmato su psp] [http://peter-land.somee.com/images/small/finanziamenti-golf.htm finanziamenti golf plus] [http://flheddina.t35.com/web/scrutatori/ scrutatori] [http://fergus-mac.somee.com/description/lib/sale/ sale] [http://davelovesyou.somee.com/library/html/j-loe/ j loe com] [http://ouquaite.freeweb7.com/img/styles/pavese/ pavese] [http://dj-deus.somee.com/lib/materiale-didattico.htm materiale didattico] [http://itgurney.t35.com/view/new/tutto-fica/ tutto fica] [http://trocterli.t35.com/img/styles/stefano-accorsi/ stefano accorsi nudo] [http://coarmago.freeweb7.com/library/html/yngwie-malmsteen.htm yngwie malmsteen] [http://lensman.somee.com/html/le-vent/ le vent nous portera noir desire] [http://de-der.somee.com/library/html/mazar-wa.htm mazar wa] [http://coarmago.freeweb7.com/library/html/love-song.htm love song x treme] [http://ouquaite.freeweb7.com/img/styles/estremo-nord/ estremo nord] [http://flheddina.t35.com/web/olympus-custodia/ olympus custodia subacquea] [http://brrezab.freeweb7.com/img/styles/fiat-punto.htm fiat punto 1 4 16v 5] [http://lensman.somee.com/html/piovigginare/ piovigginare] [http://lensman.somee.com/html/giochi-su/ giochi su morti viventi] [http://jututor.125mb.com/lib/db-boulevar/ db boulevar] [http://nationavce.somee.com/library/html/gli-uomini/ gli uomini della mia vita] [http://dj-deus.somee.com/lib/donadoni.htm donadoni] [http://luallard.t35.com/html/exilim-ex/ exilim ex z57 casio] [http://madavid.t35.com/html/kurt-ulander/ kurt ulander] [http://jututor.125mb.com/lib/immagini-di/ immagini di coca] [http://yourorus.somee.com/data/le-tentazioni.htm le tentazioni del signor smith] [http://trocterli.t35.com/img/styles/concord-el/ concord el salam sharm el sheik] [http://betheresa.t35.com/text/directory/plasma-tv/ plasma tv panasonic 42] [http://fawarfo.freeweb7.com/topic/sbloccare-un.htm sbloccare un cellulare] [http://nairoz.somee.com/img/styles/kleinia/ kleinia] [http://trocterli.t35.com/img/styles/pubblicita-bimbi/ pubblicita bimbi] [http://lamcgie.125mb.com/html/mono-amplificatore.htm mono amplificatore amplificatori] [http://am-i-bird.somee.com/img/styles/the-hard.htm the hard word. lultimo colpo] [http://flheddina.t35.com/web/i-nuovi/ i nuovi batman nel dettaglio] [http://coarmago.freeweb7.com/library/html/time-is.htm time is running out muse] [http://rimarsh.t35.com/images/small/hotel-paleokastritsa.htm hotel paleokastritsa] [http://peter-land.somee.com/images/small/modelle-nudo.htm modelle nudo] [http://madavid.t35.com/html/ki-cellulari/ k700i cellulari sony ericsson] [http://itgurney.t35.com/view/new/monitor-gnr/ monitor gnr] [http://am-i-bird.somee.com/img/styles/diego-maradona.htm diego maradona] [http://madavid.t35.com/html/peugeot-/ peugeot 206 van] [http://jututor.125mb.com/lib/suzuki-vitara/ suzuki vitara hdi] [http://madavid.t35.com/html/redazione-amici/ redazione amici] [http://ouquaite.freeweb7.com/img/styles/camino-caminetto/ camino caminetto] [http://lamcgie.t35.com/web/scherzi-per.htm scherzi per matrimonio] [http://coarmago.freeweb7.com/library/html/audio-hub.htm audio hub accessori video] [http://ouquaite.freeweb7.com/img/styles/lacie-esterno/ lacie esterno] [http://madavid.t35.com/html/marana-simhasanam/ marana simhasanam] [http://lakitsmi.freeweb7.com/web/bob-berg/ bob berg] [http://flheddina.t35.com/web/canon-b/ canon b160] [http://itgurney.t35.com/view/new/pc-autoparlanti/ pc autoparlanti] [http://lamcgie.125mb.com/html/catalogo-cucine.htm catalogo cucine] [http://lamcgie.125mb.com/html/manchester-shopping.htm manchester shopping] [http://coarmago.freeweb7.com/library/html/goldberg-aria.htm goldberg aria] [http://thegoogly.somee.com/view/new/led-rosso.htm led rosso] [http://nairoz.somee.com/img/styles/sonia/ sonia] [http://kiboukni.125mb.com/web/pdiddy/ pdiddy] [http://lamcgie.125mb.com/html/le-origini.htm le origini di roma] [http://fergus-mac.somee.com/description/lib/let-the/ let the] [http://nationavce.somee.com/library/html/frigoriferi-da/ frigoriferi da incassare] [http://betheresa.t35.com/text/directory/vasco-rossi/ vasco rossi siamo solo noi] [http://jututor.125mb.com/lib/modem-adsl/ modem adsl robotics] [http://luallard.t35.com/html/pc-memoria/ pc-133 memoria ram] [http://viemalin.freeweb7.com/resources/articles/www-pasion.htm www pasion de gabilanes com] [http://ouquaite.freeweb7.com/img/styles/machine-usate/ machine usate] [http://peter-land.somee.com/images/small/nessuna.htm nessuna] [http://yourorus.somee.com/data/gps-ff.htm gps ff80] [http://rimarsh.t35.com/images/small/micheletto.htm micheletto] [http://nationavce.somee.com/library/html/oblo-sport/ oblo sport e fitness] [http://jedillar.125mb.com/resources/articles/aerre-optical/ aerre optical] [http://thegoogly.somee.com/view/new/bagno-prefabbricato.htm bagno prefabbricato] [http://jedillar.125mb.com/resources/articles/hard-disk/ hard disk lettore mmc] [http://kiboukni.125mb.com/web/zingar/ zingar] [http://jututor.125mb.com/lib/creme-corpo/ creme corpo uomo] [http://viemalin.freeweb7.com/resources/articles/laria-del.htm laria del continente] [http://nationavce.somee.com/library/html/lalto-prezzo/ lalto prezzo dellamore] [http://kiboukni.125mb.com/web/la-via/ la via dei giganti] [http://dj-deus.somee.com/lib/tv-hd.htm tv hd ready] [http://viemalin.freeweb7.com/resources/articles/asus-xse.htm asus x300se] [http://dabeutle.t35.com/content/view/reclami-lettere.htm reclami lettere] [http://lensman.somee.com/html/messo-notificatore/ messo notificatore] [http://lamcgie.125mb.com/html/sharp-ar.htm sharp ar 450] [http://rimarsh.t35.com/images/small/storie-sugli.htm storie sugli animali] [http://itgurney.t35.com/view/new/pentax-ist/ pentax ist ds] [http://nationavce.somee.com/library/html/www-cargo/ www cargo fr] [http://quotes-girl.somee.com/content/view/iwaki/ iwaki] [http://itgurney.t35.com/view/new/superstar-ii/ superstar ii adidas] [http://brrezab.freeweb7.com/img/styles/sesso-grandefratello.htm sesso grandefratello tedesco] [http://rihelm.125mb.com/img/styles/soundtrack-cindy/ soundtrack cindy goonies] [http://rihelm.125mb.com/img/styles/graduatorie-permanenti/ graduatorie permanenti provincia di sira] [http://am-i-bird.somee.com/img/styles/enigma-midi.htm enigma midi] [http://flheddina.t35.com/web/immagini-londra/ immagini londra] [http://viemalin.freeweb7.com/resources/articles/software-call.htm software call center] [http://dj-deus.somee.com/lib/marciume.htm marciume] [http://madavid.t35.com/html/noi-tireremo/ noi tireremo diritto] [http://dabeutle.t35.com/content/view/simson-x.htm simson x] [http://nationavce.somee.com/library/html/iraqi-women/ iraqi women] [http://fawarfo.freeweb7.com/topic/anno-.htm anno 2000 la corsa della morte] [http://itgurney.t35.com/view/new/dizionario-del/ dizionario del cinema italiano] [http://coarmago.freeweb7.com/library/html/sec.htm sec2] [http://quotes-girl.somee.com/content/view/austria-cose/ austria cose fare] [http://dabeutle.t35.com/content/view/musica-da.htm musica da ascoltare] [http://itgurney.t35.com/view/new/franks-adventur/ franks adventur 2] [http://coarmago.freeweb7.com/library/html/sony-dvd.htm sony dvd403] [http://rimarsh.t35.com/images/small/cundo-volveras.htm cundo volveras] [http://coarmago.freeweb7.com/library/html/memoria-pc.htm memoria pc 133] [http://madavid.t35.com/html/il-disco/ il disco volante] [http://rimarsh.t35.com/images/small/biglietto-natale.htm biglietto natale] [http://madavid.t35.com/html/accetta-il/ accetta il consiglio] [http://madavid.t35.com/html/mvx-i/ mvx 30i] [http://ouquaite.freeweb7.com/img/styles/processori-intel/ processori intel 3 4ghz] [http://nationavce.somee.com/library/html/idilio/ idilio] [http://dabeutle.t35.com/content/view/batteria-elettronica.htm batteria elettronica yamaha] [http://davelovesyou.somee.com/library/html/sexo-en/ sexo en uruguay] [http://coarmago.freeweb7.com/library/html/gta.htm gta] [http://flheddina.t35.com/web/testo-e/ testo e traduzione fuck it turn back] [http://itgurney.t35.com/view/new/robot-cucina/ robot cucina professionale] [http://davelovesyou.somee.com/library/html/valeria-di/ valeria di elsa lila] [http://rihelm.125mb.com/img/styles/kollant-it/ kollant it] [http://lakitsmi.freeweb7.com/web/hard-disk/ hard disk 2 5 box] [http://lakitsmi.freeweb7.com/web/peru-en/ peru en el futbol] [http://jedillar.125mb.com/resources/articles/ego-cam/ ego cam samsung] [http://fergus-mac.somee.com/description/lib/sha-hime/ sha hime] [http://rimarsh.t35.com/images/small/mitac-.htm mitac - mio 168 con tomtom navigator 3] [http://dabeutle.t35.com/content/view/www-goooogle.htm www goooogle com] [http://nationavce.somee.com/library/html/eros-e/ eros e glamor] [http://viemalin.freeweb7.com/resources/articles/produzione-sauna.htm produzione sauna] [http://betheresa.t35.com/text/directory/breil-globe/ breil globe uomo] [http://viemalin.freeweb7.com/resources/articles/unione-europea.htm unione europea i nuovi entrati] [http://viemalin.freeweb7.com/resources/articles/honeymoon-video.htm honeymoon video pamela] [http://viemalin.freeweb7.com/resources/articles/incontro-bassano.htm incontro bassano grappa] [http://kiboukni.125mb.com/web/volami-nel/ volami nel cuore] [http://rihelm.125mb.com/img/styles/panasonic-vs/ panasonic vs7] [http://viemalin.freeweb7.com/resources/articles/sanificazione.htm sanificazione] [http://lensman.somee.com/html/pal-secam/ pal secam ntsc] [http://am-i-bird.somee.com/img/styles/pelle-pantaloni.htm pelle pantaloni ecologica] [http://lamcgie.125mb.com/html/intimo-slip.htm intimo slip] [http://betheresa.t35.com/text/directory/iraq-decapitati/ iraq decapitati] [http://kiboukni.125mb.com/web/pista-de/ pista de regae] [http://madavid.t35.com/html/gem-fiestaweb/ gem fiestaweb] [http://rihelm.125mb.com/img/styles/citroen-picasso/ citroen picasso autocarro] [http://lensman.somee.com/html/chanel-coco/ chanel coco] [http://peter-land.somee.com/images/small/lisola-delle.htm lisola delle amazzoni] [http://lensman.somee.com/html/architetto-roma/ architetto roma] [http://trocterli.t35.com/img/styles/hard-disk/ hard disk 80 ata 133] [http://lensman.somee.com/html/kawasaki/ kawasaki 600] [http://trocterli.t35.com/img/styles/giornata-storica/ giornata storica] [http://nairoz.somee.com/img/styles/poesie-corte/ poesie corte per ragazzi] [http://nairoz.somee.com/img/styles/wrc/ wrc] [http://am-i-bird.somee.com/img/styles/traslochi-catania.htm traslochi catania] [http://betheresa.t35.com/text/directory/playa-total/ playa total 9] [http://itgurney.t35.com/view/new/foto-porno/ foto porno fist fucking] [http://jedillar.125mb.com/resources/articles/gallr/ gallr] [http://kiboukni.125mb.com/web/www-cerved/ www cerved it] [http://lamcgie.125mb.com/html/sbc-hc.htm sbc hc8440] [http://rihelm.125mb.com/img/styles/valerio-saranno/ valerio saranno famosi] [http://de-der.somee.com/library/html/video-bollenti.htm video bollenti gratis] [http://rihelm.125mb.com/img/styles/voice-recorder/ voice recorder mp3 lettori] [http://brrezab.freeweb7.com/img/styles/caf.htm caf] [http://kiboukni.125mb.com/web/abbigliamento-bambini/ abbigliamento bambini e neonati] [http://dabeutle.t35.com/content/view/dvd-autoradio.htm dvd autoradio] [http://yourorus.somee.com/data/www-superfighe.htm www superfighe it] [http://ouquaite.freeweb7.com/img/styles/kit-tom/ kit tom] [http://ouquaite.freeweb7.com/img/styles/nilla-pizzi/ nilla pizzi] [http://davelovesyou.somee.com/library/html/www-state/ www state il us cms] [http://dabeutle.t35.com/content/view/massaggi-campania.htm massaggi campania] [http://quotes-girl.somee.com/content/view/karen-antonn/ karen antonn et bonnie tyler] [http://trocterli.t35.com/img/styles/www-scavolini/ www scavolini it] [http://lamcgie.t35.com/web/mail-pass.htm mail pass view] [http://fergus-mac.somee.com/description/lib/she-say/ she say goodbye] [http://nairoz.somee.com/img/styles/mum/ mum] [http://brrezab.freeweb7.com/img/styles/boy-sex.htm boy sex] [http://luallard.t35.com/html/due-personaggi/ due personaggi] [http://jedillar.125mb.com/resources/articles/schiava-racconti/ schiava racconti] [http://trocterli.t35.com/img/styles/bosch-max/ bosch max] [http://jututor.125mb.com/lib/serrat/ serrat] [http://jedillar.125mb.com/resources/articles/vacanze-agosto/ vacanze agosto italia] [http://coarmago.freeweb7.com/library/html/dj-tommy.htm dj tommy vee] [http://lamcgie.125mb.com/html/roger-pontare.htm roger pontare] [http://davelovesyou.somee.com/library/html/divano-arredamento/ divano arredamento] [http://fergus-mac.somee.com/description/lib/pooh-canzoni/ pooh canzoni kar] [http://kiboukni.125mb.com/web/foto-nylon/ foto nylon sexy] [http://fawarfo.freeweb7.com/topic/foto-calza.htm foto calza] [http://thegoogly.somee.com/view/new/epson-lx.htm epson lx 1170] [http://lamcgie.t35.com/web/gudermes.htm gudermes] [http://quotes-girl.somee.com/content/view/mario-w/ mario w] [http://trocterli.t35.com/img/styles/jeans-e/ jeans e pantaloni] [http://dj-deus.somee.com/lib/fujifilm-finepix.htm fujifilm finepix f455] [http://dj-deus.somee.com/lib/yeti.htm yeti5] [http://nationavce.somee.com/library/html/ab-sat/ ab sat kyes] [http://ouquaite.freeweb7.com/img/styles/radio-fm/ radio fm mp3] [http://yourorus.somee.com/data/sorridi.htm sorridi] [http://jedillar.125mb.com/resources/articles/un-uomo/ un uomo senza importanza] [http://madavid.t35.com/html/candle-in/ candle in the wind elton john] [http://de-der.somee.com/library/html/diffusori-genelec.htm diffusori genelec] [http://jedillar.125mb.com/resources/articles/dvdr-tx/ dvd-r tx] [http://itgurney.t35.com/view/new/giorgia-spirito/ giorgia spirito libero] [http://ouquaite.freeweb7.com/img/styles/toner-lexmark/ toner lexmark t610] {{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 14:36, 23 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()