RE: FileChooser dialog positioning on parent in Win32 bug?

From: Dov Grobgeld
Sent: Wednesday, July 01, 2009 5:07 AM

This seems like a bug in Windows, but I wanted to hear if there some easy work around before I open a bug in bugzilla.

The following code:

    GtkWidget *dialog = gtk_dialog_new_with_buttons("Title",
                            GTK_WINDOW (parent_window),

   // add several widgets to dialog->vbox

does not center the dialog window over its parent in Win32, but the dialog is placed such that the upper left corner is approximately around the center of the parent_window.  This caused a user to complain that she always has to manually move the dialog once she does File/Open in my application. Of course I can manually move the dialog through gdk_window_move() etc, but the whole point of the "transient" is, as far as I understand it, to avoid having to do manual window positioning.

The same code works correctly under Linux under fvwm2rc. The gtk version is roughly the latest in both Linux and Windows.

Thanks in advance!




It was supposedly fixed in Jan ‘09 so the fix should be in the latest versions, and it says the fix was back-ported to 2.14.7 too. So are you using a version that should have that fix?


If you have the fixed version of GTK  and it’s still not properly centering on the parent, you might want to try adding a call to:


gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);



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