[gtkmm] RE: Widget size bug?



> On Friday, July 30, 2004 11:04 AM, Tassos Bassoukos wrote: 
> 
> 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
> 

Tassos,

Can you give me an example or point me to an example of what you mean?
I've only ever seen the loop done the way I had it.

Also, is there a way to force the sizes to update then?  I have 2
functions in my class containing some widgets, one that changes the
sizes and one that needs to read to changed sizes, and I need to make
sure the current sizes are the correct ones.

Thanks,
Ryan



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