1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>How could I get any widgets position?</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
11
HREF="book1.html"><LINK
13
TITLE="Development with GTK+: general questions"
14
HREF="c475.html"><LINK
16
TITLE="How do I reparent a widget?"
17
HREF="x635.html"><LINK
19
TITLE="How do I set the size of a widget/window? How do I
20
prevent the user resizing my window? [GTK 2.x]"
21
HREF="x662.html"></HEAD
32
SUMMARY="Header navigation table"
51
><<< Previous</A
57
>Development with GTK+: general questions</TD
65
>Next >>></A
78
>How could I get any widgets position?</A
81
>As Tim Janik pointed out, there are different cases, and
82
each case requires a different solution.</P
88
> If you want the position of a widget
89
relative to its parent, you should use
92
>widget->allocation.x</TT
96
>widget->allocation.y</TT
101
> If you want the position of a window
102
relative to the X root window, you should use
105
>gdk_window_get_geometry()</TT
109
>gdk_window_get_position()</TT
113
>gdk_window_get_origin()</TT
118
> If you want to get the position of the
119
window (including the WM decorations), you should use
122
>gdk_window_get_root_origin()</TT
127
> Last but not least, if you want to get a Window
128
Manager frame position, you should use
131
>gdk_window_get_deskrelative_origin()</TT
136
>Your choice of Window Manager will have an effect of the
137
results of the above functions. You should keep this in mind
138
when writing your application. This is dependant upon how the
139
Window Managers manage the decorations that they add around
147
SUMMARY="Footer navigation table"
160
><<< Previous</A
178
>Next >>></A
186
>How do I reparent a widget?</TD
200
>How do I set the size of a widget/window? How do I
201
prevent the user resizing my window? <I
b'\\ No newline at end of file'