Preguntas frecuentes sobre la Interfaz Gráfica de Usuario (*GUI*)
*****************************************************************


Preguntas generales de la GUI
=============================


¿Qué conjuntos de herramientas de GUI existen para Python?
==========================================================

Los empaquetados estándar de Python incluyen una interfaz orientada a
objetos para el conjunto de widgets de Tcl/Tk, llamada tkinter. Esta
es probablemente la más fácil de instalar (ya que viene incluida con
la mayoría de distribuciones binarias de Python) y usar. Para obtener
más información sobre Tk, incluyendo referencias a la fuente, ver la
Página de inicio Tcl/Tk. Tcl/Tk es totalmente portable a macOS,
Windows y plataformas Unix.

Dependiendo de a que plataforma(s) estés apuntando, hay también
múltiples alternativas. Una lista de conjuntos de herramientas
multiplataforma y de plataforma específica puede ser encontrada en la
wiki de Python.


Preguntas de Tkinter
====================


¿Cómo congelo las aplicaciones de Tkinter?
------------------------------------------

Freeze es una herramienta para crear aplicaciones independientes. Al
congelar aplicaciones Tkinter, las aplicaciones no serán realmente
independientes, ya que la aplicación seguirá necesitando las
bibliotecas Tcl y Tk.

One solution is to ship the application with the Tcl and Tk libraries,
and point to them at run-time using the "TCL_LIBRARY" and "TK_LIBRARY"
environment variables.

To get truly stand-alone applications, the Tcl scripts that form the
library have to be integrated into the application as well. One tool
supporting that is SAM (stand-alone modules), which is part of the Tix
distribution (https://tix.sourceforge.net/).

Construya Tix con SAM habilitado, realice la llamada apropiada a
"Tclsam_init()", etc. dentro de Python "Modules/tkappinit.c", y enlace
con libtclsam libtclsam y libtksam (también puede incluir las
bibliotecas Tix).


¿Puedo tener eventos Tk manejados mientras espero por *I/O*?
------------------------------------------------------------

On platforms other than Windows, yes, and you don't even need threads!
But you'll have to restructure your I/O code a bit.  Tk has the
equivalent of Xt's "XtAddInput()" call, which allows you to register a
callback function which will be called from the Tk mainloop when I/O
is possible on a file descriptor.  See Gestor de archivos.


No puedo hacer que los atajos de teclado funcionen en Tkinter: ¿por qué?
------------------------------------------------------------------------

An often-heard complaint is that event handlers bound to events with
the "bind()" method don't get handled even when the appropriate key is
pressed.

La causa más común es que el widget al que se aplica el atajo no tiene
enfoque de teclado. Consulte la documentación de Tk para el comando de
*focus*. Por lo general, un *widget* recibe el foco del teclado
haciendo clic en él (pero no para las etiquetas; consulte la opción
*takefocus*).
