Exam 4 Flashcards
What are the 5 main python GUI options?
Tkinter -> part of PSL
QT -> Very popular, works x-platform
Kivy -> mobile focus
wxWidgets -> works x-platform
GTK+ > works x-platform
What are the 4 components of the event paradigm?
1) Event Loop- built-in loop constantly running (waiting) but not consuming too many CPU cycles
2) Events/signals- interaction w/ user triggers an event
3) Event Handler- chunk of code that does something in response to an event
4) Registration- tie the function and event together
what is the main window for TKinter GUI?
Tk()
What does Tk.mainloop() do?
Launches the Gui and takes over thread
This Tkinter widget is a single line user text input field
Entry
What Tkinter widget is used to draw complex layouts and images?
Canvas
What TKinter widget acts as a container enabling grouping and organization of other widgets
Frame
What Tkinter widget is used for a single-line caption to another widget?
Label
What Tkinter widget is used to present a user with a list of options?
Listbox
What is the Tkinter dropdown menu widget used to generate a pop-up list of items within a selection?
OptionMenu
What Tkinter widget provides a multiline text field for user input?
Text
Tkinter widget for checkbox options list
CheckButton
What is the Tkinter radio button widget?
RadioButton
Tkinter widget for a graphical slider allowing for value selection from a range
Scale
what Tkinter widget acts a container for non-entry widgets
LabelFrame
widget allowing users to select from a range of values by toggling up or down arrows
Spinbox
widget allowing users to select from a range of values by toggling up or down arrows
Spinbox
What tk widget is a combination of an Entry widget and a Listbox widget?
Combobox - A combobox widget allows you to select one value in a set of values. In addition, it allows you to enter a custom value
What are the three Tkinter geometry/layout managers?
pack, grid, and place
this ttk widget allows you to select pages of contents by clicking tabs
Notebook
What Tkinter widget allows you to give feedback to user about the progress of a long-running task?
ttk.Progressbar
which TKinter widget should you use to display data in tabular or hierarchical structures?
ttk.Treeview
this Tkinter widget places a thin horizontal or vertical rule btwn widgets
ttk.Separator
Which Tkinter widgets have a command property and allow you to ‘Hook early’
Clickables- buttons, menu items, radio and check buttons
what is the general syntax for TKinter event binding?
widget.bind(“«name of the event»”, callback function)
What are the four Tkinter binding variables?
StringVar(), IntVar(), DoubleVar(), and BooleanVar()
syntax for changing text on a label in Tkinter
somelabel[‘text’] = ‘some new text’
what are the keywords of the Pack() geometry manager?
left, right, bottom, top
what are the keywords of the Grid() geometry manager?
N, S, E, W, NE, NW, SE, SW
how are widgets placed using the Place() geometry manager?
absolute (pixel) location
what Tkinter widget allows you to mix the three geometry managers within a single TK()?
Frame
what are the four main categories of TKinter dialogues
1) messagebox -> decision and no decision variants
2) simpledialog -> single value data entry
3) filedialog
4) colorchooser
what are the two GUI graphical designers for TKinter?
Pygubu and Page
what are the popular bindings for QT and Python?
QT Wiki, QtPy, PyQt4, PyQt5, Pyside, Pyside 2, Pyside 3 (only for Qt6)