Bwidget Source Code
Check-in [5a776453e1]
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 [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Don't double creation of temporary widget for default values retrieval. Use result of _get_tkwidget_options instead. Ticket [393b67ab19]
Timelines: family | ancestors | descendants | both | bwidget
Files: files | file ages | folders
SHA1: 5a776453e160d0dd1ef3f408a7585e5bf85e7bbf
User & Date: oehhar 2014-05-21 07:14:04
References
2014-05-21
07:16 Closed ticket [393b67ab19]: Unnecessary temporary widget creation plus 7 other changes artifact: 7dc10cd980 user: oehhar
Context
2014-05-21
07:32
New procedure Widget::which (as in [namespace which]), that returns the fully qualified name for a widget option or widget variable. Ticket [a8705e5fd9] check-in: 97c7fd38ff user: oehhar tags: bwidget
07:14
Don't double creation of temporary widget for default values retrieval. Use result of _get_tkwidget_options instead. Ticket [393b67ab19] check-in: 5a776453e1 user: oehhar tags: bwidget
07:03
Don't invoke unqualified upvar in callers scope. Ticket [046fa04231] check-in: 3b0b4ecf4f user: oehhar tags: bwidget
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3
4




5
6
7
8
9
10
11
2014-05-21 Harald Oehlmann <[email protected]>

        widget.tcl: Don't invoke unqualified upvar in callers
        scope. Patch by Andreas Kupries. Ticket [046fa04231]





2013-12-13 Harald Oehlmann <[email protected]>

	scrollframe.tcl: Make -constrainedwidth 1 and
	-constrainedheight 1 work together.
	Patch by Simon Bachmann. Ticket [2fa44401d5]




>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2014-05-21 Harald Oehlmann <[email protected]>

        widget.tcl: Don't invoke unqualified upvar in callers
        scope. Patch by Andreas Kupries. Ticket [046fa04231]

        widget.tcl: Don't double creation of temporary widget for
        default values retrieval. Use result of _get_tkwidget_options
        instead. By Adrian Medrano Calvo. Ticket [393b67ab19]

2013-12-13 Harald Oehlmann <[email protected]>

	scrollframe.tcl: Make -constrainedwidth 1 and
	-constrainedheight 1 work together.
	Patch by Simon Bachmann. Ticket [2fa44401d5]

Changes to widget.tcl.

368
369
370
371
372
373
374
375
376
377
378
379


380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
            set classopt($option) [list $type $value $ro $arg]
            continue
        }

        # retreive default value for TkResource
        if { [string equal $type "TkResource"] } {
            set tkwidget [lindex $arg 0]
	    set foo [$tkwidget ".ericFoo##"]
            set realopt  [lindex $arg 1]
            if { ![string length $realopt] } {
                set realopt $option
            }


            set tkoptions [_get_tkwidget_options $tkwidget]
            if { ![string length $value] } {
                # We initialize default value
		set ind [lsearch $tkoptions [list $realopt *]]
                set value [lindex [lindex $tkoptions $ind] end]
            }
	    set optionDbName ".[lindex [_configure_option $option ""] 0]"
	    option add *${class}${optionDbName} $value widgetDefault
	    set exports($option) $optionDbName
            set classopt($option) [list TkResource $value $ro \
		    [list $tkwidget $realopt]]
	    set optionClass($option) [lindex [$foo configure $realopt] 1]
	    ::destroy $foo
            continue
        }

	set optionDbName ".[lindex [_configure_option $option ""] 0]"
	option add *${class}${optionDbName} $value widgetDefault
	set exports($option) $optionDbName
        # for any other resource type, we keep original optdesc






<




>
>



<
|






|
<







368
369
370
371
372
373
374

375
376
377
378
379
380
381
382
383

384
385
386
387
388
389
390
391

392
393
394
395
396
397
398
            set classopt($option) [list $type $value $ro $arg]
            continue
        }

        # retreive default value for TkResource
        if { [string equal $type "TkResource"] } {
            set tkwidget [lindex $arg 0]

            set realopt  [lindex $arg 1]
            if { ![string length $realopt] } {
                set realopt $option
            }
            set ind [lsearch $tkoptions [list $realopt *]]
            set optdesc [lindex $tkoptions $ind];
            set tkoptions [_get_tkwidget_options $tkwidget]
            if { ![string length $value] } {
                # We initialize default value

                set value [lindex $optdesc end]
            }
	    set optionDbName ".[lindex [_configure_option $option ""] 0]"
	    option add *${class}${optionDbName} $value widgetDefault
	    set exports($option) $optionDbName
            set classopt($option) [list TkResource $value $ro \
		    [list $tkwidget $realopt]]
	    set optionClass($option) [lindex $optdesc 1]

            continue
        }

	set optionDbName ".[lindex [_configure_option $option ""] 0]"
	option add *${class}${optionDbName} $value widgetDefault
	set exports($option) $optionDbName
        # for any other resource type, we keep original optdesc