Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- Python Professional Course Series: GUI Programming
- , that’s enough jokes about TLA’s for one course, all the more that GUI is present nearly everywhere. ... ven, even washing machine or heating controller – all these things have a screen, most of them colored... home) with thousands of colored lights, blinking all the time, and hundreds of switches (also colored). “Okay,” you may say, “nice image, but how could
- 1.6 Events and how to handle them
- s and how to handle them == Event handling As you already know, events are the fuel which propel the application’s movements. All events come **to the event manager**, which is responsible for dispatching them to all the application components. This also means that some of the events may launch some of your callback
- 2.3 A small lexicon of widgets - Part 3
- ' widget not only presents a line of text, but is also able to **edit** the text according to the user... name, password, email, etc. The widget implements all standard edit operations like inserting, removin... r shows you how to use an **observable variable** along with the **trace callback** (tracer) to force a user to enter **only digits** – all other characters will be silently **ignored**.
- 1.2 Let TkInter speak!
- .2 Let TkInter speak! == Importing TkInter As you already know, from Python's point of view TkInter is... ; * **launching** the event controller. That’s all. Really. Looks too good to be true? Let us show ... code python>import tkinter</code> Note: it won’t allow you to access some modules built-in within the... will still have to import them separately. As you already now, such an import will force you to use th
- 1.4 Coloring your widgets
- ”//) and ''fg'' (//“foreground-color”//). We went along the line of least resistance here – we've just... *, **gray** or even **grey**. It's easy and handy although not very precise. Tkinter can do something... nter recognizes over 750 predefined color names – all of them can be found [[https://www.tcl.tk/man/tc... rent kinds. One of the RGB model implementations allows you to set the **saturation** of every of pri
- 1.7 Visiting widgets’ properties
- g widgets’ properties == Widget properties As you already know, every widget has a set of properties, ... et's property is not just an **object property**. Although every widget is actually an object, you can... s value, and the second named ''config()'', which allows you to **set** a new value to the property. ... nts; note: the second element has to be a string, although it specifies strictly numerical information
- 1.3 Settling widgets in the window's interior
- widgets A familiarity with the ''Button'' widget allows us to show you some ways of putting the widge... dget's object**, not the window, as the widget is always aware of the window it belongs to (it gets th... ble ''place()'' method parameters are as follows (all of them are passed as keyword arguments): * '... he home window's top-left corner. Let's see them all in action. <code python> import tkinter as tk
- 2.1 A small lexicon of widgets - Part 1
- e ''tkinter'' widgets. We aren’t able to describe all of them, however – it would bloat our course to ... to carry out your own experiments and tests. You already know some of the widgets. In these cases, we... y first argument of the constructor invocation is always the **master widget** i.e., the widget that o... is just the main window in most cases, but can be also a ''Frame'' or a ''LabelFrame'' (described in t
- 2.4 Shaping the main window and conversing with the user
- o in a portable way. Here’s one working solution, although we agree it’s not very elegant. Take a loo... e into consideration how the change can influence all your widgets. Our sample code in the editor sho... ry("500x500") window.mainloop() </code> There’s also a method called ''maxsize()'', which protects t... now we want to summarize the issue and to present all of the most useful tools. All these functions d
- 1.8 Interacting with widget methods
- idgets have **methods** – you’ve met some of them already. Now we’re going to show you a few more of t... by the **id** argument. Seems confusing? Not at all. The example will shed more light on it than tel... widget completely, not only from your sight, but also from the event manager’s memory, as the widget’... unnecessary widgets while keeping the application alive. Note: if the widget you want to destroy has
- 2.2 A small lexicon of widgets - Part 2
- nformation and don’t have a ''command'' property, although you can use ''bind()'' to simulate similar ... uch a //window works// as a **master widget** for all the widgets embedded within it. Moreover, the ''... s **upper-left corner**, not the window’s one. It also means that if you move the ''Frame'' to a new position, all its inner widgets will go with it. Note: the ''
- 1.9 Looking at variables
- r * IntVar * StringVar The names you see are also the constructors’ names, so if you want to use ... (unusable for us); * ''ix'' – an empty string (always – don’t ask us why, it’s ''tkinter''’s busine... nt("Writing") dummy = tk.Tk() # we need this although we won't display any windows variable = tk.
- 1.5 A simple GUI application
- resizes the window to a size large enough to fit all the packed widgets. This is its default behavior... * (they work individually) while ''Radiobuttons'' always work in groups and – note it! – only one of t
- 2.5 Working with the Canvas
- neither palette nor easel – ''Canvas'' brings you all you need. Let’s start with a simple example. T... an you find the parts of the code responsible for all these actions? {{:info:cursos:pue:python-pcpp1: