PyGTK library offers dissimilar container classes to control the placement of widgets inside a window. The coolest way is to use a fixed container class and place a widget inside it by stating its complete coordinates measured in pixels.
Let us now follow these steps −
Step 1 − Declare an object of the fixed class
Step 2 − Make a button widget and add it to the fixed container by using put() method which needs x and y coordinates. Here, the button will be placed at (100,100) position.
Step 3 − You can place multiple controls in the fixed container. And, add it to the top-level window and invoke the show_all() method
This Absolute Layout, on the other hand, is not suitable because of the resulting reasons −
The following is the original window –
The following is the resized window −
The position of the button is unchanged here.
PyGTK API offers container classes for improved management of placing of widgets inside the container. The benefits of Layout managers over absolute positioning are −
gtk.Container acts as the base class for the following classes −
PyGTK Related Interview Questions
|Python Interview Questions||PHP Interview Questions|
|Ruby on Rails Interview Questions||Ubuntu Certified Professional Interview Questions|
|Django Interview Questions||GNU Image Manipulation Program(GIMP) Interview Questions|
|TurboGears Interview Questions||Lisp programming Interview Questions|
|wxPython Interview Questions||Basic C Interview Questions|
|Python Automation Testing Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.