Getting User Display Information

S

Skulled2003

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
 
C

Christopher T King

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.
 
M

Mark Hertel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top