If the window is a
GnomeDialog, this is user-configurable and you
should not do it. In most other cases it would be a bit
strange; but there are exceptions, such as splash
screens. The function you want is
gtk_window_set_position(); you can leave the
window's position up to the window manager (the
default), ask to have it centered, or ask to have it
appear wherever the mouse pointer is. There is an
enumeration which corresponds to these settings: GTK_WIN_POS_NONE, GTK_WIN_POS_CENTER, GTK_WIN_POS_MOUSE. For
example:
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
|
You should do this before
calling gtk_widget_show(),
because the function affects where the window appears
when it is first placed on-screen.