Cerca

Heus ací els resultats de la cerca.

Python Professional Course Series: GUI Programming
67 Resultats, Darrera modificació:
ass of acronyms which plays a very important role in the IT industry. Okay, that’s enough jokes about TLA’s for one course, all the more that GUI is prese... e bidirectionally. GUI stands for Graphical User Interface. In this three-word acronym, the User seems to be the most obvious part. The word Interface ne
1.2 Let TkInter speak!
54 Resultats, Darrera modificació:
: it won’t allow you to access some modules built-in within the package and you will still have to imp... he same extent as it is mute, and thus completely indifferent to any input. Don't worry, we'll breathe some life into it soon – it's only a very first step. Look at the cod
1.6 Events and how to handle them
53 Resultats, Darrera modificació:
y. We’ll also show you how the events are able to influence a widget’s state, and how you control the ... and present a debug trace. The output will appear in the standard Python console, without affecting the application window. It’s okay if used in the early stages of development, but it’s very inelegant if you want the application to behave in a m
1.3 Settling widgets in the window's interior
51 Resultats, Darrera modificació:
= 1.3 Settling widgets in the window's interior == Settling widgets A familiarity with the ''Button'' widget allows us to show ... ays of putting the widgets (not only the buttons) inside windows. There are more of them than just ''place()'', which you learned about in the previous section. To be precise, there are **
1.5 A simple GUI application
45 Resultats, Darrera modificació:
al will look like the vision presented below: {{ :info:cursos:pue:python-pcpp1:m3:pasted:20231223-1106... t's start. As everyone knows, Rome wasn't built in a day, and our application isn't an exception. We... and launch an event controller – look at the code in the editor to see how to do it. <code python> im... ode> Our window looks like this one for now: {{ :info:cursos:pue:python-pcpp1:m3:pasted:20231223-1107
1.7 Visiting widgets’ properties
35 Resultats, Darrera modificació:
d is based on using a **dictionary** which exists inside every widget. Assuming that a widget named ''... and then set it with a new value, you can do this in the following way: <code python> old_val = Widge... ] Widget["prop"] = new_val </code> Let’s see it in action. Look at the example we've provided in the editor. <code python> import tkinter as tk def o
2.4 Shaping the main window and conversing with the user
33 Resultats, Darrera modificació:
ndow’s icon is more troublesome if you want to do in a portable way. Here’s one working solution, alth... elegant. Take a look at the code we've provided in the editor. <code python> import tkinter as tk ... ode> The key to success is line #5 – it directly invokes one of the ''tkinter'' internal, low-level mechanisms directly communicating with the OS’s windo
2.3 A small lexicon of widgets - Part 3
31 Resultats, Darrera modificació:
first one is just a widget, while the second is, in fact, a **set of cooperating widgets**. The ''En... hen you are going to ask the user for any textual information: name, password, email, etc. The widget implements all standard edit operations like inserting, removing, scrolling, selecting, copying a... ext. Here are some of ''Entry''’s properties: {{:info:cursos:pue:python-pcpp1:m3:pasted:20231228-1125
2.5 Working with the Canvas
30 Resultats, Darrera modificació:
other widgets. Please treat this story as a basic introduction to the ''Canvas'' facilities. It can do... f the code responsible for all these actions? {{:info:cursos:pue:python-pcpp1:m3:pasted:20231228-1218... nvas. The most usable of them are as follows: {{:info:cursos:pue:python-pcpp1:m3:pasted:20231228-1219... (i.e., the coordinates of two points). The most interesting create_line() options are as follows: {{
1.8 Interacting with widget methods
27 Resultats, Darrera modificació:
= 1.8 Interacting with widget methods == Widget methods Widgets have **methods** – you’ve met some of ... thod expects two arguments: the first is a **time interval specification** (expressed in milliseconds: 1 s = 1000 ms) and the second **points to an existing function**; successful invocation of the method causes the event manager to
2.2 A small lexicon of widgets - Part 2
24 Resultats, Darrera modificació:
Non-clickable widgets The next four widgets fall into the **non-clickable** category. They’re designed to present **textual** information and don’t have a ''command'' property, a... The ''Label'' widget displays some lines of text inside the window: <code python> label = Label(maste... at they are mutually exclusive. Here you are: {{:info:cursos:pue:python-pcpp1:m3:pasted:20231228-1111
1.9 Looking at variables
23 Resultats, Darrera modificació:
y'' widget can use its own observable variable to inform other objects that the contents of the input field have been changed. From a technical point of ... e of that kind has to be **explicitly created and initialized**. There is another important differenc... be aware of what type of value you want to store in them, and don’t change your mind during the varia
1.4 Coloring your widgets
22 Resultats, Darrera modificació:
idgets == Adding colors Nearly everything you put inside your windows may be **colored**. Most widgets... g is getting to know how the colors are described in ''tkinter'', in other words, what means can you use to order the button to be red or blue. There are... kinter understands **English** – look at the code in the editor, our test is there. <code python> imp
2.1 A small lexicon of widgets - Part 1
22 Resultats, Darrera modificació:
and tests. You already know some of the widgets. In these cases, we’ll limit our descriptions to the ... class. The very first argument of the constructor invocation is always the **master widget** i.e., the... /code> The master widget is just the main window in most cases, but can be also a ''Frame'' or a ''LabelFrame'' (described in the next section). The constructor accepts a set