Version 4 of Dual or Multiple Monitors

Updated 2004-02-11 09:21:05

Try to determine if we are operating on a system with dual monitors. It even handles switching modes mid-execution. At least on Windows. The maxsize command seems to keep up with the changes to the display. Damon Courtney

 proc DualMonitors {} {
     set top .#dualMonitorCheck#
     if {![winfo exists $top]} { toplevel $top; wm withdraw $top }
     set sw [winfo screenwidth $top]
     set mw [lindex [wm maxsize .] 0]
     return [expr {($sw * 2) < $mw}]
 }

This doesn't work when running wish on MacOSX with X11. I've got dual monitors but the proc returns 0. For my setup, the value for sw is 2624 (1600 + 1024) and the value of mw is (curiously) 2609.

DKF: Hmm. [winfo screenwidth] only reports the width of the primary monitor.