Cerca

Heus ací els resultats de la cerca.

2.3 A small lexicon of widgets - Part 3
46 Resultats, Darrera modificació:
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
34 Resultats, Darrera modificació:
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
33 Resultats, Darrera modificació:
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
26 Resultats, Darrera modificació:
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
24 Resultats, Darrera modificació:
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
5 Resultats, Darrera modificació:
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
4 Resultats, Darrera modificació:
file='logo.png')) window.bind("&lt;Button-1&gt;", 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
4 Resultats, Darrera modificació:
= 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
2 Resultats, Darrera modificació:
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!
1 Resultats, Darrera modificació:
set of necessary **widgets** to the window; * **launching** the event controller. That’s all. Reall
1.4 Coloring your widgets
1 Resultats, Darrera modificació:
ightSalmon", activeforeground="LavenderBlush", activebackground=