PyGTK Frame Class - PyGTK

What is PyGTK Frame Class?

Frame class is a subclass of the gtk.Bin class. It draws a attractive border around the child widget placed in it. The frame may comprise a label whose position may be customized.

A gtk.Frame object is constructed with the help of the resulting constructor –

The resulting are the methods of the gtk.Frame() class −

  • set_label(text) − This sets the label as stated by text. If None, the current label is removed.
  • set_label_widget() − This sets a widget other than gtk.Label as label for frame.
  • set_label_align(x, y) − This sets the alignment of the frame's label widget and decoration (defaults are 0.0 and 0.5)
  • set_shadow_type() − This sets the frame's shadow type.

The possible values are −

  • gtk.SHADOW_IN
  • gtk.SHADOW_OUT

The resulting code proves the functioning of the Frame widget. A group of three objects of gtk.RadioButton is placed in an HButtonBox.

In order to draw border around the box, it is located in a Frame widget, and it is added to the toplevel window.


Observe the resulting code –

The above code will generate the resulting output –


All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

PyGTK Topics