I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button text
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.
Donald Rozenberg schrieb am Sonntag, 16. Januar 2022 um 17:26:40 UTC+1:When the variables aren't set before you configure -textvariable, configuring -textvariable on a [button] preserves the current -text option by creating and setting the variable to that value. [ttk::button] does not, so it wipes the current value (from -
I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button text
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.I don't understand what you mean. Your code works for me as expected. I can set the ::vt variable and the ttk button updates automatically.
On Sunday, 16 January 2022 at 18:44:26 UTC, Alexandru wrote:-text) and overrides it with a blank value from the non-existant -textvariable variable. If you run the example above, you'll see the button still says "Button" but the ttk::button loses its label and becomes blank.
Donald Rozenberg schrieb am Sonntag, 16. Januar 2022 um 17:26:40 UTC+1:
I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button text
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
When the variables aren't set before you configure -textvariable, configuring -textvariable on a [button] preserves the current -text option by creating and setting the variable to that value. [ttk::button] does not, so it wipes the current value (fromI consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.I don't understand what you mean. Your code works for me as expected. I can set the ::vt variable and the ttk button updates automatically.
On Sunday, January 16, 2022 at 3:19:53 PM UTC-8, Mike Griffiths wrote:from -text) and overrides it with a blank value from the non-existant -textvariable variable. If you run the example above, you'll see the button still says "Button" but the ttk::button loses its label and becomes blank.
On Sunday, 16 January 2022 at 18:44:26 UTC, Alexandru wrote:
Donald Rozenberg schrieb am Sonntag, 16. Januar 2022 um 17:26:40 UTC+1: >>>> I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button textWhen the variables aren't set before you configure -textvariable, configuring -textvariable on a [button] preserves the current -text option by creating and setting the variable to that value. [ttk::button] does not, so it wipes the current value (
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.I don't understand what you mean. Your code works for me as expected. I can set the ::vt variable and the ttk button updates automatically.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.
I understand what is happening. My complaint is that the behavors are different and I think that they should be the same and I prefer the button behavor over the ttk::button.
On Sunday, January 16, 2022 at 3:19:53 PM UTC-8, Mike Griffiths wrote:from -text) and overrides it with a blank value from the non-existant -textvariable variable. If you run the example above, you'll see the button still says "Button" but the ttk::button loses its label and becomes blank.
On Sunday, 16 January 2022 at 18:44:26 UTC, Alexandru wrote:
Donald Rozenberg schrieb am Sonntag, 16. Januar 2022 um 17:26:40 UTC+1:
I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button text
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
When the variables aren't set before you configure -textvariable, configuring -textvariable on a [button] preserves the current -text option by creating and setting the variable to that value. [ttk::button] does not, so it wipes the current value (I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.I don't understand what you mean. Your code works for me as expected. I can set the ::vt variable and the ttk button updates automatically.
I understand what is happening. My complaint is that the behavors are different and I think that they should be the same and I prefer the button behavor over the ttk::button.I was replying to Alexandru who said he did not :)
I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button text
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.
On Monday, 17 January 2022 at 00:25:06 UTC, Donald Rozenberg wrote:from -text) and overrides it with a blank value from the non-existant -textvariable variable. If you run the example above, you'll see the button still says "Button" but the ttk::button loses its label and becomes blank.
On Sunday, January 16, 2022 at 3:19:53 PM UTC-8, Mike Griffiths wrote:
On Sunday, 16 January 2022 at 18:44:26 UTC, Alexandru wrote:
Donald Rozenberg schrieb am Sonntag, 16. Januar 2022 um 17:26:40 UTC+1:
I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button text
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
When the variables aren't set before you configure -textvariable, configuring -textvariable on a [button] preserves the current -text option by creating and setting the variable to that value. [ttk::button] does not, so it wipes the current value (I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.I don't understand what you mean. Your code works for me as expected. I can set the ::vt variable and the ttk button updates automatically.
I understand what is happening. My complaint is that the behavors are different and I think that they should be the same and I prefer the button behavor over the ttk::button.I was replying to Alexandru who said he did not :)
Mike Griffiths schrieb am Dienstag, 18. Januar 2022 um 00:26:46 UTC+1:from -text) and overrides it with a blank value from the non-existant -textvariable variable. If you run the example above, you'll see the button still says "Button" but the ttk::button loses its label and becomes blank.
On Monday, 17 January 2022 at 00:25:06 UTC, Donald Rozenberg wrote:
On Sunday, January 16, 2022 at 3:19:53 PM UTC-8, Mike Griffiths wrote:
On Sunday, 16 January 2022 at 18:44:26 UTC, Alexandru wrote:
Donald Rozenberg schrieb am Sonntag, 16. Januar 2022 um 17:26:40 UTC+1: >>>>>> I have noticed that when the textvariable option is specified for a button widget the variable its value is set to the current value of the button textWhen the variables aren't set before you configure -textvariable, configuring -textvariable on a [button] preserves the current -text option by creating and setting the variable to that value. [ttk::button] does not, so it wipes the current value (
while specifying the textvariable option for a ttk::button widget leaves the variable unset. This is demonstrated in the following snippet.I don't understand what you mean. Your code works for me as expected. I can set the ::vt variable and the ttk button updates automatically.
button .b -text Button
ttk::button .tb -text Tbutton
pack .b .tb
.b configure -textvariable vb
.tb configure -textvariable vt
puts "vb = $vb"
puts [info exists vt]
This textvariable implementation extends to other ttk widgets besides ttk::button widgets.
I consider this to be a significant design oversite - bug - and hope it will be corrected. I have an Open Source tkinter GUI generator called PAGE written in tcl and this is causing me fits.
I understand what is happening. My complaint is that the behavors are different and I think that they should be the same and I prefer the button behavor over the ttk::button.I was replying to Alexandru who said he did not :)
I have misunderstood the original issue. Indeed I can confirm the behavior. But I like the new behavior. I wouldn't change it.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 33:47:16 |
Calls: | 6,449 |
Calls today: | 1 |
Files: | 12,052 |
Messages: | 5,254,986 |