Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 2.3 A small lexicon of widgets - Part 3
- racer remembers its **previous** state (using the last_s variable) and restores the field to this stat... kinter as tk def digits_only(*args): global last_string string = text.get() if string ==... g.isdigit(): # Field's content is valid. last_string = string else: text.set(last_string) last_string = '' window = tk.Tk() text =
- 1.6 Events and how to handle them
- ents. This also means that some of the events may launch some of your callbacks, which makes you respo... nfo("Click!","I love clicks!") window = tk.Tk() label = tk.Label(window, text="Label") label.pack() button = tk.Button(window, text="Button", command=click) butto
- 1.5 A simple GUI application
- lutely **obvious** – we'll construct a window and launch an event controller – look at the code in the... this dull gray area. Our new friend is called ''Label'' – a non-clickable widget able to **present s... nstructor using a ''text'' argument. The text can later be changed at any moment of the widget's life.... e python> import tkinter as tk window = tk.Tk() label = tk.Label(window, text = "Little label:") lab
- 2.2 A small lexicon of widgets - Part 2
- e ''bind()'' to simulate similar behavior. The ''Label'' widget displays some lines of text inside the window: <code python> label = Label(master, option, ...) </code> The ''Label'' widget contains two usable properties, but you need to
- 1.7 Visiting widgets’ properties
- resenting a piece of text (e.g., ''Button'' and ''Label'' but not ''Frame'') can be made to use a font... s – obviously – named ''font''. We’ve used the ''Label'' widget to demonstrate three different fonts.... e python> import tkinter as tk window = tk.Tk() label_1 = tk.Label(window, text="Quick brown fox jumps over the lazy dog") label_1.grid(column=0, row=0)
- Python Professional Course Series: GUI Programming
- letters, digits, and a few other characters. The latter limitation is the most important as it dictat... ready? There are more disadvantages than just a lack of colors and a low resolution. Terminals had ... rent from contemporary keyboards installed inside laptops) and nothing more. Some of the terminals (v... non-clickable member of the window's team is a **label** – a piece of text inside a window which lite
- 2.4 Shaping the main window and conversing with the user
- file='logo.png')) window.bind("<Button-1>", lambda e: window.destroy()) window.mainloop() </cod... e provided by you. The icon is transferred by the last method’s argument, but if you want this to work... mage(file='logo.png')) window.bind("<Button-1>;", lambda e: window.destroy()) window.mainloop() </cod... ()'', which protects the window from becoming too large. Check the code in the editor window to see h
- 2.5 Working with the Canvas
- = 2.5 Working with the Canvas == Canvas Our last meeting is devoted to the ''Canvas'' – a widget that ... rawing a line, with the difference being that the last segment (connecting the first and the last points) in the chain is drawn **automatically** (you don... ed to specify the same point as the first and the last (x,y) pair: <code python> canvas.create_polygo
- 2.1 A small lexicon of widgets - Part 1
- able size. We’re convinced that our collection is large enough to make you familiar with ''tkinter'' s... in most cases, but can be also a ''Frame'' or a ''LabelFrame'' (described in the next section). The c
- 1.2 Let TkInter speak!
- set of necessary **widgets** to the window; * **launching** the event controller. That’s all. Reall
- 1.4 Coloring your widgets
- ightSalmon", activeforeground="LavenderBlush", activebackground=