Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1 - Main Window Settings We looked into setting options for widgets in the lecture to define things such as size, colour, position, padding

image text in transcribed

Task 1 - Main Window Settings We looked into setting options for widgets in the lecture to define things such as size, colour, position, padding and so on. What we didn't really examine was the main window of the program. The " Tk " class creates this, and it is the first line in the constructor when creating a GUI class: While the "Tk" class creates the main window of an application, additional windows can be created using the "TopLevel" widget/class. The main window is a special type of "TopLevel", and hence most of what you can do to configure a "TopLevel" can be applied to the main window. So how do you do things such as setting the window title and size? That's for you to find out! Do some research and see if you can figure out (and test) how to do the following: - Set the main window title. (Hint: See the lecture examples) - Set the main window size. (Hint: Use the "geometry ()" method) - Prevent the main window from being resized/maximised. (Hint: Use the "resizable()" method) - Change the icon in the top left of the main window. (Hint: Use the "iconbi tmap ()" method) - Find and download an icon file (.ico) here, and place it in the same directory as your code. So far, all of these settings involve calling a method on our main window object (self.main). Hopefully your research informed you of the parameters you need to pass to the methods. Some other aspects of the main window can be configured by using its "configure ()" method, which works similar to setting options for widgets. Find out how to do the following: - Set the background colour of the main window. - Set the cursor to be used when the mouse is over the main window. There's another way of configuring the main window which isn't properly implemented yet. It involves using the main window's "attributes ()" method. Since it isn't properly implemented the settings must be set differently, e.g. instead of "attributes (alpha=0.5)" you must do "attributes ('-alpha', 0.5 )". See the list of settings here or here and try to: - Set the alpha of the main window to make it semi-transparent. - Set the main window to be always on top of other windows. - Set the main window to be full-screen. (Press Alt+F4 to close it)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions