Re: Obtaining widget coordinates relative to window



> Probably the button and container haven't been realised at that point in
> your code. (That is, your "the layout is loaded and displayed" is
> wrong.)

Thank you. Yes this was the issue. I was trying to examine the widgets' 
allocation
whilst in the constructor of the glade builder-derived window.

What I should of been doing (and works) is installing a realize handler for
the widget
and examining the allocation there:

a_widget->signal_realize().connect( sigc::mem_fun(*this,
&MyWindow::signal_realize) );

and in the signal_realize handler:
refGlade->get_widget("button", b)
cout << "X:" << b->get_allocation().get_x() << " Y:" <<
b->get_allocation().get_y() << endl;

Thanks for the hint!
Stuart
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

-- 
View this message in context: http://old.nabble.com/Obtaining-widget-coordinates-relative-to-window-tp29489598p29491553.html
Sent from the Gtkmm mailing list archive at Nabble.com.



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