Bwidget Source Code
Ticket Change Details
Not logged in
Overview

Artifact ID: 482e62d61c655bbc78d769090bbb5b1541f348ee
Ticket: 5919a0ec2d31ae284f6de8b6c9c8b332ee02190c
BWidget::place fails in a dual screen environment on windows
User & Date: anonymous 2016-07-20 20:42:55
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    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
    
  5. foundin changed to: "1.9.10"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "f75db2b2e0daed8a015467f70380a582a0c11109"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "bwidget"
  15. title changed to:
    BWidget::place fails in a dual screen environment on windows
    
  16. type changed to: "Bug"