Re: A simple question.



Patrick Mariescurrena was overheared mumbling something about this on Sat, 05
Aug 2000 13:36:41 +0200

> I'm writing my first modest gtk application, and I would like to
>  position the main window in a specific (50,50) coordinate. I'm using :
>  gtk_widget_set_uposition(GTK_WIDGET(window), 50, 50); however, the
>  window is always drawn in the same place it was last time you closed it.
>  
>  Is this a bug or am I doing something wrong?

Use gdk_window_move(window->window, 50, 50) after you gtk_widget_show(window) 
This works fine.  The reason your code doesn't work has to do with the Window
Manager you are running.  Also be aware that gdk_window_move() may not always
work either, if the Window Manager doesn't honor move requests from
applications.  One other drawback of the _move() method is that the window will
flash onscreen at the position the WM wants it, and then well move to the new
position.  The end result is what we want, but it's a little ugly/hackish...
Also, make sure you make it an option, since some users might get a little
pissed if your program moves itself around... In my case, I have an option
"Save position on exit?" and then I use the gdk_window_move() to impliment
that... Sounds to me like you are trying to do the reverse... (ie: over-ride
the WM feature to save position on exit...)  This is all well and good, I
guess... but make sure it's user configurable...

-CZ
-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT/CM d--(+) s+: a- C++++ UL++++$ P+++ L+++>++++ E--- W+++(--) N+ o? K?
w---(++) O M->-- !V PS+++ PE Y+ PGP t+@ 5? X+ R++ tv-- b+++ DI? D++
G e h r- y+
------END GEEK CODE BLOCK------




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