Re: Centering widgets relative to another.



La plume légère, à Thu, Oct 12, 2000 at 07:13:59PM -0400, heure d'inpiration,
Kristopher Kycia écrivait en ces mots:
> Hello all,
> 
> I would like to be able to center windows / dialogs however not every
> object seems to have a width and height.  And many objects do not have a
> default x and y position.  Ideally I would like to have my top level
> window appear at any position and then have subsequent dialogs appear
> centered relative to the position of the top level window (which can
> change if the user drags the window around).  I would like to have that
> Windows feel where dialogs are positioned relative to their parents.

You might want to use gdk_window_get_position to know the position of the
parent when the child appears (as well as gdk_window_get_size).
You should then connect one of the signals of the parent (state_changed may
be a good choice but I am not sure) so that you can reposition the child
windows with the help of gtk_window_reposition.


Wolfgang
-- 
A chicken is an egg's way of producing more eggs.




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