Re: How to get the absolute position of an EventBox?



You can still access the underlying C object. E.g. try

  int x = GTK_WIDGET(applet->gobj())->allocation.x;

for a quick fix. I hope this helps a bit, but it's not a nice solution.

Simon


Rafael S. Suguiura wrote:
> I've just started to learn GTK+ and I'm migrating to gtkmm. In GTK, I could
> get the absolute position of an EventBox with the allocation inherited from
> Widget. So to get the x position, I just used the following code:
> 
> 
> int x = GTK_WIDGET(applet)->allocation.x;
> 
> 
> Now that I've converted to gtkmm, I use the corresponding code, but it
> always return 0. There is the code:
> 
> 
> int x = applet->get_allocation().get_x();
> 
> 
> The variable applet is Gnome::Panel::Applet, from libpanelappletmm and I
> don't know if it's an issue from this library or from gtkmm, since it
> inherits Gtk::EventBox.
> 
> All I need is to get the absolute position. Other alternatives are welcome.
> 
> Thanks in advance,
> Rafael
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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