Padding of a Gtk::Frame

Hi,

I am trying to stuff some widgets into a Gtk::Frame. My question is, how
to enable padding of those widgets - or the main widget?

This here won’t work:

frame = Gtk::Frame.new
frame.pack_start(main_box,false,false,20)

I would like to have a padding of ~5 pixels for all the widgets inside
frame, but I am not sure how to do that easily without .pack_start

Hi,

Marc H. schrieb:

I am trying to stuff some widgets into a Gtk::Frame. My question is, how
to enable padding of those widgets - or the main widget?

This here won’t work:

frame = Gtk::Frame.new
frame.pack_start(main_box,false,false,20)

I would like to have a padding of ~5 pixels for all the widgets inside
frame, but I am not sure how to do that easily without .pack_start

Gtk::Frame is a child of Gtk::Container → Gtk::Bin so you have to use
the add or “<<” methodes to add a child and not pack_start. If you want
to add more than one child, you have to add an other container like a
Gtk::VBox or a Gtk::Table first.

The padding on all sides is controlled with Gtk::Containers
set_border_width method.

Cheers,

detlef


http://det.cable.nu

Thanks Detlef