Cerca

Heus ací els resultats de la cerca.

Python Professional Course Series: GUI Programming
23 Resultats, Darrera modificació:
T industry. Okay, that’s enough jokes about TLA’s for one course, all the more that GUI is present near... er. They communicate bidirectionally. GUI stands for Graphical User Interface. In this three-word acro... ack. Are you ready? Okay, let’s go! == Terminals For a very long time (about 30 years or even longer) ... terminal needed to be wired to a computer (don’t forget that the Internet had not been invented yet) a
1.2 Let TkInter speak!
13 Resultats, Darrera modificació:
parately. As you already now, such an import will force you to use the qualified names of tkinter’s com... s tk</code> Okay, we know there’s no accounting for taste, but it’s definitely worth accounting for code readability. The choice is entirely up to you. I... ink we're going to discourage you from using this form. It's only a warning. Or rather a piece of frien
1.3 Settling widgets in the window's interior
11 Resultats, Darrera modificació:
nagers**. ''Place'' is the most detailed one. It forces you to **precisely declare a widget's location... your intentions and to **find the best location** for each widget. Unfortunately, its assumptions may n... w.mainloop() </code> The snippet we've prepared for you shows how the ''place()'' method works. It p... g }} Now let's play with ''width'' and ''height'' for a moment. Look, we've added some arguments to th
1.6 Events and how to handle them
11 Resultats, Darrera modificació:
me **to the event manager**, which is responsible for dispatching them to all the application component... me of your callbacks, which makes you responsible for preparing the proper reactions to the user’s acti... nd how you control the event manager’s behavior. For now, however, we want you to focus your attention... o behave in a mature way. The function we’ll use for our experiments is named ''showinfo()'', it comes
1.9 Looking at variables
10 Resultats, Darrera modificació:
n be **observed** by a number of external agents. For example, the ''Entry'' widget can use its own obs... e **after the main window initialization**. Don’t forget this – you’ve been warned! There are **four**... y created variables are set to: * integer ''0'' for ''IntVar''; * float ''0.0'' for ''DoubleVar''; * Boolean ''False'' for ''BooleanVar''; * string
1.4 Coloring your widgets
9 Resultats, Darrera modificació:
about them on the example of ''Button'' but don't forget that these ways are universal and can be used ... e constructor invocation: ''bg'' (what is a short form of //“background-color”//) and ''fg'' (//“foreground-color”//). We went along the line of least resis... not very precise. Tkinter can do something more for you. Tkinter recognizes over 750 predefined colo
2.4 Shaping the main window and conversing with the user
7 Resultats, Darrera modificació:
functions display a modal dialog window and wait for a user response. The dialog’s behavior is determi... d YES; * **icon** – sets the non-default icon for the dialog: possible values are: ERROR, INFO, QUE... ons titled ''OK'' and ''Cancel'' (it returns True for OK and False otherwise). You can observe its beh... nswer = messagebox.askokcancel("?", "I'm going to format your hard drive") print(answer) window =
2.3 A small lexicon of widgets - Part 3
6 Resultats, Darrera modificació:
' is necessary when you are going to ask the user for any textual information: name, password, email, e... get, as it’s full equipment is extremely complex. Fortunately, we don’t need its entire flexibility whe... e** along with the **trace callback** (tracer) to force a user to enter **only digits** – all other cha... teps you already know – look, we’ve engaged the ''for'' loop to simulate the presence of eight recently
2.5 Working with the Canvas
6 Resultats, Darrera modificació:
to the ''Canvas'' facilities. It can do much more for you – for example, it can scroll itself and react to many events – we hope you’ll explore these issues... . Can you find the parts of the code responsible for all these actions? {{:info:cursos:pue:python-pcp... ecomes a **circle**. The options are the same as for ''create_polygon()''. Let’s test it. Run the cod
1.5 A simple GUI application
4 Resultats, Darrera modificació:
inloop() </code> Our window looks like this one for now: {{ :info:cursos:pue:python-pcpp1:m3:pasted:2... lls it with its own color. We expect nothing more for now. Let's check it out. <code python> import t... ent operator. The class offers a dedicated method for that purpose, and the method is named ''set()''. ... bound to the same object creates the group. Don’t forget that! * The ''value'' argument distinguishes
1.7 Visiting widgets’ properties
3 Resultats, Darrera modificació:
tion? Of course you do! The property responsible for storing font information is – obviously – named '... l free to experiment with the colors of the font, foreground, and background to make the button look mo... ee of them. Feel free to test all the rest. Don’t forget to move the cursor over the frames. You won’t
2.2 A small lexicon of widgets - Part 2
3 Resultats, Darrera modificació:
it has the **same properties**) but is able to **format** the presented text by fitting it automatical... /. Such a //window works// as a **master widget** for all the widgets embedded within it. Moreover, the... ach. Note: we’ve used different geometry managers for both ''Frames''. This is another advantage of the
1.8 Interacting with widget methods
2 Resultats, Darrera modificació:
callbacks – it would **freeze** your application for the whole nap time; the ''after()'' method return... //Tab// and //Shift-Tab// keys to move the focus forward and backward, but the focus can be controlled
2.1 A small lexicon of widgets - Part 1
1 Resultats, Darrera modificació:
ode in the editor pane. The sample we’ve prepared for you makes use of the ''checkbutton'' and does two