Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- Python Professional Course Series: GUI Programming
- olored and many (more and more every year) use it to display a GUI and to communicate with the user. They communicate bidirectionally. GUI stands for Gra... rface. In this three-word acronym, the User seems to be the most obvious part. The word Interface needs some more reflection, but in fact, it is clear too – it’s a tool used by the user to command a devi
- 1.3 Settling widgets in the window's interior
- familiarity with the ''Button'' widget allows us to show you some ways of putting the widgets (not on... which you learned about in the previous section. To be precise, there are **three different methods**... ''Place'' is the most detailed one. It forces you to **precisely declare a widget's location**, pixel ... you from some common mistakes causing the widgets to overlap each other or to place some of them, part
- 1.6 Events and how to handle them
- = 1.6 Events and how to handle them == Event handling As you already know, events are the fuel which p... el 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 t... ou responsible for preparing the proper reactions to the user’s actions. Now it’s time to show you so
- 1.2 Let TkInter speak!
- ns, constants, classes, objects, and modules used to build GUI applications. The GUI application itse... window; * adding a set of necessary **widgets** to the window; * **launching** the event controller. That’s all. Really. Looks too good to be true? Let us show how it works. We’ll do it step-by-step. Ready The simplest (and at the
- 2.3 A small lexicon of widgets - Part 3
- - Part 3 There are two remaining widgets we want to tell you about – the first one is just a widget, ... ot only presents a line of text, but is also able to **edit** the text according to the user’s actions. Using an ''Entry'' is necessary when you are going to ask the user for any textual information: name, p
- 1.5 A simple GUI application
- ng a GUI application from scratch Now we're going to build a very simple and rather useless GUI applic... cation, when ready, will make you more accustomed to some ''tkinter'' **habits** and **conventions**. ... event controller – look at the code in the editor to see how to do it. <code python> import tkinter as tk window = tk.Tk() window.mainloop() </code> O
- 2.4 Shaping the main window and conversing with the user
- The first main window property that you may want to change is its **title**. The title is defaultly set to ''Tk'', no matter what your application is named, or even if it's unnamed. To change the window’s title, you would use a method... ain window’s icon is more troublesome if you want to do in a portable way. Here’s one working solution
- 1.7 Visiting widgets’ properties
- set of properties, and the widget’s user is able to **change** them by modifying the widget’s **appearance** and **behavior**. We’ll show you how to manipulate properties and present a basic set of ... ts properties by using the dot notation. You have to use one of two possible ways of reading and setti... dge''t has a property named ''prop'' and you want to read its value and then set it with a new value,
- 1.8 Interacting with widget methods
- you’ve met some of them already. Now we’re going to show you a few more of them, and we’ll start with two which seem to be very specific. We can even say that the sense of their existence is very closely bound to the unique features of **event programming**. Th... liseconds: 1 s = 1000 ms) and the second **points to an existing function**; successful invocation of
- 1.9 Looking at variables
- = 1.9 Looking at variables == Variables To implement some of its functions, Tkinter uses a very specia... le works like a regular variable (i.e., it’s able to store values which are accessible to the outside world) but there is something more – any change of t... ntry'' widget can use its own observable variable to inform other objects that the contents of the inp
- 1.4 Coloring your widgets
- colored**. Most widgets have dedicated properties to handle their colors and we will tell you about th... s. Currently, the most important thing 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 at least three methods designed to meet your needs. We
- 2.5 Working with the Canvas
- the Canvas == Canvas Our last meeting is devoted to the ''Canvas'' – a widget that behaves like a... ... . Please treat this story as a basic introduction to the ''Canvas'' facilities. It can do much more fo... you – for example, it can scroll itself and react to many events – we hope you’ll explore these issues on your own while we show you how to start your new adventure. This will require neit
- 2.1 A small lexicon of widgets - Part 1
- t 1 == A small lexicon of widgets Now we’re ready to present a systematized set of some of the ''tkinter'' widgets. We aren’t able to describe all of them, however – it would bloat our course to an unmanageable size. We’re convinced that our collection is large enough to make you familiar with ''tkinter'' standards and
- 2.2 A small lexicon of widgets - Part 2
- the **non-clickable** category. They’re designed to present **textual** information and don’t have a ... mmand'' property, although you can use ''bind()'' to simulate similar behavior. The ''Label'' widget ... dget contains two usable properties, but you need to remember that they are mutually exclusive. Here ... accompanied by an observable variable can be used to **continuously** update the ''Label''’s contents.