GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Apr 20, 2014 10:50 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Move Window
PostPosted: Mon Jan 16, 2012 5:48 pm 
Offline
Familiar Face

Joined: Mon Jan 16, 2012 5:10 pm
Posts: 11
Attachment:
sing.jpg
sing.jpg [ 111.07 KiB | Viewed 649 times ]


Hi friends, I'm Anderson du Lustoza, do not speak English, so I'm writing in Portuguese and translated google translator. I'm creating an alternate interface for Gnome PyGObject called Singularity. One question I have is on the panels that hide themselves, like the Unity launcher for Ubuntu Linux.
So how do I create a gtk.Window move?
link my site to download the Singularity: https://sites.google.com/site/andersondulustoza/


Top
 Profile  
 
 Post subject: Re: Move Window
PostPosted: Thu Jan 19, 2012 12:39 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Always surprised at how well google translate does.
I'm not sure that I understand the question? Is it how to move the window? Whether the display manager allows it is another matter but the method for doing so can be found at: http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--move
By the way the ubuntu desktop being unity has diverged a bit from GNOME so you'll probably find that some features you see in the desktop won't transfer as easily as expected.


Top
 Profile  
 
 Post subject: Re: Move Window
PostPosted: Fri Jan 20, 2012 1:21 pm 
Offline
Familiar Face

Joined: Mon Jan 16, 2012 5:10 pm
Posts: 11
Actually already knew about the method "move", but he just fixed the window in place of the screen. I wonder for example how can I make the window walking slowly from the center of the screen to the left corner, like an animation.


Top
 Profile  
 
 Post subject: Re: Move Window
PostPosted: Fri Jan 20, 2012 11:55 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
As far as I can tell the functionality you're after doesn't exist within GTK itself. GTK by and large handles the functionality that occurs within a window and leaves the visual effects of the windows themselves to whichever window manager the desktop environment uses. In your program you could possibly program in calls to a specific window manager e.g. compiz, but if you're using it with GTK as well this will break the cross-platform capability of your GTK app (not to mention being bad design practice and difficult to maintain as Ubuntu runs through versions rapidly and lately window managers are get chopped and changed almost as often). Ideally you'll want a function that can detect the current window manager at run time and then do whatever you want with the window managers that can handle it as well as dealing with window managers that just don't. In either case I don't think this is a gtk question and ends up being out of my areas of expertise.


Top
 Profile  
 
 Post subject: Re: Move Window
PostPosted: Sat Jan 21, 2012 12:22 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Oops my mistake. this functionality doe exist, I was just looking through the wrong API (It's gdk rather than gtk). The function you'd want is gdk_window_move or gdk_window_move_resize. You can also change the opacity.


Top
 Profile  
 
 Post subject: Re: Move Window
PostPosted: Sat Jan 21, 2012 11:07 am 
Offline
Familiar Face

Joined: Mon Jan 16, 2012 5:10 pm
Posts: 11
Although there is a specific function for the animation windows in gtk, the method "moves" can be implemented with Python mathematical operations. I know that the program AdeskBar does just that, but I do not know how to adapt the code.
x, y = day, hour
window = gtk.Window()
window.move(x,y)
try this example trasformar time moving to the window, but it remains fixed in position started, then the secret would be to create an update?
complex!


Top
 Profile  
 
 Post subject: Re: Move Window
PostPosted: Wed Jan 25, 2012 8:42 pm 
Offline
Familiar Face

Joined: Mon Jan 16, 2012 5:10 pm
Posts: 11
YES, I did.
we have to create a gobject.timeout_add ()
and define the function:
x += 4
y += 2
window.move(x,y)
window.present()
return True


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group