I am using a laptop with the following screens:
- main screen: 2880x1800 (max. resolution), but currently running on 1920x1200
- 2nd screen: 1920x1200, operating system is windows 7.

When starting the BWidgets demo the process is running, but the window is initially placed outside the screen and therefore completely invisible.
As the  BWidget::place procedure is also used in the Dialog widget, a BWidget dialog comes along with the same problem.

The folowing code change fixes the problem on my machine - pls. see changes down below the "center to screen comment":


proc BWidget::place { path w h args } {

            ....

            set sw [winfo screenwidth  $path]
            set sh [winfo screenheight $path]
            if { $idx == 1 } {
                if { $arglen == 2 } {
                    # center to widget
                    set x0 [expr {[winfo rootx $widget] + ([winfo width  $widget] - $w)/2}]
                    set y0 [expr {[winfo rooty $widget] + ([winfo height $widget] - $h)/2}]
                } else {

                    # center to screen
                    # set x0 [expr {($sw - $w)/2 - [winfo vrootx $path]}]
                    # set y0 [expr {($sh - $h)/2 - [winfo vrooty $path]}]

		    set x0 [expr {[winfo rootx $path] + ([winfo width $path] / 2 -  [winfo reqwidth $widget] / 2)}]
		    set y0 [expr {[winfo rooty $path] + ([winfo height $path] / 2 - [winfo reqheight $widget] / 2)}]

		    # If $main is not realized we get funny sizes back
		    # This will make the dialog box visible at least.
		    if {$x0 < 0} {set x0 150}
		    if {$y0 < 0} {set y0 150}
                }
           ...

I would also be glad to forward the changed util.tcl file if required.

Thanks a lot,
  Johann Oberdorfer