Bwidget Source Code
Check-in [85ca650f34]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:util.c: BWidget::place moved away from visible screens if the current window is on a virtual screen outside of the main screen (Windows multi-screen configuration) [5919a0ec2d]
Timelines: family | ancestors | descendants | both | bwidget
Files: files | file ages | folders
SHA1:85ca650f34d453ea081a87800136eafc826fd2cb
User & Date: oehhar 2016-07-21 13:37:59
References
2016-07-21
13:39 Ticket [5919a0ec2d] BWidget::place fails in a dual screen environment on windows status still Open with 4 other changes artifact: 892eacf953 user: oehhar
Context
2016-08-23
17:28
configure option of a ::Button gave error in themed mode. Ticket [845613e5590ae7cf]. Report by Adrian. check-in: 987852ad44 user: oehhar tags: bwidget
2016-07-21
13:37
util.c: BWidget::place moved away from visible screens if the current window is on a virtual screen outside of the main screen (Windows multi-screen configuration) [5919a0ec2d] check-in: 85ca650f34 user: oehhar tags: bwidget
2016-07-15
11:19
pckIndex.tcl: auto-load commands also from global namespace and not only from BWidget namespace. Ticket [c86207db01] check-in: b8dc4b393d user: oehhar tags: bwidget
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2016-07-15 Adrian Madrano Calvo
	pckIndex.tcl: auto-load commands also from global namespace
	and not only from BWidget namespace. Ticket [c86207db01]

2016-03-22 Harald Oehlmann <oehhar@users.sourceforge.net>
	Only support themed packages Tile 0.8 or Ttk.
	Repair the button spacing in themed font toolbar.
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2016-07-21 Harald Oehlmann
	util.tcl: BWidget::place moved away from visible screens
	if the current window is on a virtual screen outside of
	the main screen (Windows multi-screen configuration).
	Ticket [5919a0ec2d]

2016-07-15 Adrian Madrano Calvo
	pckIndex.tcl: auto-load commands also from global namespace
	and not only from BWidget namespace. Ticket [c86207db01]

2016-03-22 Harald Oehlmann <oehhar@users.sourceforge.net>
	Only support themed packages Tile 0.8 or Ttk.
	Repair the button spacing in themed font toolbar.

Changes to utils.tcl.

322
323
324
325
326
327
328

329



















330









331
332
333
334
335
336
337
            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 x "+$x0"
                set y "+$y0"
                if {$::tcl_platform(platform) != "windows"} {
                    if { $x0+$w > $sw } {set x "-0"; set x0 [expr {$sw-$w}]}
                    if { $x0 < 0 }      {set x "+0"}
                    if { $y0+$h > $sh } {set y "-0"; set y0 [expr {$sh-$h}]}







>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>







322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
            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 x [winfo rootx $path]
                    set x0 [expr {($sw - $w)/2}]
                    set vx [winfo vrootx $path]
                    set vw [winfo vrootwidth $path]
                    if {$x < 0 && $vx < 0} {
                        # We are left to the main screen
                        # Start of left screen: vx (negative)
                        # End coordinate of left screen: -1
                        # Width of left screen: vx * -1
                        # x0 = vx + ( -vx - w ) / 2
                        set x0 [expr {($vx - $w)/2}]
                    } elseif {$x > $sw && $vx+$vw > $sw} {
                        # We are right to the main screen
                        # Start of right screen: sw
                        # End of right screen: vx+vw-1
                        # Width of right screen: vx+vw-sw
                        # x0 = sw + ( vx + vw - sw - w ) / 2
                        set x0 [expr {($vx+$vw+$sw-$w)/2}]
                    }
                    # Same for y
                    set y [winfo rooty $path]
                    set y0 [expr {($sh - $h)/2}]
                    set vy [winfo vrooty $path]
                    set vh [winfo vrootheight $path]
                    if {$y < 0 && $vy < 0} {
                        # We are above to the main screen
                        set y0 [expr {($vy - $h)/2}]
                    } elseif {$y > $sh && $vy+$vh > $sh} {
                        # We are below to the main screen
                        set x0 [expr {($vy+$vh-$sh-$h)/2+$sh}]
                    }
                }
                set x "+$x0"
                set y "+$y0"
                if {$::tcl_platform(platform) != "windows"} {
                    if { $x0+$w > $sw } {set x "-0"; set x0 [expr {$sw-$w}]}
                    if { $x0 < 0 }      {set x "+0"}
                    if { $y0+$h > $sh } {set y "-0"; set y0 [expr {$sh-$h}]}