On Fri, 20 Aug 2010 02:10:58 -0700 (PDT) RedOctober <stuartvqu...@yahoo.com> wrote: > Hi, > > I am trying to locate a widget's coordinates relative to its position > in a displayed window. > > I have created a very simple test layout using glade with a single > top level window, a fixed layout, containing a single button. The > layout is loaded and displayed and the program attempts to locate the > X,Y of the button widget. > > I have tried two methods: > > - Using allocation: > Gtk::Button* button = 0; > m_refGlade->get_widget("button1", button); > assert (button); > cout << button->get_allocation().get_x() << " " << > button->get_allocation().get_y() << endl; > > Both X,Y values are always -1.
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.) Chris _______________________________________________ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list