[gtkada] getting window positions
Stephen Leake
stephen_leake at acm.org
Sat Oct 5 04:18:36 CEST 2002
I'm running GtkAda 1.3.12 on Windows 98.
I'm trying to save some window positions in a file (actually a
Grace.Config_Files (http://savannah.nongnu.org/projects/grace/)), so
they are preserved across sessions.
I can set the window position with Widget.Set_UPosition.
But I can't figure out how to get the current window position.
Currently, I have:
Child_Pos_X : constant Glib.Gint := Gtk.Widget.Get_Allocation_X (Widget);
Child_Pos_Y : constant Glib.Gint := Gtk.Widget.Get_Allocation_Y (Widget);
But this always results in Child_Pos_X, Child_Pos_Y being 0. Widget is
a top-level window. Is this a bug? Is there a different function I
should use?
Another issue is what event to capture this in. Currently, I have it
in a handler for "delete_event". However, that is only called if the
user directly closes that window. My windows are children of the main
application window; if the user closes the main application window,
the child window "delete_event" handler is not called. Hmm, I guess I
need to call it directly, from the application window "delete_event".
Yuck; MS Windows does this better :).
--
-- Stephe
More information about the gtkada
mailing list