469,306 Members | 2,547 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Getting User Display Information

Hi there,

I was wondering if it was possible to get the screen display size and other associated properties somehow either using python modules or if possible using Tk methods.

Thanks a lot.

Vinod

__________________________________________________ ________________
Switch to the New Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

Jul 18 '05 #1
2 1522
> I was wondering if it was possible to get the screen display size and
other associated properties somehow either using python modules or if
possible using Tk methods.


Using Tkinter:

from Tkinter import Tk
w=Tk()
print w.winfo_screenwidth(),w.winfo_screenheight()
w.destroy()

There's a plethora of other information available as methods of the Tk
object (actually any Tkinter widget), including color depth, cursor
position, window manager type, etc.

Note that this is actually creating a Tk window; calling its destroy()
method right after you've finished with it prevents it from appearing on
screen. Don't do this if you actually are creating a GUI with Tk.

Jul 18 '05 #2
On Wed, 30 Jun 2004 12:10:45 -0400, Christopher T King <sq******@WPI.EDU> wrote:
I was wondering if it was possible to get the screen display size and
other associated properties somehow either using python modules or if
possible using Tk methods.


Using Tkinter:

from Tkinter import Tk
w=Tk()
print w.winfo_screenwidth(),w.winfo_screenheight()
w.destroy()

There's a plethora of other information available as methods of the Tk
object (actually any Tkinter widget), including color depth, cursor
position, window manager type, etc.

Note that this is actually creating a Tk window; calling its destroy()
method right after you've finished with it prevents it from appearing on
screen. Don't do this if you actually are creating a GUI with Tk.


Is there anyway to get the size of the available screen. I have things
like the status bar across the bottom of the screen (redhat) and I would
like to size my application so that it doesn't overlap it.
--Mark
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ron Brennan | last post: by
5 posts views Thread by Thelma Lubkin | last post: by
3 posts views Thread by Fredrik Melin | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.