Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- Python Professional Course Series: GUI Programming
- to it was usually thick and stiff. It's not surprising that the light pen didn't conquer the market. T... ce to utilize. The user's answer was given by pressing a set of allowed keys. Simple? Simple. From our ... . == Widgets The user interacts with the GUI by using gestures: a mouse's movements, clicks targeting ... Touch screens may offer something more: tapping (single or double or even more complex), swiping, and
- 1.2 Let TkInter speak!
- y your import (but not the rest of your work) by using the star as a component name: <code python>from ... Don't think we're going to discourage you from using this form. It's only a warning. Or rather a piec... e most important is how to close it while also causing the application to quit. Currently, there is no ... e OS's default behaviors, e.g., clicking the **closing button** (ours is red – and yours?) or using a d
- 2.3 A small lexicon of widgets - Part 3
- edit** the text according to the user’s actions. Using an ''Entry'' is necessary when you are going to ... **. The tracer remembers its **previous** state (using the last_s variable) and restores the field to t... er to quickly access selected operations without using a mouse; usually, hot-keys are triggered by pressing Alt-hotkey on the keyboard) * **selecting a me
- 1.3 Settling widgets in the window's interior
- however, protect you from some common mistakes causing the widgets to overlap each other or to place so... 3:pasted:20231222-035713.png }} As you can see, using ''place()'' gives you full control over the wind... parameter defaults to 1 (the widget won't cross a single grid's cell) * ''rowspan=rs'' – works as col... can change this behavior to a limited extent by using the following parameters: * ''side=s'' – force
- 1.5 A simple GUI application
- ted:20231223-110745.png }} There's nothing surprising yet. Let's add something to this dull gray area.... nformation**, passed to the widget's constructor using a ''text'' argument. The text can later be chang... indow.mainloop() </code> As you can see, we're using the ''pack()'' geometry manager to compose the w... to let the user enter simple, one-line data, like single numbers, names, addresses, etc. We’ve added o
- 2.4 Shaping the main window and conversing with the user
- = 2.4 Shaping the main window and conversing with the user The main window is a very specific construct... an be caused by the user clicking the window’s closing button), you can use a low-level ''tkinter'' met... e> The sample shows one of the possible ways of using this mechanism. <code python> import tkinter as... otherwise (e.g., when the user closes the dialog using its close button) In the editor we've provided
- 1.6 Events and how to handle them
- lickable** one, you can connect a callback to it using its ''command'' property, while the property can... i.e., those having the ''command'' property and using the command constructor’s parameter. If you unb... ckable). We bind a callback to the ''Label'', causing it to display (in a loop) the first five words o
- 1.7 Visiting widgets’ properties
- ally an object, you can access its properties by using the dot notation. You have to use one of two pos... roperties’ values. The first method is based on using a **dictionary** which exists inside every widge... specify the font’s style, which can be expressed using the following strings: * "bold" * "itali
- 1.8 Interacting with widget methods
- way of controlling the **passage of time** when using an event-driven environment.\\Why? Because you c... on identified by the **id** argument. Seems confusing? Not at all. The example will shed more light on
- 1.9 Looking at variables
- you want to be aware of the variable reads (accessing its value through ''get()'') * ''"w"'' – if ... (always – don’t ask us why, it’s ''tkinter''’s business) * ''act'' – a string informing us what happ
- 2.5 Working with the Canvas
- line segments. The application can be terminated using the Quit button. Can you find the parts of the ... t this object into a ''PhotoImage'' class object using an ''ImageTk'' function of the same name; * co
- 1.4 Coloring your widgets
- olors and we will tell you about them while discussing the widgets themselves. Currently, the most impo
- 2.1 A small lexicon of widgets - Part 1
- here. Note: there is no ''toggle()'' method as a single ''Radiobutton'' performs such an operation. {