Tkinter: Difference between revisions

From ArmadeusWiki
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Under Construction}}


==Introduction==
==Introduction==
The Tkinter module (“Tk interface”) is the standard Python interface to the Tk GUI toolkit.
Tkinter (“Tk interface”) is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk.


==Installation==
==Installation==
* Tkinter requires a [[X11 server]] running on your board.
* Then to activate it:
<pre class="config">
<pre class="config">
Target packages  --->
Target packages  --->
     Interpreter languages and scripting  --->
     Interpreter languages and scripting  --->
    ...
        ...
    [*] tcl
        [*] tcl
    [*]  delete encodings (saves 1.4Mb)
        [*]  delete encodings (saves 1.4Mb)
    [*]  install only shared library
        [*]  install only shared library
          tcl libraries/modules  --->
              tcl libraries/modules  --->
              [*] tk
                  [*] tk
              [*]  remove demos
                  [*]  remove demos
    ...
        ...
    [*] python
        [*] python
        core python modules  --->
            core python modules  --->
            ...
                ...
            [*] tkinter
                [*] tkinter
</pre>
</pre>


==Quick test==
==Quick test==
<source lang=python>
from Tkinter import *
from Tkinter import *


Line 31: Line 33:


root.mainloop()
root.mainloop()
</source>


==Going further==
==Going further==
* [http://effbot.org/tkinterbook/ A introduction to Tkinter online book]
[[Image:tkinter.png|Tkinter example running on APF27 with blackbox window manager]]


==Links==
==Links==
* https://wiki.python.org/moin/TkInter
* https://wiki.python.org/moin/TkInter
[[Category:Python]]
[[Category:Graphical User Interface]]

Latest revision as of 23:03, 22 July 2014

Introduction

Tkinter (“Tk interface”) is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk.

Installation

  • Tkinter requires a X11 server running on your board.
  • Then to activate it:
Target packages  --->
    Interpreter languages and scripting  --->
        ...
        [*] tcl
        [*]   delete encodings (saves 1.4Mb)
        [*]   install only shared library
              tcl libraries/modules  --->
                  [*] tk
                  [*]   remove demos
        ...
        [*] python
            core python modules  --->
                ...
                [*] tkinter

Quick test

from Tkinter import *

root = Tk()

w = Label(root, text="Hello, world!")
w.pack()

root.mainloop()

Going further

Tkinter example running on APF27 with blackbox window manager

Links