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' 
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!
gtkmm-list mailing list
gtkmm-list gnome org

View this message in context:
Sent from the Gtkmm mailing list archive at

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