Re: How to use GtkAllocation to find absolute x,y co-ordinates?

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

 



you can access allocation values after the widget is realized, not
right after you create it. so, to make sure you get it correct you can
set an event handler for size-allocate signal

http://library.gnome.org/devel/gtk/stable/GtkWidget.html#GtkWidget-size-allocate

2008/3/29, Harinandan S <harinandans@xxxxxxxxx>:
>
> Hi All,
>
> I want to find the absolute x,y co-ordinates and width and height of a
> widget. I looked at GTK API reference and found GtkAllocation. I tried  it
> in my program but
>
> gint x = widget->allocation.x ;
>
> returned -1. What does that mean? I want x,y coordinates in terms of the
> pixel values. I also tried widget->allocation.y but that also returned -1.
>
> Am i going wrong somewhere? I used this statement immediately after creating
> the widget.
>
> --
> Regards,
> Harinandan S
> _______________________________________________
>  gtk-list mailing list
>  gtk-list@xxxxxxxxx
>  http://mail.gnome.org/mailman/listinfo/gtk-list
>
>
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux