Re: [gtkmm] Widget size bug?



On Fri, 2004-07-30 at 17:55, Miller, Ryan D wrote:
[snip]
>     this->add(*hbox1);
>     this->show_all();
>     
>     cout << "label1 height: " << label1->get_height() << endl;
>     cout << "hbox1 height: " << hbox1->get_height() << endl;
>     cout << "button1 height: " << button1->get_height() << endl;
>     cout << "label2 height: " << label2->get_height() << endl;
>     
>     button1->set_border_width(10);
>     label2->set_text("this is\nnow a\n3 line label");
>     
>     cout << "\nafter changes\n";
>     cout << "label1 height: " << label1->get_height() << endl;
>     cout << "hbox1 height: " << hbox1->get_height() << endl;
>     cout << "button1 height: " << button1->get_height() << endl;
>     cout << "label2 height: " << label2->get_height() << endl;

Widget size changes are delayed and batch-processed in the main event
loop, that's why you see the same value. Put the same code (the after
changes part) in a low-priority handler and see for yourself.

Tassos

-- 
Beware of he who would deny you access to information, for in his
heart he dreams himself your master." 
	-- Commissioner Pravin Lal, Sid Meier's Alpha Centauri

Attachment: signature.asc
Description: This is a digitally signed message part



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