Re: [pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
Hello, if you really need to know the absolute coordinates of widget, read the properties from the widget's GdkWindow.. First you need to get the absolute position of the main window ('win' is a GtkWindow here): x, y = (win.get_window().x, win.get_window().y) You can get the positions of other widgets the same way. But you still need to add the parent window's absolute position to it. The method 'set_uposition(x, y)' sets the absolute position of a window and a GtkFixed widget can be used to place widgets at absolute positions. GtkAlignment widgets may also help. I hope, I could help. Martin Grimme - http://www.pycage.de ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
Aaron Optimizer Digulla wrote: > > On Thu, Dec 07, 2000 at 10:09:22AM -0700, Shane Spencer wrote: > > > These positions are always relative to the parent window. Tk has > > > extra attributes called root_x and root_y which return the position > > > relative to the root window (which is usually filling the whole screen). > > > > > > But I guess the better question is: What are you trying to achieve ? > > > Usually, you don't need to care about the position of the widget. > > > > > > > So can anybody tell me how to get parent widget ID's? If so a recursive > > > > function will be able to tell me what the X,Y position of the Widget is > > > > in relation to the Main Window.. :) > > > > > > I've written a patch for PyGTK which gives every widget the > > > attribute "parent" but that has been payed by a customer and > > > I'm not yet allowed to give that away :-( It's a small patch > > > and something very valuable (for example, it allows to add > > > tooltips to the columns of a CTree/CList !). > > > > > > > Hehe.. I need to go agains widget philosophy.. you see I am making a > > touchscreen application and the client has suggested that whenover the > > finger is over a button.. a larger button appears popup style over it > > and then disapears as soon as the mouse leaves it.. that is why I need > > to know the x, y of the root window.. I have however just realized to > > myself that "after" you show the main window/widget and everything is > > allocated.. then get_allocation dows work relative to the windows > > top-left corner.. all I need now is an X,Y for the window on the screen > > and I am in business.. > > Well, it makes sense for applications with limited amount of screen > space (PDAs, etc) but usually, it annoys the user when he cannot > select any font size because it breaks the app. > > > Also I am a fixed position programmer by default.. so I am getting used > > to widgets.. however most of my programs really break the widget > > philosphy with some new techniques.. so it is a little odd always > > reading that I should not care about where the widgets are .. can > > anybody explain that too me? Is there a deep dark widget cult that I am > > offending by always going above and beyond Widgetry? > > The idea is this: If you have bad vision, then you want to be able to > use a very large font and contrast-rich colors. You don't want the app > designer to be "smarter" than you and fixing these things and thus > making the app useless for you. > > Also, doing a good layout is something most software developers can't > do. Therefore, it makes sense to revoke the power to fixate these things > from the app developer and pass it to the app user. Ultimately, what > the user wants is a GUI which he can design (so it fits his needs > best). This way, the app developer just provides the functionality > and the user desides how it should look like. Think of Themes and > Skins. > > Actually, when you get used to it, it's a great relief since you > can concentrate on software design instead of GUI design (which > you will ultimately always get wrong for someone :-) > hehe.. this is for a Point of Sale application which has 800, 600 screen and space is an issue and flexibility in font size is not an issue.. really just being able to make an impressive app is what I am after and the themability of gtk helps out a lot.. I basically have the issue covered now so no problem's however just as it is a good concept for making things more usable for the user.. it is probably not more usable straight out of the box for the client.. because NOTHING is ever good enough for the client.. Have a Merry Xmas Guys! ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
On Thu, Dec 07, 2000 at 10:09:22AM -0700, Shane Spencer wrote: (Please remember to include the list's address in the reply; unfortunately, the PyGTK list doesn't set Reply-To: to itself, so you must do this manually when you reply to posts. No, James isn't going to change this) > > These positions are always relative to the parent window. Tk has > > extra attributes called root_x and root_y which return the position > > relative to the root window (which is usually filling the whole screen). > > > > But I guess the better question is: What are you trying to achieve ? > > Usually, you don't need to care about the position of the widget. > > > > > So can anybody tell me how to get parent widget ID's? If so a recursive > > > function will be able to tell me what the X,Y position of the Widget is > > > in relation to the Main Window.. :) > > > > I've written a patch for PyGTK which gives every widget the > > attribute "parent" but that has been payed by a customer and > > I'm not yet allowed to give that away :-( It's a small patch > > and something very valuable (for example, it allows to add > > tooltips to the columns of a CTree/CList !). > > > > Hehe.. I need to go agains widget philosophy.. you see I am making a > touchscreen application and the client has suggested that whenover the > finger is over a button.. a larger button appears popup style over it > and then disapears as soon as the mouse leaves it.. that is why I need > to know the x, y of the root window.. I have however just realized to > myself that "after" you show the main window/widget and everything is > allocated.. then get_allocation dows work relative to the windows > top-left corner.. all I need now is an X,Y for the window on the screen > and I am in business.. Well, it makes sense for applications with limited amount of screen space (PDAs, etc) but usually, it annoys the user when he cannot select any font size because it breaks the app. > Also I am a fixed position programmer by default.. so I am getting used > to widgets.. however most of my programs really break the widget > philosphy with some new techniques.. so it is a little odd always > reading that I should not care about where the widgets are .. can > anybody explain that too me? Is there a deep dark widget cult that I am > offending by always going above and beyond Widgetry? The idea is this: If you have bad vision, then you want to be able to use a very large font and contrast-rich colors. You don't want the app designer to be "smarter" than you and fixing these things and thus making the app useless for you. Also, doing a good layout is something most software developers can't do. Therefore, it makes sense to revoke the power to fixate these things from the app developer and pass it to the app user. Ultimately, what the user wants is a GUI which he can design (so it fits his needs best). This way, the app developer just provides the functionality and the user desides how it should look like. Think of Themes and Skins. Actually, when you get used to it, it's a great relief since you can concentrate on software design instead of GUI design (which you will ultimately always get wrong for someone :-) -- == Sowatec AG, CH-8330 Pfäffikon (ZH) Witzbergstr. 7, http://www.sowatec.com Tel: +41-(0)1-952 55 55 Fax: +41-(0)1-952 55 66 -- Aaron "Optimizer" Digulla, [EMAIL PROTECTED] == ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
On Wed, Dec 06, 2000 at 08:55:37PM -0700, Shane Spencer wrote: > James Henstridge wrote: > > > > > > I was wondering how to tell a widgets screen geometry x,y,width,height.. > > > I can get the width height through size_request but nothing else.. :( > > > > You can use the get_allocation() method to get the space allocated to the > > widget (as a 4 tuple (x,y, width,height)). > > > > James. > > The tuple it gives me is [0, 0, width, height] never giving me the > allocated X, Y These positions are always relative to the parent window. Tk has extra attributes called root_x and root_y which return the position relative to the root window (which is usually filling the whole screen). But I guess the better question is: What are you trying to achieve ? Usually, you don't need to care about the position of the widget. > So can anybody tell me how to get parent widget ID's? If so a recursive > function will be able to tell me what the X,Y position of the Widget is > in relation to the Main Window.. :) I've written a patch for PyGTK which gives every widget the attribute "parent" but that has been payed by a customer and I'm not yet allowed to give that away :-( It's a small patch and something very valuable (for example, it allows to add tooltips to the columns of a CTree/CList !). -- == Sowatec AG, CH-8330 Pfäffikon (ZH) Witzbergstr. 7, http://www.sowatec.com Tel: +41-(0)1-952 55 55 Fax: +41-(0)1-952 55 66 -- Aaron "Optimizer" Digulla, [EMAIL PROTECTED] == ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
James Henstridge wrote: > > > > I was wondering how to tell a widgets screen geometry x,y,width,height.. > > I can get the width height through size_request but nothing else.. :( > > You can use the get_allocation() method to get the space allocated to the > widget (as a 4 tuple (x,y, width,height)). > > James. The tuple it gives me is [0, 0, width, height] never giving me the allocated X, Y So can anybody tell me how to get parent widget ID's? If so a recursive function will be able to tell me what the X,Y position of the Widget is in relation to the Main Window.. :) Also is there an editres style Gtk Widget viewer.. Thanks Shane ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
On Wed, 6 Dec 2000, Shane Spencer wrote: > Hola.. > > I was wondering how to tell a widgets screen geometry x,y,width,height.. > I can get the width height through size_request but nothing else.. :( You can use the get_allocation() method to get the space allocated to the widget (as a 4 tuple (x,y, width,height)). James. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Widget/Window position and geometry like GtkWidgeyAuxInfo
Hola.. I was wondering how to tell a widgets screen geometry x,y,width,height.. I can get the width height through size_request but nothing else.. :( Please Please HELP! Shane ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk