button to let user move a window

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

button to let user move a window

Lucas Sichardt
Hello out there,

is there a way to let the user move the window e.g. by pressing and holding down a button?
My problem is that I need to have a non decorated window being moved by the user so that the user can exactly move the window's top left corner to a specific position. This is not possible with window decorations due to the fact that there are diffeent sizes of decorations.

Perhaps someone knows a way to add a "window move widget" to my window in some way with pygtk.

Thanks for your attention...

Best regards,
Lucas Sichardt

--
Lucas Sichardt | Lucas.Sichardt@posteo.de | http://Lucas.Sichardt.net
gesendet mit Opera 12 unter Linux Mint 13 Maya Xfce

_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: button to let user move a window

ilius
Use "gtk.Window.begin_move_drag" on button's handler's for "button-press-event"
(The widget doesn't have to be a GtkButton, for example you can move the window by dragging an empty place of a toolbar)

class MyWindow(gtk.Window)
    def buttonPress(self, widget, event):
        self.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time)



On Tue, Mar 18, 2014 at 8:07 PM, Lucas Sichardt <[hidden email]> wrote:
Hello out there,

is there a way to let the user move the window e.g. by pressing and holding down a button?
My problem is that I need to have a non decorated window being moved by the user so that the user can exactly move the window's top left corner to a specific position. This is not possible with window decorations due to the fact that there are diffeent sizes of decorations.

Perhaps someone knows a way to add a "window move widget" to my window in some way with pygtk.

Thanks for your attention...

Best regards,
Lucas Sichardt

--
Lucas Sichardt | Lucas.Sichardt@posteo.de | http://Lucas.Sichardt.net
gesendet mit Opera 12 unter Linux Mint 13 Maya Xfce

_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: button to let user move a window

ilius
A have also written a simple window controller horizontal box in PyGTK (and PyGI as well) you can check it out:
It's integrated with my complicated program though! Good luck with that anyway :D



On Tue, Mar 18, 2014 at 8:49 PM, Saeed Rasooli <[hidden email]> wrote:
Use "gtk.Window.begin_move_drag" on button's handler's for "button-press-event"
(The widget doesn't have to be a GtkButton, for example you can move the window by dragging an empty place of a toolbar)

class MyWindow(gtk.Window)
    def buttonPress(self, widget, event):
        self.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time)



On Tue, Mar 18, 2014 at 8:07 PM, Lucas Sichardt <[hidden email]> wrote:
Hello out there,

is there a way to let the user move the window e.g. by pressing and holding down a button?
My problem is that I need to have a non decorated window being moved by the user so that the user can exactly move the window's top left corner to a specific position. This is not possible with window decorations due to the fact that there are diffeent sizes of decorations.

Perhaps someone knows a way to add a "window move widget" to my window in some way with pygtk.

Thanks for your attention...

Best regards,
Lucas Sichardt

--
Lucas Sichardt | Lucas.Sichardt@posteo.de | http://Lucas.Sichardt.net
gesendet mit Opera 12 unter Linux Mint 13 Maya Xfce

_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/



_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/