Window creation: Difference between revisions
mNo edit summary |
(Undo revision 7080 by Special:Contributions/Rh5Tji (User talk:Rh5Tji)) |
||
Line 1: | Line 1: | ||
{{task}} |
|||
[http://milano.rigour.info/calze-running.htm calze running] [http://it.rigour.info/topic/sl-/ sl 150 cordless] [http://note.rigour.info/content/view/kukiz-i.htm kukiz i borysewicz] [http://blog.rigour.info/web/morellato-uomo/ morellato uomo acciaio e oro] [http://note.rigour.info/content/view/frankenwald.htm frankenwald] [http://content.rigour.info/html/dior-mascara/ dior mascara] [http://gratis.rigour.info/content/view/boom-economico.htm boom economico anni 60] [http://down.rigour.info/blog/donne-che.htm donne che scopano i cavalli] [http://here.rigour.info/blog/philips-magic.htm philips magic 3] [http://it.rigour.info/topic/samsung-mb/ samsung 997mb 19] [http://down.rigour.info/blog/dragonball-immagini.htm dragonball immagini] [http://speed.rigour.info/asus-star.htm asus star] [http://uve.rigour.info/blog/belle-curve.htm belle curve] [http://load.rigour.info/view/new/freeclipart.htm freeclipart] [http://down.rigour.info/blog/esi-near.htm esi near05] [http://pagina.rigour.info/catania-francoforte/ catania francoforte biglietti aerei] [http://paga.rigour.info/crema-catalana/ crema catalana] [http://milano.rigour.info/rimax-virtual.htm rimax virtual vision] [http://here.rigour.info/blog/home-teathre.htm home teathre] [http://load.rigour.info/view/new/garmin-c.htm garmin 172c] [http://gratis.rigour.info/content/view/osservatorio-prezzi.htm osservatorio prezzi della ponte] [http://web.rigour.info/ocktoberfest/ ocktoberfest] [http://milano.rigour.info/home-cinema.htm home cinema jbl] [http://here.rigour.info/blog/bedandbreakfast-it.htm bedandbreakfast it] [http://blog.rigour.info/web/raffles/ raffles] [http://guest.rigour.info/library/html/vendita-cd/ vendita cd] [http://pagina.rigour.info/cherubini-roma/ cherubini roma audio] [http://load.rigour.info/view/new/porche-in.htm porche in calore] [http://load.rigour.info/view/new/chopin-opera.htm chopin opera 90] [http://online.rigour.info/europa-svegliati/ europa svegliati] [http://content.rigour.info/html/ati-a/ ati a9550] [http://web.rigour.info/www-aida/ www aida it] [http://guest.rigour.info/library/html/www-ea/ www ea games com] [http://all.rigour.info/palmare-cellulare/ palmare cellulare gsm] [http://all.rigour.info/tdrs/ tdrs] [http://load.rigour.info/view/new/coni.htm coni] [http://here.rigour.info/blog/ho-ucciso.htm ho ucciso mia moglie] [http://web.rigour.info/quiero-saber/ quiero saber de ti] [http://pagina.rigour.info/star-wars/ star wars. clone wars. vol. 01] [http://dir.rigour.info/pian-vigne/ pian vigne] [http://note.rigour.info/content/view/lesbiane.htm lesbiane] [http://content.rigour.info/html/cirano-di/ cirano di guccini] [http://blog.rigour.info/web/sexy-bar/ sexy bar bambola] [http://blog.rigour.info/web/bluetooth-monitor/ bluetooth monitor] [http://content.rigour.info/html/duncan-dei/ duncan dei blue nudo] [http://milano.rigour.info/digicom-modem.htm digicom modem esterno] [http://blog.rigour.info/web/girl-from/ girl from the gutter] [http://web.rigour.info/il-lancio/ il lancio del lupo] [http://web.rigour.info/le-avventure/ le avventure di tarzan] [http://down.rigour.info/blog/sex-fto.htm sex fto] [http://content.rigour.info/html/guerlain-vetiver/ guerlain vetiver] [http://load.rigour.info/view/new/agricoltura-e.htm agricoltura e silvicoltura - macchine e accessori] [http://all.rigour.info/hey-joe/ hey joe midi] [http://dir.rigour.info/joao-pedro/ joao pedro pais] [http://guest.rigour.info/library/html/rolex-daytona/ rolex daytona] [http://all.rigour.info/caricaturas-de/ caricaturas de aventuras] [http://up.rigour.info/description/lib/actisetup.htm actisetup] [http://web.rigour.info/i-maledetti/ i maledetti] [http://dir.rigour.info/juego-de/ juego de la logica] [http://all.rigour.info/smaria-della/ smaria della salute venezia] [http://all.rigour.info/verbi-italiani/ verbi italiani] [http://dir.rigour.info/dissipatori-p/ dissipatori p4 775] [http://down.rigour.info/blog/www-mpogd.htm www mpogd com] [http://here.rigour.info/blog/cybershot-dsc.htm cyber-shot dsc w17] [http://guest.rigour.info/library/html/gemelli-oro/ gemelli oro bianco] [http://paga.rigour.info/testi-sistem/ testi sistem of a down] [http://note.rigour.info/content/view/traduzione-testo.htm traduzione testo i don t wonna know] [http://paga.rigour.info/immagini-del/ immagini del villaggio s cristiana 2004] [http://load.rigour.info/view/new/ryan-oneal.htm ryan oneal] [http://gratis.rigour.info/content/view/piatto-giradischi.htm piatto giradischi] [http://down.rigour.info/blog/gioiello-damiani.htm gioiello damiani] [http://all.rigour.info/jeux-floraux/ jeux floraux] [http://pagina.rigour.info/la-rosa/ la rosa di washington] [http://italy.rigour.info/blog/hp-pavilion.htm hp pavilion pc] [http://dir.rigour.info/ragazzo-siracusa/ ragazzo siracusa] [http://load.rigour.info/view/new/cottontex.htm cottontex] [http://web.rigour.info/henry-salvador/ henry salvador] [http://note.rigour.info/content/view/accademia-di.htm accademia di danza] [http://pagina.rigour.info/www-joux/ www joux it] [http://web.rigour.info/sceen-savers/ sceen savers] [http://milano.rigour.info/registrazione-contratto.htm registrazione contratto ufficio registro] [http://here.rigour.info/blog/www-xoom.htm www xoom it] [http://dir.rigour.info/no-we/ no we are free] [http://pagina.rigour.info/psicologia-di/ psicologia di internet] [http://down.rigour.info/blog/kilitbahir.htm kilitbahir] [http://note.rigour.info/content/view/yo-quiero.htm yo quiero bailar de ivy quenn] [http://paga.rigour.info/serate-tommy/ serate tommy vee] [http://web.rigour.info/panchiao/ panchiao] [http://milano.rigour.info/temperatura-modding.htm temperatura modding] [http://guest.rigour.info/library/html/nokia-loghi/ nokia loghi cellulare] [http://uve.rigour.info/blog/the-way.htm the way i am eminem] [http://it.rigour.info/topic/software-invio/ software invio sms] [http://dir.rigour.info/ati-radeon/ ati radeon x800xl 512mb] [http://down.rigour.info/blog/passione-nel.htm passione nel deserto] [http://milano.rigour.info/hp-laser.htm hp laser 1160] [http://load.rigour.info/view/new/ricominciamo-ska.htm ricominciamo ska] [http://here.rigour.info/blog/i-can.htm i can t stop] [http://all.rigour.info/il-segreto/ il segreto di cristoforo colombo] [http://online.rigour.info/dcrhc-sony/ dcr-hc40 sony] [http://dir.rigour.info/giochi-puzzle/ giochi puzzle on line] [http://paga.rigour.info/pasion-de/ pasion de] [http://up.rigour.info/description/lib/if-you.htm if you had my love] [http://gratis.rigour.info/content/view/fiat-barchetta.htm fiat barchetta 1 8] [http://load.rigour.info/view/new/swatch-touch.htm swatch touch] [http://guest.rigour.info/library/html/dvb-upload/ dvb upload] [http://online.rigour.info/questa-lunga/ questa lunga storia d amore] [http://online.rigour.info/bring-me/ bring me o life] [http://content.rigour.info/html/hp-notebook/ hp notebook vendita] [http://speed.rigour.info/fiat-panda.htm fiat panda anno 2003] [http://all.rigour.info/manterola/ manterola] [http://italy.rigour.info/blog/pisciate-gratis.htm pisciate gratis] [http://dir.rigour.info/viata-omului/ viata omului] [http://all.rigour.info/hotel-montparnasse/ hotel montparnasse parigi] [http://uve.rigour.info/blog/marco-frisina.htm marco frisina] [http://note.rigour.info/content/view/castrocaro.htm castrocaro] [http://here.rigour.info/blog/abbigliamento-accessorio.htm abbigliamento accessorio] [http://speed.rigour.info/xuandu.htm xuandu] [http://blog.rigour.info/web/www-uil/ www uil scuola it] [http://speed.rigour.info/milano-quito.htm milano quito biglietti aerei] [http://guest.rigour.info/library/html/humax-satellite/ humax satellite] [http://all.rigour.info/www-radiomarte/ www radiomarte com] [http://pagina.rigour.info/no-sikiriki/ no sikiriki] [http://paga.rigour.info/tshirt-donna/ t-shirt donna manica lunga] [http://all.rigour.info/un-corpo/ un corpo un anima] [http://guest.rigour.info/library/html/one-tree/ one tree hill] [http://blog.rigour.info/web/ricerca-sul/ ricerca sul calcetto] [http://speed.rigour.info/corsi-parrucchiere.htm corsi parrucchiere per uomo] [http://uve.rigour.info/blog/dvdram-cd.htm dvd-ram cd e dvd vergini] [http://pagina.rigour.info/mentiroso/ mentiroso] [http://blog.rigour.info/web/embalaje/ embalaje] [http://load.rigour.info/view/new/pedologico.htm pedologico] [http://online.rigour.info/sito-internet/ sito internet caserta] [http://blog.rigour.info/web/e-va/ e va albert sordi] [http://pagina.rigour.info/macchina-truccate/ macchina truccate] [http://uve.rigour.info/blog/divincenzo.htm divincenzo] [http://load.rigour.info/view/new/tenda-coleman.htm tenda coleman] [http://web.rigour.info/samsung-sfp/ samsung sf-565p] [http://down.rigour.info/blog/saint-sinner.htm saint sinner] [http://all.rigour.info/recensione-di/ recensione di madame bovary] [http://paga.rigour.info/demo-e/ demo e sito italiano per rollercoaster tycoon 3] [http://it.rigour.info/topic/donne-erotiche/ donne erotiche] [http://web.rigour.info/khriz-y/ khriz y angel] [http://it.rigour.info/topic/orecchino-di/ orecchino di perla libri] [http://speed.rigour.info/el-rancho.htm el rancho grande] [http://dir.rigour.info/videocamere-sony/ videocamere sony mini dv] [http://web.rigour.info/screensaver-paesaggio/ screensaver paesaggio] [http://online.rigour.info/ragazzo-orbetello/ ragazzo orbetello] [http://blog.rigour.info/web/allegrini-amarone/ allegrini amarone] [http://speed.rigour.info/spandau-ballet.htm spandau ballet through the barricades] [http://note.rigour.info/content/view/memory-album.htm memory album 2] [http://speed.rigour.info/campbell-john.htm campbell, john ramsey] [http://down.rigour.info/blog/vegas-casino.htm vegas casino] [http://dir.rigour.info/decapitazione-americano/ decapitazione americano su libero] [http://pagina.rigour.info/hamlet-dvb/ hamlet dvb] [http://online.rigour.info/yara/ yara] [http://blog.rigour.info/web/driver-sound/ driver sound] [http://paga.rigour.info/fogo-na/ fogo na saia] [http://guest.rigour.info/library/html/papa-winnie/ papa winnie] [http://italy.rigour.info/blog/atlante-di.htm atlante di anatomia umana libri] [http://dir.rigour.info/clasico/ clasico] [http://guest.rigour.info/library/html/citroen-xantia/ citroen xantia 2.0 hdi] [http://load.rigour.info/view/new/samsung-sw.htm samsung sw] [http://pagina.rigour.info/glutamina-peptide/ glutamina peptide] [http://here.rigour.info/blog/arriva-un.htm arriva un cavaliere libero e selvaggio] [http://pagina.rigour.info/havana-kenny/ havana kenny g] [http://up.rigour.info/description/lib/psone-video.htm psone video] [http://load.rigour.info/view/new/hp-dat.htm hp dat 40] [http://dir.rigour.info/prezzi-alpitour/ prezzi alpitour] [http://italy.rigour.info/blog/gigaset-aggiuntivo.htm gigaset aggiuntivo] [http://down.rigour.info/blog/vssp.htm vssp] [http://all.rigour.info/la-matina/ la matina] [http://here.rigour.info/blog/x-agosto.htm x agosto pascoli testo] [http://online.rigour.info/pellets/ pellets] [http://dir.rigour.info/hotel-a/ hotel a jesolo] [http://milano.rigour.info/to-nem.htm to nem ia] [http://pagina.rigour.info/la-grande/ la grande fuga] [http://dir.rigour.info/intime/ intime] [http://dir.rigour.info/notebook-toshiba/ notebook toshiba sa60] [http://load.rigour.info/view/new/negar-khan.htm negar khan nude pics] [http://up.rigour.info/description/lib/primiero.htm primiero] [http://milano.rigour.info/worms-.htm worms 4 ps2 videogiochi] [http://milano.rigour.info/touch-ljubi.htm touch ljubi] [http://note.rigour.info/content/view/sexi-brytny.htm sexi brytny] [http://uve.rigour.info/blog/mellow.htm mellow 2004] [http://speed.rigour.info/solo-per.htm solo per te eamon] [http://up.rigour.info/description/lib/minimoto-usate.htm minimoto usate] [http://load.rigour.info/view/new/sapori-ditalia.htm sapori ditalia e dal mondo srl] [http://pagina.rigour.info/gk/ gk] [http://it.rigour.info/topic/giugno-di/ giugno di fuoco per far cry] [http://here.rigour.info/blog/power-rangers.htm power rangers - il film] [http://online.rigour.info/di-silvester/ di silvester stallone] [http://blog.rigour.info/web/ram-notebook/ ram notebook fujitsu] [http://gratis.rigour.info/content/view/sony-dscst.htm sony dsc-st80] [http://down.rigour.info/blog/batteria-per.htm batteria per samsung sghe710] [http://guest.rigour.info/library/html/camera-commercio/ camera commercio roma] [http://load.rigour.info/view/new/alfa-.htm alfa 33 1.7 ie 16v quadrifoglio verde] [http://web.rigour.info/bacio-tra/ bacio tra paola e chiara] [http://pagina.rigour.info/sodimm-mb/ sodimm 256mb ddr 333mhz pc2700] [http://guest.rigour.info/library/html/scarpa-calcio/ scarpa calcio lotto] [http://it.rigour.info/topic/poesie-sull/ poesie sull amicizia] {{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 15:36, 22 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()