c++ - GTK y-axis padded label doesn't vertically ALIGN_BOTTOM? -
i'm trying align label there space on top , not on bottom. want 30 between label1 , label2 not between label2 , label3. set label2 y padding 30 , on label2 y gtk::align_bottom, doesn't seem work. instead end looks in screenshot 30 on top , 30 on bottom of label2. know there ways around want know wrong code? can't figure out. tried changing pack options didn't work.
here screenshot , here sample code:
int main( int argc, char *argv[] ) { gtk::main kit( argc, argv ); gtk::window window; window.set_default_size( 400, 400 ); gtk::label label1( "this first label." ); gtk::label label2( "this second label." ); gtk::label label3( "this third label." ); label2.set_padding( 0, 30 ); label2.set_alignment( gtk::align_right, gtk::align_bottom ); gtk::vbox vbox; vbox.pack_start( label1, false, false, 0 ); vbox.pack_start( label2, false, false, 0 ); vbox.pack_start( label3, false, false, 0 ); window.add( vbox ); window.show_all_children(); gtk::main::run( window ); return 0; }
thanks
you'll need (untested):
gtk::alignment alignment( 0.0, 1.0, 0.0, 0.0 ); alignment.set_padding( 30, 0, 0, 0 ); alignment.add( label2 );
the problem label.set_alignment()
doesn't align within padding, within leftover space allocated widget.
Comments
Post a Comment