Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- Python Professional Course Series: GUI Programming
- reens: phone, tablet, computer, TV set, fridge, oven, even washing machine or heating controller – all these things have a screen, most of them colored and many (more and more eve... rminals For a very long time (about 30 years or even longer) displays weren’t treated as a part of com
- 2.3 A small lexicon of widgets - Part 3
- user’s actions. Using an ''Entry'' is necessary when you are going to ask the user for any textual inf... rtunately, we don’t need its entire flexibility when we just want to enter and validate a line of text... a number of horizontally deployed **options**, often referred to as **items** or **entries**; * thes... it. Do you see that strange dashed line visible when you click the File main menu item? Don’t worry,
- 1.8 Interacting with widget methods
- with two which seem to be very specific. We can even say that the sense of their existence is very clo... d causes the event manager to change its plans; when the number of milliseconds elapses, the manager *... ible way of controlling the **passage of time** when using an event-driven environment.\\Why? Because you can’t just invoke the built-in ''sleep()'' funct
- 1.2 Let TkInter speak!
- python>from tkinter import *</code> It's handy when you write it, but it can bring some cumbersome troubles when names from the package's namespace cross with som... </code> The main application window (which is often the only window being used by the application) is... turn of the button. A button visible on the screen is, in fact, a reflection of an object of the But
- 1.4 Coloring your widgets
- und'' respectively used by the event controller when the button is **pressed**. Do you want to check h... r widgets to be simply **white**, **black**, **green**, **gray** or even **grey**. It's easy and handy although not very precise. Tkinter can do somethin... ding) **three primary colors**: **red** (R), **green** (G) and **blue** (B). The phenomenon is utilize
- 1.6 Events and how to handle them
- ul method we’ll use to arrange communication between you and your application. Of course, you can use... le the message box** which will appear on the screen; you can use an **empty** string, and the box will be **untitled** then; * the **second** string is a message to displa... g can be of **any length** (but remember, the screen isn’t elastic and won’t stretch if you’re going t
- 1.5 A simple GUI application
- s that sound weird? Maybe, but the application, when ready, will make you more accustomed to some ''tk... ''Button'' will be completely **mute**, as we haven’t bound anything to its command property. You can... inter'' to **organize internal communication between different widgets**. A regular variable can't pla... e of two possible states: * the **ON** state when the ''Checkbutton'' is checked/ticked (which can
- 2.4 Shaping the main window and conversing with the user
- ', no matter what your application is named, or even if it's unnamed. To change the window’s title, y... tle each time you click over it, until you do it ten times, after which the title remains 0. <code py... n. Setting both arguments to ''False'' will stiffen your window completely. Check it out! <code pyt... ", really) window.mainloop() </code> Usually, when you want to announce something to the user or to
- 1.7 Visiting widgets’ properties
- med ''prop'' and you want to read its value and then set it with a new value, you can do this in the f... ainloop() </code> This is what we see on our screen: {{:info:cursos:pue:python-pcpp1:m3:pasted:202312... ="#FF0000") button_2.config(activebackground ="green") window.mainloop() </code> And this is what it... r next widget is an ''anchor''. Don’t worry, we aren’t going to take you out to sea. We’ll stay on dry
- 1.9 Looking at variables
- jects that the contents of the input field have been changed. From a technical point of view, such a ... ow initialization**. Don’t forget this – you’ve been warned! There are **four** kinds (types) of obse... a reference to a function which will be invoked when the specified event occurs. The function returns... ace_mode'' – the mode in which the observer has been created; * ''obsid'' – the observer’s identifie
- 2.1 A small lexicon of widgets - Part 1
- ized set of some of the ''tkinter'' widgets. We aren’t able to describe all of them, however – it woul... ED) def mouseover(ev): button_1['bg'] = 'green' def mouseout(ev): button_1['bg'] = 'red' ... nloop() </code> The ''Radiobutton'' is usable when you **group** (couple) a number (>1) of these wid... button'' creates a group. This also means that when two ''Radiobuttons'' use **different** observable
- 2.5 Working with the Canvas
- canvas.create_arc(10, 100, 380, 300, outline='green', width=5, style=tk.ARC, start=... n object of the ''Image()'' class and use its ''open()'' method to fetch the bitmap from the file (the... idth=400, height=400, bg='red') jpg = PIL.Image.open('logo.jpg') image = PIL.ImageTk.PhotoImage(jpg) c
- 1.3 Settling widgets in the window's interior
- grid'' geometry manager is in the middle, in between the other two geometry managers. It gives you a c... according to them. Note the word general – they aren't as precise as the ones used by place, but are f
- 2.2 A small lexicon of widgets - Part 2
- ame'' has its **own** **coordinate system**, so when you place a widget inside a Frame, you measure it