gtk_window_set_postion not working with a gtk_file_chooser_dialog
- From: "Ian Puleston" <ian underpressuredivers com>
- To: <gtk-list gnome org>
- Subject: gtk_window_set_postion not working with a gtk_file_chooser_dialog
- Date: Thu, 30 Oct 2008 20:28:20 -0700
Hi,
I'm using gtk_window_set_postion() to try to align a
gtk_file_chooser_dialog, and it doesn't. With either
GTK_WIN_POS_CENTER_ON_PARENT or GTK_WIN_POS_CENTER it gets aligned so that
its top left corner is kinda near the center of the parent window, and
because the file chooser window is pretty big it extends off the bottom of
the screen. So every time you use it you have to drag it up to get access to
the buttons.
I tried catching "map_event" and "configure_event" on the file chooser
dialog (emitted when it is realized and on window size changes respectively)
and printing the window size on each, and this is what I get as the window
opens:
Map event
Configure event 265 x 220
Configure event 265 x 220
Configure event 804 x 653
So I then took a screenshot to see exactly where it is positioned, and its
top left corner is 132 pixels left of center and 110 pixels up from it -
i.e. it's at the point that would center a Window sized 264 x 220.
So it looks like it's centering the file chooser window on one of those
first two configure events, and then resizing it bigger without re-centering
it.
If no one can come up with an explanation of something I may be doing wrong,
I'll bug report this.
The code is simply:
fileDlg = gtk_file_chooser_dialog_new("Select Race",
GTK_WINDOW(mainWin),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fileDlg),
pStartDir);
gtk_window_set_position(GTK_WINDOW(fileDlg),
GTK_WIN_POS_CENTER_ON_PARENT);
ret = gtk_dialog_run(GTK_DIALOG(fileDlg));
Ian
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]