GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 02, 2014 11:37 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: gtk_window_set_position
PostPosted: Wed Jun 13, 2012 4:18 am 
Offline

Joined: Tue Jun 12, 2012 1:07 pm
Posts: 2
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
I meant to set the window position randomly. But every time I run the same program, it appears it the same position.
How can that happen?


Top
 Profile  
 
 Post subject: Re: gtk_window_set_position
PostPosted: Wed Jun 13, 2012 6:47 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hi,
Code:
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
This will only tell the window manager to place the window where it thinks best. This will vary depending on the window type and any other window hints, but will not be random.

If you want to move the window use gtk_window_move(), but be warned that the window manager can ignore requests so do not depend on the window having definitely moved after this call.

_________________
E.


Top
 Profile  
 
 Post subject: Re: gtk_window_set_position
PostPosted: Wed Jun 13, 2012 9:28 am 
Offline

Joined: Tue Jun 12, 2012 1:07 pm
Posts: 2
errol wrote:
Hi,
Code:
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
This will only tell the window manager to place the window where it thinks best. This will vary depending on the window type and any other window hints, but will not be random.

If you want to move the window use gtk_window_move(), but be warned that the window manager can ignore requests so do not depend on the window having definitely moved after this call.


The window manager of my computer is a brain dead one which always thinks upper left side is a good place.
You helped me a lot.
Thank you!


Top
 Profile  
 
 Post subject: Re: gtk_window_set_position
PostPosted: Wed Jun 13, 2012 11:18 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
There is no need to quote my whole message. I think nearly everyone can follow a thread.

You are free to change your window manager or it may just be a setting to adjust the window placement.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group