Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 1.6 Events and how to handle them
- he 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 callbacks, which makes you responsible for preparing t... ume); note: you can use the ''\n'' digraph to visually break the info into separate lines. We’ll ask t
- 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. L... ven, even washing machine or heating controller – all these things have a screen, most of them colored ... nicate with the user. They communicate bidirectionally. GUI stands for Graphical User Interface. In th... ed as a part of computers. A computer (sometimes called a **mainframe**) was a very big box (much, much
- 2.3 A small lexicon of widgets - Part 3
- = 2.3 A small lexicon of widgets - Part 3 There are two remaining widgets we want to tell you about – t... name, password, email, etc. The widget implements all standard edit operations like inserting, removing... n **observable variable** along with the **trace callback** (tracer) to force a user to enter **only digits** – all other characters will be silently **ignored**. T
- 1.2 Let TkInter speak!
- ; * **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 sim... code python>import tkinter</code> Note: it won’t allow you to access some modules built-in within the ... up to you. If you like to have full control over all your source code, you can make the import process
- 2.4 Shaping the main window and conversing with the user
- window = tk.Tk() window.title('Icon?') window.tk.call('wm', 'iconphoto', window._w, PhotoImage(file='lo... communicating with the OS’s window manager. The call asks the OS to exchange the window’s icon with th... window = tk.Tk() window.title('Icon?') window.tk.call('wm', 'iconphoto', window._w, PhotoImage(file='lo... e into consideration how the change can influence all your widgets. Our sample code in the editor show
- 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 widget... overlap each other or to place some of them, partially or fully, outside the window. If you don't want to deploy the widgets manually and worry about possible conflicts and failures,... your expectations, and the final result can be really disappointing. This method of settling widgets i
- 1.4 Coloring your widgets
- hat these ways are universal and can be used virtually everywhere. Let's check if tkinter understands ... nter recognizes over 750 predefined color names – all of them can be found [[https://www.tcl.tk/man/tcl... blue** (B). The phenomenon is utilized by the so-called **RGB color model** which is one of the additiv... rent kinds. One of the RGB model implementations allows you to set the **saturation** of every of prim
- 1.5 A simple GUI application
- thing to this dull gray area. Our new friend is called ''Label'' – a non-clickable widget able to **pr... resizes the window to a size large enough to fit all the packed widgets. This is its default behavior.... ed to **group widgets** and to separate them (visually) from other window components. Our ''Frame'' pla... our window – it’s a ''Checkbutton''. It’s a **small square** which can be filled with a **tick mark**
- 2.1 A small lexicon of widgets - Part 1
- = 2.1 A small lexicon of widgets - Part 1 == A small lexicon of widgets Now we’re ready to present a systematized se... e ''tkinter'' widgets. We aren’t able to describe all of them, however – it would bloat our course to a... erent sets of arguments. As we mentioned before, all widgets fall into two categories: **clickable** a
- 2.2 A small lexicon of widgets - Part 2
- = 2.2 A small lexicon of widgets - Part 2 == Non-clickable widgets The next four widgets fall into the **non-clickable** category. They’re desi... rties, but you need to remember that they are mutually exclusive. Here you are: {{:info:cursos:pue:pyt... ormat** the presented text by fitting it automatically to the widget’s size. <code python> message = M
- 1.8 Interacting with widget methods
- built-in ''sleep()'' function within any of your callbacks – it would **freeze** your application for t... by the **id** argument. Seems confusing? Not at all. The example will shed more light on it than tell... nside the code. Moreover, it isn’t assigned as a callback. The question is – who invokes it? The event managers do, because: * we initially encourage it to make the invocation before the f
- 1.7 Visiting widgets’ properties
- **object property**. Although every widget is actually an object, you can access its properties by usin... s value, and the second named ''config()'', which allows you to **set** a new value to the property. T... es describing many more sizes than just width (usually specified in pixels) and height (which can be sp... is used when you don’t set the anchor property at all. Let’s do some tests. Look at the code in the
- 1.9 Looking at variables
- ns, Tkinter uses a very special kind of variable called an **observable variable**. This variable works... vers**. An observer is a **function** (a kind of callback) which will be invoked automatically each time a specified event occurs in the variable’s life. T
- 2.5 Working with the Canvas
- neither palette nor easel – ''Canvas'' brings you all you need. Let’s start with a simple example. Ta... an you find the parts of the code responsible for all these actions? {{:info:cursos:pue:python-pcpp1:m... the last points) in the chain is drawn **automatically** (you don’t need to specify the same point as t