Cerca

Heus ací els resultats de la cerca.

Python Professional Course Series: GUI Programming
28 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!
17 Resultats, Darrera modificació:
parately. As you already now, such an import will force you to use the qualified names of tkinter’s com... h time you make use of their contents, you can perform an import which **renames** the package (precise... 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
1.3 Settling widgets in the window's interior
13 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 not live up to your expectations, and the final result... aware of the window it belongs to (it gets the information from the constructor's very first argument)
1.4 Coloring your widgets
12 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... describing the second set of colors named ''activeforeground'' and ''activebackground'' respectively us
1.6 Events and how to handle them
12 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
12 Resultats, Darrera modificació:
n be **observed** by a number of external agents. For example, the ''Entry'' widget can use its own observable variable to inform other objects that the contents of the input fie... 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'';
2.4 Shaping the main window and conversing with the user
10 Resultats, Darrera modificació:
e>'', which enables the other widgets to react. Unfortunately, this doesn’t work with the main window. ... module. We showed you some of its possibilities before, but now we want to summarize the issue and to p... 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
1.7 Visiting widgets’ properties
8 Resultats, Darrera modificació:
tring, although it specifies strictly numerical information; * the three-element tuple uses the third... tion? Of course you do! The property responsible for storing font information is – obviously – named ''font''. We’ve used the ''Label'' widget to demonstr... f text if the widget is able to present textual information). The list of widget sizes is gathered in
2.3 A small lexicon of widgets - Part 3
8 Resultats, Darrera modificació:
' is necessary when you are going to ask the user for any textual information: name, password, email, etc. The widget implements all standard edit operation... 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
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
5 Resultats, Darrera modificació:
inloop() </code> Our window looks like this one for now: {{ :info:cursos:pue:python-pcpp1:m3:pasted:2... lickable widget able to **present short textual information**, passed to the widget's constructor using... 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()''.
2.1 A small lexicon of widgets - Part 1
4 Resultats, Darrera modificació:
e different sets of arguments. As we mentioned before, all widgets fall into two categories: **clickab... special attention, as we’ve used it many times before. You already know what it looks like and how it ... ode in the editor pane. The sample we’ve prepared for you makes use of the ''checkbutton'' and does two... 'toggle()'' method as a single ''Radiobutton'' performs such an operation. {{:info:cursos:pue:python-p
2.2 A small lexicon of widgets - Part 2
4 Resultats, Darrera modificació:
tegory. They’re designed to present **textual** information and don’t have a ''command'' property, alth... 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
3 Resultats, Darrera modificació:
callbacks – it would **freeze** your application for the whole nap time; the ''after()'' method return... e initially encourage it to make the invocation before the frame widget is packed into the main window;... //Tab// and //Shift-Tab// keys to move the focus forward and backward, but the focus can be controlled