[Tkinter-discuss] Multiple displays/monitors?

Cameron Laird Cameron at phaseit.net
Mon Jan 22 16:38:12 CET 2007

On Fri, Jan 19, 2007 at 12:53:48PM -0700, Bob Greschke wrote:
> Some of my programs start up and initially size themselves to, for  
> example, 80% of the display height and width (usually because they  
> are going to be graphing something).  That works 100% of the time  
> until someone has multiple monitors then winfo_screenheight() and  
> width() get misleading.  They seem to return the max dimensions (width 
> +width and largest height), which isn't so bad if the two monitors  
> are really the same, but with things like Mac laptops and Cinema  
> displays it is usually not even close.
> Is there a way to find out about multiple monitors through Tkinter?   
> I played with a bunch of the winfo methods, but didn't figure  
> anything out.  ALL :) I want to do is get the dimensions of the two  
> (or more) displays and start the program in the center of the larger  
> of the two for lack of a better plan.

I don't like bearing bad news.  It's apparently true, though:
Tk itself, underlying Tkinter, has no clean way of getting at
the information you're (sensibly!) after.  While <URL:
http://sourceforge.net/tracker/?func=detail&aid=533519&group_id=12997&atid=112997 > 
is old, it remains an issue for quite a few current Tk maintainers.
If the matter interests you enough, you can probably help achieve
an enhancement in a forthcoming Tk release, which presumably would
then be available in Tkinter.

OR perhaps you could even take ideas from the Tk students, and 
patch them directly into Tkinter.

For now, though, there's no easy answer apart from, "No."

More information about the Tkinter-discuss mailing list