Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- Python Professional Course Series: GUI Programming
- 0231219-025303.png }} It was just text – usually elegantly formatted, sometimes colorized (but still ... eir own style and colors of virtually all the GUI elements. Some operating systems devote the whole s... mouse's movements, clicks targeting selected GUI elements, or by dragging other elements. Touch screens may offer something more: tapping (single or doub
- 1.7 Visiting widgets’ properties
- ] if state == "ON": state = "OFF" else: state = "ON" button["text"] = stat... ) if state == "ON": state = "OFF" else: state = "ON" button.config(text=st... mple. Any font can be described as two- or three-element tuples: <code python> ("font_family_name", "... , "font_size", "font_style") </code> * the two-element tuple contains two strings: the first contai
- 2.5 Working with the Canvas
- d(row=1) window.mainloop() </code> Drawing an **ellipse** (and a **circle** is, in fact, a specific ellipse) needs a method named create_oval(): <code ... ,y1,xn,yn,option...) </code> The method draws an ellipse inscribed in a rectangle with vertices at th... d (x1,y1). If the rectangle is a **square**, the ellipse becomes a **circle**. The options are the s
- 1.6 Events and how to handle them
- of **any length** (but remember, the screen isn’t elastic and won’t stretch if you’re going to display... one with a method named – it couldn’t be anything else – ''bind()'': <code ; output> widget.bind(even... ssagebox.showinfo("Click!", "I love clicks!") else: string = "x=" + str(event.x) + ",y=" +... a: None) button_2.config(text="Gee!") else: button_2.config(command=peekaboo)
- 1.2 Let TkInter speak!
- GUI application itself consists of four essential elements: * **importing** the needed **tkinter** ... ction designed to be invoked by someone/something else (not us!) is often called a **callback**. We'll... user clicks the closing button. This is not very elegant; you'll probably agree with that. We ask yo
- 1.8 Interacting with widget methods
- change its plans; when the number of milliseconds elapses, the manager **will invoke the function** (o... hite if is_white: color = 'black' else: color = 'white' is_white = not is_... t() is button_1: button_2.focus_set() else: button_1.focus_set() window.after(
- 2.3 A small lexicon of widgets - Part 3
- ontent is valid. last_string = string else: text.set(last_string) last_string = ... = tk.DISABLED: accessible = tk.ACTIVE else: accessible = tk.DISABLED sub_menu.
- 2.4 Shaping the main window and conversing with the user
- working solution, although we agree it’s not very elegant. Take a look at the code we've provided in ... if size >= 500: grows = False else: size -= 50 if size <= 100:
- 1.3 Settling widgets in the window's interior
- (the left-most) column, but we also did something else – we wanted the widget to span across two horiz
- 2.1 A small lexicon of widgets - Part 1
- fig(state=tk.NORMAL) button_1.flash() else: button_1.flash() button_1.conf