Re: Screen placement based on screen resolution

2006-04-08 Thread Pat
Thanks a lot for you response. S "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Pat" <[EMAIL PROTECTED]> wrote: > >> I am trying to place a dialog in the center of the screen based on a >> users >> screen resolution. I can get the width and height of the screen, b

Re: Screen placement based on screen resolution

2006-04-07 Thread Fredrik Lundh
Lonnie Princehouse wrote: > Tkinter takes strings as its arguments; it's TCL's legacy. geometry strings are an X windows thing... > You can use string formatting for this: > > x = width/2-40 > y = height/2-30 > > root.geometry('%ldx%ld+%ld+%ld' % (width, height, x, y)) note that "+%ld" (why bot

Re: Screen placement based on screen resolution

2006-04-07 Thread Fredrik Lundh
"Pat" <[EMAIL PROTECTED]> wrote: > I am trying to place a dialog in the center of the screen based on a users > screen resolution. I can get the width and height of the screen, but I can't > seem to use the following: > > root.geometry('WxH+X+Y') > > It appears the values for X and Y need to be i

Re: Screen placement based on screen resolution

2006-04-07 Thread Pat
Thanks. S "Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tkinter takes strings as its arguments; it's TCL's legacy. You can use > string formatting for this: > > x = width/2-40 > y = height/2-30 > > root.geometry('%ldx%ld+%ld+%ld' % (width, height, x, y)) >

Re: Screen placement based on screen resolution

2006-04-07 Thread Lonnie Princehouse
Tkinter takes strings as its arguments; it's TCL's legacy. You can use string formatting for this: x = width/2-40 y = height/2-30 root.geometry('%ldx%ld+%ld+%ld' % (width, height, x, y)) -- http://mail.python.org/mailman/listinfo/python-list

Screen placement based on screen resolution

2006-04-07 Thread Pat
I am trying to place a dialog in the center of the screen based on a users screen resolution. I can get the width and height of the screen, but I can't seem to use the following: root.geometry('WxH+X+Y') It appears the values for X and Y need to be integers and not a variable like width/2-40 S