gail_widget_set_extents() and gail_widget_set_position() behaviour.

I am implementing gail_widget_set_extents(), gail_widget_set_size() and 
gail_widget_set_position() so that they set the extents, postition or size of 
the widget only if the widget is a toplevel widget. This is because it is not 
possible to set children of most types of containers according to x,y 
coordinates (apart from children of GtkFixed and GtkLayout, but since these can 
only be set programmatically the ATK API will not be able to set these).

My question is this:
The gail_widget_set_extents() and gail_widget_set_position() functions take an 
AtkCoordType parameter which specifies which coordinate system to set the widget 
position relative to. This can be either screen or top-level window but since 
the functions only work if the widget is toplevel, if the AtkCoordType parameter 
specifies to use coordinates relative to top-level window then a number of 
possible behaviours can be implemented:

- The top-level window of a top-level window may be interpreted as the root 
window, so the function would behave as if it was called with the AtkCoordType 
parameter specifying screen coordinates.

- The function would return FALSE, the logic being that a top-level widget 
cannot be re-positioned according to its own coordinate space (i.e. 
re-positioned according to its current position). 

- The function would move the widget relative to itself, so (-10, 0) would move 
the widget 10 pixels to the left, (0,30) would move the widget 30 pixels 
downwards etc. but the gtk_widget_set_uposition() function doesn't support this 
(it does not handle negative values and -1 and -2 have special meaning for it). 
This would be messy to implement.

Which behaviour do people think is the most intuitive/logical for these 
functions? I favour the first behaviour.

Any comments?

It is neccessary to have the AtkCoordType parameter since non-toplevel widgets 
may be identified that can be repositioned by the user in which case specifying 
the coordinate system to move relative to is desirable.

Oisin Boydell
Sun Microsystems Ireland
Phone: +353 (0)1 8199778
Mobile: +353 (0)86 3045117

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