Re: Images on disabled buttons look bad

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Images on disabled buttons look bad
De : user2544 (at) *nospam* newsgrouper.org.invalid (Martin (m0h))
Groupes : comp.lang.tcl
Date : 28. Feb 2025, 16:14:54
Autres entêtes
Message-ID : <1740755694-2544@newsgrouper.org>
References : 1 2 3
User-Agent : Newsgrouper/0.7.0

Harald Oehlmann <wortkarg3@yahoo.com> posted:

Am 27.02.2025 um 08:11 schrieb Christian Gollwitzer:
Am 26.02.25 um 23:49 schrieb Martin (m0h):
>
My image looks fine when it is on a normal button. When I change the
state of the button to disabled the image is stippled. Is there a way
to change this default behaviour?
 
This is intended in order to provide visual feedback. If you use a
ttk::button, you can provide your own disabled image instead. Create a
disabled image e.g. grayscale or toned-down version, and then pass a
list to -image. YOu can specify multiple images for different states of
the button, so that should be
"normalimage disabled disabledimage" (untested)
 
See: https://www.tcl-lang.org/man/tcl/TkCmd/ttk_widget.htm#M-image
 
Christian
 
Wow, I did not know this trick, awesome !
 
Here is an example with the disabled state on tk 8.6:
 
% ttk::button .b -image {::tk::icons::information disabled
::tk::icons::error}
% pack .b
-> shows the information icon
% .b state disabled
-> shows the error icon
 
GREAT !!!
 
Thanks Christian,
Harald
Hello Harald,

thank you for the example. It was of great help to quickly test the Ttk feature in question.

Martin (m0h)

Date Sujet#  Auteur
26 Feb 25 * Images on disabled buttons look bad6Martin (m0h)
27 Feb 25 `* Re: Images on disabled buttons look bad5Christian Gollwitzer
27 Feb 25  +* Re: Images on disabled buttons look bad2Harald Oehlmann
28 Feb 25  i`- Re: Images on disabled buttons look bad1Martin (m0h)
28 Feb 25  `* Re: Images on disabled buttons look bad2Martin (m0h)
28 Feb 25   `- Re: Images on disabled buttons look bad1saito

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal