Bwidget Source Code
Check-in [a74f6fd0c9]
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:Error 'invalid command name ".#BWidget.#ttk::entry"' arises in themed mode when an Entry widget should get focus by the tab key. [Bug 3599955]
Timelines: family | ancestors | descendants | both | bwidget
Files: files | file ages | folders
SHA1: a74f6fd0c93b46f6bab4e6810666a0f2b9da0761
User & Date: oehhar 2013-01-14 08:33:50
Context
2013-06-21
13:30
Methods from Tk entry were restored for LabelEntry [Bug 1002844] check-in: cc146bdf09 user: oehhar tags: bwidget
2013-01-14
08:33
Error 'invalid command name ".#BWidget.#ttk::entry"' arises in themed mode when an Entry widget should get focus by the tab key. [Bug 3599955] check-in: a74f6fd0c9 user: oehhar tags: bwidget
2012-07-27
11:47
2012-07-27 [email protected] BWidget 1.9.6 tagged check-in: d596cecffe user: oehhar tags: bwidget, bwidget-1-9-6
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.











1
2
3
4
5
6
7









2011-07-27 Harald Oehlmann <[email protected]>

	**** BWidget 1.9.6 tagged ****

2012-04-12 Harald Oehlmann <[email protected]>

	* listbox.tcl ListBox::selection Only redraw if
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2013-01-09 Harald Oehlmann <[email protected]>

	* widget.tcl: Bug fixed:
	Error 'invalid command name ".#BWidget.#ttk::entry"'
	arises in themed mode when an Entry widget should get
	focus by the tab key.
	The temporary widget creation fails due to the "::" in
	the command name of ttk widgets.
	Any "::" is replaced by "__" [Bug 3599955].
	
2011-07-27 Harald Oehlmann <[email protected]>

	**** BWidget 1.9.6 tagged ****

2012-04-12 Harald Oehlmann <[email protected]>

	* listbox.tcl ListBox::selection Only redraw if

Changes to widget.tcl.

1096
1097
1098
1099
1100
1101
1102













1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
....
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
        }
    } else {
        set optclass [string range $option 1 end]
    }
    return [list $optdb $optclass]
}















# ----------------------------------------------------------------------------
#  Command Widget::_get_tkwidget_options
# ----------------------------------------------------------------------------
proc Widget::_get_tkwidget_options { tkwidget } {
    variable _tk_widget
    variable _optiondb
    variable _optionclass

    set widget ".#BWidget.#$tkwidget"
    # encapsulation frame to not pollute '.' childspace
    if {![winfo exists ".#BWidget"]} { frame ".#BWidget" }
    if { ![winfo exists $widget] || ![info exists _tk_widget($tkwidget)] } {
	set widget [$tkwidget $widget]
	# JDC: Withdraw toplevels, otherwise visible
	if {[string equal $tkwidget "toplevel"]} {
	    wm withdraw $widget
................................................................................
# ----------------------------------------------------------------------------
#  Command Widget::_test_tkresource
# ----------------------------------------------------------------------------
proc Widget::_test_tkresource { option value arg } {
#    set tkwidget [lindex $arg 0]
#    set realopt  [lindex $arg 1]
    foreach {tkwidget realopt} $arg break
    set path     ".#BWidget.#$tkwidget"
    set old      [$path cget $realopt]
    $path configure $realopt $value
    set res      [$path cget $realopt]
    $path configure $realopt $old

    return $res
}






>
>
>
>
>
>
>
>
>
>
>
>
>









|







 







|







1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
....
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
        }
    } else {
        set optclass [string range $option 1 end]
    }
    return [list $optdb $optclass]
}

# ----------------------------------------------------------------------------
#  Command Widget::_make_tk_widget_name
# ----------------------------------------------------------------------------
# Before, the widget meta name was build as: ".#BWidget.#$tkwidget"
# This does not work for ttk widgets, as they have an "::" in their name.
# Thus replace any "::" by "__" will do the job.
proc Widget::_make_tk_widget_name { tkwidget } {
    set pos 0
    for {set pos 0} {0 <= [set pos [string first "::" $tkwidget $pos]]} {incr pos} {
	set tkwidget [string range $tkwidget 0 [expr {$pos-1}]]__[string range $tkwidget [expr {$pos+2}] end]
    }
    return ".#BWidget.#$tkwidget"
}

# ----------------------------------------------------------------------------
#  Command Widget::_get_tkwidget_options
# ----------------------------------------------------------------------------
proc Widget::_get_tkwidget_options { tkwidget } {
    variable _tk_widget
    variable _optiondb
    variable _optionclass

    set widget [_make_tk_widget_name $tkwidget]
    # encapsulation frame to not pollute '.' childspace
    if {![winfo exists ".#BWidget"]} { frame ".#BWidget" }
    if { ![winfo exists $widget] || ![info exists _tk_widget($tkwidget)] } {
	set widget [$tkwidget $widget]
	# JDC: Withdraw toplevels, otherwise visible
	if {[string equal $tkwidget "toplevel"]} {
	    wm withdraw $widget
................................................................................
# ----------------------------------------------------------------------------
#  Command Widget::_test_tkresource
# ----------------------------------------------------------------------------
proc Widget::_test_tkresource { option value arg } {
#    set tkwidget [lindex $arg 0]
#    set realopt  [lindex $arg 1]
    foreach {tkwidget realopt} $arg break
    set path     [_make_tk_widget_name $tkwidget]
    set old      [$path cget $realopt]
    $path configure $realopt $value
    set res      [$path cget $realopt]
    $path configure $realopt $old

    return $res
}