[gtkmm] packing options problem when adding a widget containing widgets



I created a child class of Vbox which contains others widgets.
when I add this new VBox in my main window it does not respect
the expanding/filling properties...
If I do that directly in the main window (without my class)
it's okay but I can't reuse it.

Can anybody help me?

my_box.h file
class My_vbox : public Gtk::VBox


my_box.cpp file
My_vbox::My_vbox( )
{
  previous.set_label("prev");
  next.set_label("nxt ");

  treeview.set_model( m_refListStore );
  treeview.append_column( "" , model_admin.m_col_name );
  treeview.columns_autosize( );
  Gtk::CellRenderer * cr;
  cr = treeview.get_column_cell_renderer( 0 );
  cr ->set_fixed_size( -1 , 29 );

//  treeview.set_size_request( 50, 300 );

  scrolled_window.set_shadow_type(Gtk::SHADOW_NONE);
  scrolled_window.set_policy(Gtk::POLICY_NEVER,
Gtk::POLICY_AUTOMATIC);

 scrolled_window.property_window_placement().set_value(Gtk::CORNER_TOP_LEFT);
  
  scrolled_window.add( treeview );

  dummy.set_sensitive( false );
  dummy.set_relief( Gtk::RELIEF_NONE );
  btn_box.pack_start( previous, Gtk::EXPAND|Gtk::FILL, 0 );
  btn_box.pack_start( dummy, Gtk::FILL, 0 );
  btn_box.pack_start( next, Gtk::EXPAND|Gtk::FILL, 0 );

  pack_start( scrolled_window, Gtk::EXPAND|Gtk::FILL, 0 );
  pack_start( btn_box, Gtk::FILL, 0 );

}


in the main window :

My_vbox my_vbox;
widget_box.pack_start( my_vbox, Gtk::EXPAND|Gtk::FILL, 0 );
add(widget_box);



Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34?/mn) ; tél : 08 92 68 13 50 (0,34?/mn)






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]