Deck 8: Graphical User Interrfaces

Full screen (f)
exit full mode
Question
GUI-based programs can be configured to respond to various keyboard events and mouse events.
Use Space or
up arrow
down arrow
to flip the card.
Question
GUI-based programs are almost always object-oriented.
Question
The font attribute in tkinger.Label is an object imported from tkinter.font.
Question
Window components are laid out in the window's three-dimensional grid.
Question
The breezypythongui module's IntegerField component is a subclass of the Entry class.
Question
In the RGB system, the value #00ff00 represents the color red.
Question
By default, a window has an empty title string and is resizable.
Question
Command buttons are created and placed in a window in the same manner as labels.
Question
In a GUI-based program, the user can usually alter the size of a window by holding the mouse on its lower-left corner and dragging in any direction.
Question
The attributes of each window component are actually stored in a list.
Question
By default, a newly opened window shrink-wraps around its components and is resizable.
Question
GUI-based programs use windows that contain various components, also called window objects or gadgets.
Question
A method header looks very different from a function header.
Question
The creation of a customized version of an existing class is called subclassing.
Question
The values that can be used within the sticky attribute are "T, D, L, R".
Question
As a rule of thumb, when you are defining a new class of objects, you should look around for a class that already supports some of the structure and behavior of such objects, and then subclass that class to provide the service you need.
Question
A button has a state attribute, which can be set to "enabled" or "disabled".
Question
The Tkinter module supports the CMYK color system, but not the RGB color system.
Question
Command buttons can display text but not images.
Question
The addButton method returns an object of type tkinter.Button.
Question
One of the requirements for a breezypythongui-based Python script you're writing is that you be able to use a slider bar for selecting a value from a range of values. What type of window component do you want?

A) EasySlider
B) Scale
C) SlideRule
D) EasyRange
Question
In the breezypythongui module, what class provides the basic functionality for any window, such as the command buttons in the title bar?

A) WindowFrame
B) ProgFrame
C) BreezyFrame
D) EasyFrame
Question
What two items are included in the class header of a class defined in Python? (Choose two.)

A) The class name, conventionally capitalized.
B) The class arguments.
C) The list of one or more parent classes.
D) The required parameters.
Question
Other than specifying key values when performing the method call to EasyFrame, what can you use to change a window's attributes?

A) You can overload the class and create an identical class.
B) You can utilize the attribute dictionary.
C) You can pass a tuple to the class constructor.
D) You can use the setDefaults() method.
Question
What kind of statement can be used to attempt a graceful recovery from an exception?

A) attempt-fail statement
B) if-else statement
C) try-except statement
D) test-succeed statement
Question
Lists of strings can be displayed in list boxes.
Question
What is NOT one of the more important attributes of a window?

A) The title string.
B) The width and height in pixels.
C) The resizability of the window.
D) The terminal prompt.
Question
A GUI-based program displays a window that contains various components, also known by what specific term?

A) widgets
B) gadgets
C) sprockets
D) doodads
Question
In order to allow a program to respond to a button click, the programmer must set the button's "response" attribute.
Question
Programming that is tied to user-generated actions, such as mouse clicks, is known as what type of programming?

A) user-driven programming
B) event-driven programming
C) access-driven programming
D) object-oriented programming
Question
What two keyword arguments can be used to force a horizontal and/or vertical spanning of grid positions? (Choose two.)

A) gridspan
B) rowspan
C) columnspan
D) gridlock
Question
The values of an object's instance variables make up its state.
Question
What is the "self" parameter utilized for in a class definition block?

A) It is used within the class and method definitions to call other methods on the same object, or to access that object's variables or data.
B) It is used to define the scope of the class in relevance to the rest of the program.
C) It is used to tell the Python virtual machine that the class is locally significant in the particular module or script it is defined.
D) It is used as a shortcut rather than typing out the module name, parent classes, and subclass to which the class belongs.
Question
An entry field is a box in which the user can position the mouse cursor and enter a number or a single line of text.
Question
What is the name of the standard GUI module for Python?

A) tkinter
B) PyQt5
C) breezypythongui
D) Kivy
Question
What happens when you make a new class a subclass of another class?

A) The new class inherits the attributes and behaviors defined in the parent class.
B) The new class becomes subjugated to the parent class, preventing the override of class values.
C) The new class becomes a copy of the ancestor class, and functions under the ancestor class's namespace.
D) The ancestor class and the new class both become global in scope.
Question
When using the EasyFrame class to create a window, what method specifically is used to set up any window components to display in the window?

A) __name__
B) __window__
C) __main__
D) __init__
Question
In a GUI-based program, what are labels supposed to do?

A) They define the title name of the program that is running.
B) They are boxes within which a program can accept input.
C) They are text elements that describe inputs and outputs.
D) They interactive elements in the program that can be used for selections.
Question
GUI-based programs utilize file dialogs in order to allow the user to browse a computer's file system.
Question
What EasyFrame method is used to specify if a window is resizable or not?

A) setEnableResize()
B) chgResize()
C) setWindowAttrib()
D) modWindowSize()
Question
What attribute can be used to override the default alignment of a window component?

A) align
B) sticky
C) target
D) orientation
Question
What are the two functions available in the tkinter.filedialog module used to support file access in a GUI program?

A) askopenfileaccess
B) askfilesystemaccess
C) asksaveasfilename
D) askopenfilename
Question
In GUI terminology, what is the name used to describe a rectangular window component with its own grid that is useful for organizing other window components?

A) layout
B) superframe
C) panel
D) combo frame
Question
What scenario would be ideal for the use of a prompter box?

A) You require a GUI element that restricts a user to a single choice of items out of a group of items.
B) You require a GUI element to display an error message upon incorrect input.
C) You require a GUI element to prompt for a user's text input.
D) You require a GUI element to allow a large amount of text to be entered by the user.
Question
How can you associate a keyboard event and an event-handling method with a widget?

A) You must name the event-handling method "onPress_".
B) You must use the bind method, which expects a string containing a key event.
C) You must map a shortcut in the host operating system to run the script with a specific argument.
D) You must define the key's event in a YAML-based configuration file.
Question
What argument can be specified to the two file dialog functions in order to specify the available file types that can be used?

A) defaultextension
B) filetypes
C) fileformat
D) filedata
Question
In the RGB system, what hexadecimal value represents the color black?

A) #000000
B) #ffffff
C) #ff00ff
D) #00ffff
Question
What class in the breezypythongui module provides a scrollable box for the display and selection of items?

A) EasyTextField
B) TextArea
C) EasyListbox
D) EasyIntegerField
Question
What scenario would be ideal for the use of a check button?

A) You require a GUI element that restricts a user to a single choice of items out of a group of items.
B) You require a GUI element to display an error message upon incorrect input.
C) You require a GUI element to prompt for a user's text input.
D) You require a GUI element that can be grouped with other elements that can be selected at the same time.
Question
When passing color values to the tkinter module in hexadecimal, what hex string represents the color red?

A) #ff0000
B) #00ff00
C) #0000ff
D) #ff00ff
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 8: Graphical User Interrfaces
1
GUI-based programs can be configured to respond to various keyboard events and mouse events.
True
2
GUI-based programs are almost always object-oriented.
True
3
The font attribute in tkinger.Label is an object imported from tkinter.font.
True
4
Window components are laid out in the window's three-dimensional grid.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
The breezypythongui module's IntegerField component is a subclass of the Entry class.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
In the RGB system, the value #00ff00 represents the color red.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
By default, a window has an empty title string and is resizable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
Command buttons are created and placed in a window in the same manner as labels.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
In a GUI-based program, the user can usually alter the size of a window by holding the mouse on its lower-left corner and dragging in any direction.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
The attributes of each window component are actually stored in a list.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
By default, a newly opened window shrink-wraps around its components and is resizable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
GUI-based programs use windows that contain various components, also called window objects or gadgets.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
A method header looks very different from a function header.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
The creation of a customized version of an existing class is called subclassing.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The values that can be used within the sticky attribute are "T, D, L, R".
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
As a rule of thumb, when you are defining a new class of objects, you should look around for a class that already supports some of the structure and behavior of such objects, and then subclass that class to provide the service you need.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
A button has a state attribute, which can be set to "enabled" or "disabled".
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The Tkinter module supports the CMYK color system, but not the RGB color system.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Command buttons can display text but not images.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
The addButton method returns an object of type tkinter.Button.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
One of the requirements for a breezypythongui-based Python script you're writing is that you be able to use a slider bar for selecting a value from a range of values. What type of window component do you want?

A) EasySlider
B) Scale
C) SlideRule
D) EasyRange
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
In the breezypythongui module, what class provides the basic functionality for any window, such as the command buttons in the title bar?

A) WindowFrame
B) ProgFrame
C) BreezyFrame
D) EasyFrame
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
What two items are included in the class header of a class defined in Python? (Choose two.)

A) The class name, conventionally capitalized.
B) The class arguments.
C) The list of one or more parent classes.
D) The required parameters.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Other than specifying key values when performing the method call to EasyFrame, what can you use to change a window's attributes?

A) You can overload the class and create an identical class.
B) You can utilize the attribute dictionary.
C) You can pass a tuple to the class constructor.
D) You can use the setDefaults() method.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
What kind of statement can be used to attempt a graceful recovery from an exception?

A) attempt-fail statement
B) if-else statement
C) try-except statement
D) test-succeed statement
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Lists of strings can be displayed in list boxes.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
What is NOT one of the more important attributes of a window?

A) The title string.
B) The width and height in pixels.
C) The resizability of the window.
D) The terminal prompt.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
A GUI-based program displays a window that contains various components, also known by what specific term?

A) widgets
B) gadgets
C) sprockets
D) doodads
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
In order to allow a program to respond to a button click, the programmer must set the button's "response" attribute.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
Programming that is tied to user-generated actions, such as mouse clicks, is known as what type of programming?

A) user-driven programming
B) event-driven programming
C) access-driven programming
D) object-oriented programming
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
What two keyword arguments can be used to force a horizontal and/or vertical spanning of grid positions? (Choose two.)

A) gridspan
B) rowspan
C) columnspan
D) gridlock
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
The values of an object's instance variables make up its state.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
What is the "self" parameter utilized for in a class definition block?

A) It is used within the class and method definitions to call other methods on the same object, or to access that object's variables or data.
B) It is used to define the scope of the class in relevance to the rest of the program.
C) It is used to tell the Python virtual machine that the class is locally significant in the particular module or script it is defined.
D) It is used as a shortcut rather than typing out the module name, parent classes, and subclass to which the class belongs.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
An entry field is a box in which the user can position the mouse cursor and enter a number or a single line of text.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
What is the name of the standard GUI module for Python?

A) tkinter
B) PyQt5
C) breezypythongui
D) Kivy
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
What happens when you make a new class a subclass of another class?

A) The new class inherits the attributes and behaviors defined in the parent class.
B) The new class becomes subjugated to the parent class, preventing the override of class values.
C) The new class becomes a copy of the ancestor class, and functions under the ancestor class's namespace.
D) The ancestor class and the new class both become global in scope.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
When using the EasyFrame class to create a window, what method specifically is used to set up any window components to display in the window?

A) __name__
B) __window__
C) __main__
D) __init__
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
In a GUI-based program, what are labels supposed to do?

A) They define the title name of the program that is running.
B) They are boxes within which a program can accept input.
C) They are text elements that describe inputs and outputs.
D) They interactive elements in the program that can be used for selections.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
GUI-based programs utilize file dialogs in order to allow the user to browse a computer's file system.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
What EasyFrame method is used to specify if a window is resizable or not?

A) setEnableResize()
B) chgResize()
C) setWindowAttrib()
D) modWindowSize()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
What attribute can be used to override the default alignment of a window component?

A) align
B) sticky
C) target
D) orientation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
What are the two functions available in the tkinter.filedialog module used to support file access in a GUI program?

A) askopenfileaccess
B) askfilesystemaccess
C) asksaveasfilename
D) askopenfilename
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
In GUI terminology, what is the name used to describe a rectangular window component with its own grid that is useful for organizing other window components?

A) layout
B) superframe
C) panel
D) combo frame
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
What scenario would be ideal for the use of a prompter box?

A) You require a GUI element that restricts a user to a single choice of items out of a group of items.
B) You require a GUI element to display an error message upon incorrect input.
C) You require a GUI element to prompt for a user's text input.
D) You require a GUI element to allow a large amount of text to be entered by the user.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
How can you associate a keyboard event and an event-handling method with a widget?

A) You must name the event-handling method "onPress_".
B) You must use the bind method, which expects a string containing a key event.
C) You must map a shortcut in the host operating system to run the script with a specific argument.
D) You must define the key's event in a YAML-based configuration file.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
What argument can be specified to the two file dialog functions in order to specify the available file types that can be used?

A) defaultextension
B) filetypes
C) fileformat
D) filedata
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
In the RGB system, what hexadecimal value represents the color black?

A) #000000
B) #ffffff
C) #ff00ff
D) #00ffff
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
What class in the breezypythongui module provides a scrollable box for the display and selection of items?

A) EasyTextField
B) TextArea
C) EasyListbox
D) EasyIntegerField
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
What scenario would be ideal for the use of a check button?

A) You require a GUI element that restricts a user to a single choice of items out of a group of items.
B) You require a GUI element to display an error message upon incorrect input.
C) You require a GUI element to prompt for a user's text input.
D) You require a GUI element that can be grouped with other elements that can be selected at the same time.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
When passing color values to the tkinter module in hexadecimal, what hex string represents the color red?

A) #ff0000
B) #00ff00
C) #0000ff
D) #ff00ff
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.