Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- Python Professional Course Series: GUI Programming
- = Python Professional Course Series: GUI Programming == What is GUI? GUI is an acronym. Moreover, it’s... , that’s enough jokes about TLA’s for one course, all the more that GUI is present nearly everywhere. ... 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 t
- 1.6 Events and how to handle them
- s and how to handle them == Event handling As you already know, events are the 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 callback
- 2.4 Shaping the main window and conversing with the user
- import tkinter as tk def click(*args): global counter if counter > 0: counter -= 1 ... o in a portable way. Here’s one working solution, although we agree it’s not very elegant. Take a loo... window = tk.Tk() window.title('Icon?') window.tk.call('wm', 'iconphoto', window._w, PhotoImage(file='l... it directly invokes one of the ''tkinter'' internal, low-level mechanisms directly communicating with
- 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 – ... ' widget not only presents a line of text, but is also able to **edit** the text according to the user... y when you are going to ask the user for any textual information: name, password, email, etc. The widget implements all standard edit operations like inserting, removin
- 1.2 Let TkInter speak!
- .2 Let TkInter speak! == Importing TkInter As you already know, from Python's point of view TkInter is... he GUI application itself consists of four essential elements: * **importing** the needed **tkinter... ; * **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 s
- 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 widge... 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... may not live up to your expectations, and the final result can be really disappointing. This method o
- 1.7 Visiting widgets’ properties
- g widgets’ properties == Widget properties As you already know, every widget has a set of properties, ... et's property is not just an **object property**. Although every widget is actually an object, you can access its properties by using the dot notation. Yo... e ways of reading and setting widget properties’ values. The first method is based on using a **dicti
- 1.5 A simple GUI application
- ' **habits** and **conventions**. Our fabulous goal will look like the vision presented below: {{ :in... thing to this dull gray area. Our new friend is called ''Label'' – a non-clickable widget able to **present short textual information**, passed to the widget's constructor... resizes the window to a size large enough to fit all the packed widgets. This is its default behavior
- 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 ... e ''tkinter'' widgets. We aren’t able to describe all of them, however – it would bloat our course to ... to carry out your own experiments and tests. You already know some of the widgets. In these cases, we
- 1.4 Coloring your widgets
- ton'' but don't forget that these ways are universal and can be used virtually everywhere. Let's check if tkinter understands **English** – look at the c... ”//) and ''fg'' (//“foreground-color”//). We went along the line of least resistance here – we've just... fer to **raised** buttons only. There two additional parameters describing the second set of colors na
- 1.9 Looking at variables
- t some of its functions, Tkinter uses a very special kind of variable called an **observable variable**. This variable works like a regular variable (i.e., it’s able to store values which are accessible to the outside world) but... ’s state can be **observed** by a number of external agents. For example, the ''Entry'' widget can use
- 1.8 Interacting with widget methods
- idgets have **methods** – you’ve met some of them already. Now we’re going to show you a few more of t... xpects two arguments: the first is a **time interval specification** (expressed in milliseconds: 1 s =... built-in ''sleep()'' function within any of your callbacks – it would **freeze** your application for ... whole nap time; the ''after()'' method returns a value which is as specific as the method itself – it’
- 2.5 Working with the Canvas
- t your new adventure. This will require neither palette nor easel – ''Canvas'' brings you all you need. Let’s start with a simple example. Take a look ... round. Next, it draws a line (precisely: a polygonal **chain**) consisting of three line segments. The... an you find the parts of the code responsible for all these actions? {{:info:cursos:pue:python-pcpp1:
- 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 designed to present **textual** information and don’t have a ''command'' property, although you can use ''bind()'' to simulate similar