Cerca

Heus ací els resultats de la cerca.

1.2 Let TkInter speak!
22 Resultats, Darrera modificació:
from Python's point of view TkInter is a package named **tkinter**. The package contains a bunch of fun... uch an import will force you to use the qualified names of tkinter’s components. If you don’t like to write long package names each time you make use of their contents, you can perform an import which **renames** the package (precisely: which creates an **ali
1.6 Events and how to handle them
12 Resultats, Darrera modificació:
y. The function we’ll use for our experiments is named ''showinfo()'', it comes from the ''messagebox''... nd **property nor a constructor parameter of that name**. Fortunately, you’re still able to bind a call... clicks, of course) and this is done with a method named – it couldn’t be anything else – ''bind()'': <c... are the events identified? * **A**: By **unique names** – each event has its own name and the name is
1.7 Visiting widgets’ properties
12 Resultats, Darrera modificació:
xists inside every widget. Assuming that a widget named ''Widge''t has a property named ''prop'' and you want to read its value and then set it with a new val... lies on two specialized widget methods, the first named ''cget()'' designed to **read** the property’s value, and the second named ''config()'', which allows you to **set** a new
2.4 Shaping the main window and conversing with the user
10 Resultats, Darrera modificació:
set to ''Tk'', no matter what your application is named, or even if it's unnamed. To change the window’s title, you would use a method named ''title()''. Our sample code shows a window whi... n-default way, you have to use a low-level method named ''geometry()'', whose only argument looks a bit
1.4 Coloring your widgets
6 Resultats, Darrera modificació:
nce here – we've just made use of regular English names of colors and packed them inside strings. Does ... al parameters describing the second set of colors named ''activeforeground'' and ''activebackground'' re... lt saying that any of commonly used English color name can be used with ''tkinter''. Don't bother if you... ou. Tkinter recognizes over 750 predefined color names – all of them can be found [[https://www.tcl.tk/
1.9 Looking at variables
6 Resultats, Darrera modificació:
anVar * DoubleVar * IntVar * StringVar The names you see are also the constructors’ names, so if you want to use any of the variables, you must invoke ... servable variable, you have to invoke its method, named ''set()'', and pass an argument to it. The argum... n a variable, you have to use the variable method named ''get()'': <code python> sn = strng.get() </code
Python Professional Course Series: GUI Programming
5 Resultats, Darrera modificació:
find some traces of these inspirations in widget names. Don't be surprised. One of the widgets living ... 31222-020429.png }} Inside the title bar (as the name suggests) there is a window **title**. Of course,... are of it. Let's imagine that we have a function named ''DoSomething()'' which... does something. We wa... (two of the most widespread in the U*x world are named GTK and Qt). This means that if we want to buil
1.5 A simple GUI application
4 Resultats, Darrera modificació:
icated method for that purpose, and the method is named ''set()''. Note: we've used the method to store... and internally an extremely complicated, widget, named ''Entry''. Look at the code in the editor. <cod... enter simple, one-line data, like single numbers, names, addresses, etc. We’ve added one to our window.... t to ''1'', we expect the second ''Radiobutton'' (named ''Salad'') to be selected when the application s
2.3 A small lexicon of widgets - Part 3
4 Resultats, Darrera modificació:
oing to ask the user for any textual information: name, password, email, etc. The widget implements all ... n add a separator to it. This is done by a method named... ''add_separator()'', of course. <code python... rform two steps: * **set** the item’s property named ''accelerator'' with a string naming the hot-key... a menu’s item, you should use a dedicated method named ''entryconfigure()''. The method accepts two par
2.5 Working with the Canvas
4 Resultats, Darrera modificació:
create a canvas. This is done with a constructor named Canvas(). <code python> c = Canvas(master, opti... create a polygonal chain, you need to use the one named ''create_line()'': <code python> canvas.create_l... * is, in fact, a specific ellipse) needs a method named create_oval(): <code python> c.create_eclipse(x... object using an ''ImageTk'' function of the same name; * continue as usual. The example in the editor
1.8 Interacting with widget methods
3 Resultats, Darrera modificació:
atures of **event programming**. The methods are named (assuming that ''Widget'' is an existing widget)... e manager’s calendar, which is done with a method named… * ''after_cancel(id)'' – the method cancels t... see it in the editor window. There’s a function named ''blink()'', which changes the f frame’s backgro
1.3 Settling widgets in the window's interior
1 Resultats, Darrera modificació:
. The third, fully automatic geometry manager is named ''pack()'' as it **packs subsequent widgets** in