Tkinter: diferència entre les revisions

De la Viquipèdia, l'enciclopèdia lliure
Contingut suprimit Contingut afegit
mCap resum de modificació
mCap resum de modificació
Línia 1: Línia 1:
'''Tkinter''' és un binding de la [[Biblioteca informàtica|biblioteca]] gràfica [[Tcl/Tk]] per al [[llenguatge de programació]] [[Python]]<ref>{{cite web | url=https://docs.python.org/library/tkinter.html | title=Tkinter — Python interface to Tcl/Tk — Python v2.6.1 documentation | accessdate=2009-03-12}}</ref>. Tkinter va ser escrit per Fredrik Lundh.<ref>{{citation | url=http://infohost.nmt.edu/tcc/help/pubs/tkinter/ | title=Tkinter reference: a GUI for Python | first=John W. | last=Shipman | publisher=New Mexico Tech Computer Center | date=2010-12-12 | accessdate=2012-01-11}}</ref> Es considera un estàndard per a la [[interfície gràfica d'usuari]] (GUI) per Python<ref>{{cite web | url=https://wiki.python.org/moin/TkInter | title= Tkinter - Pythoninfo Wiki}}</ref> i és el que ve per defecte amb la instal·lació per [[Microsoft Windows]] i [[Mac OS X]]. Tkinter és[[free software]] i te la llicència [[Python license]].<ref>http://tkinter.unpythonic.net/wiki/Tkinter</ref>
'''Tkinter''' és un binding de la [[Biblioteca informàtica|biblioteca]] gràfica [[Tcl/Tk]] per al [[llenguatge de programació]] [[Python]]<ref>{{cite web | url=https://docs.python.org/library/tkinter.html | title=Tkinter — Python interface to Tcl/Tk — Python v2.6.1 documentation | accessdate=2009-03-12}}</ref>. Tkinter va ser escrit per Fredrik Lundh.<ref>{{citation | url=http://infohost.nmt.edu/tcc/help/pubs/tkinter/ | title=Tkinter reference: a GUI for Python | first=John W. | last=Shipman | publisher=New Mexico Tech Computer Center | date=2010-12-12 | accessdate=2012-01-11}}</ref> Es considera un estàndard per a la [[interfície gràfica d'usuari]] (GUI) per Python<ref>{{cite web | url=https://wiki.python.org/moin/TkInter | title= Tkinter - Pythoninfo Wiki}}</ref> i és el que ve per defecte amb la instal·lació per [[Microsoft Windows]] i [[Mac OS X]]. Tkinter és [[free software]] i te la llicència [[Python license]].<ref>http://tkinter.unpythonic.net/wiki/Tkinter</ref>





Revisió del 10:54, 21 des 2016

Tkinter és un binding de la biblioteca gràfica Tcl/Tk per al llenguatge de programació Python[1]. Tkinter va ser escrit per Fredrik Lundh.[2] Es considera un estàndard per a la interfície gràfica d'usuari (GUI) per Python[3] i és el que ve per defecte amb la instal·lació per Microsoft Windows i Mac OS X. Tkinter és free software i te la llicència Python license.[4]


També hi ha altres alternatives disponibles com wxPython, PyQt o PySide i PyGTK que compleixen amb tots els estàndards de component visual.

Exemple

A continuació es descriu una aplicació senzilla amb Tkinter en Python3[5]

#!/usr/bin/env python3
import tkinter as tk

class Application(tk.Frame):
    def __init__(self, master=None):
        tk.Frame.__init__(self, master)
        self.grid()  
        self.createWidgets()

    def createWidgets(self):
        self.quitButton = tk.Button(self, text='Quit', command=self.quit)
        self.quitButton.grid()

app = Application()
app.master.title('Exemple')
app.mainloop()

Vegeu també

Referències

Enllaços externs