Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tkx::ttk__style_map doesn't work #3

Open
MaxPerl opened this issue Feb 23, 2017 · 1 comment
Open

Tkx::ttk__style_map doesn't work #3

MaxPerl opened this issue Feb 23, 2017 · 1 comment

Comments

@MaxPerl
Copy link

MaxPerl commented Feb 23, 2017

Hello Mr. Aas,
Thank you very much for your wonderful Tkx module.

Unfortunately Tkx::ttk__style_map doesn't work for me. Enclosed a simple example:


use utf8;
use Tkx;

Tkx::ttk__style_map('TButton -background [list disabled red]');

my $mw = Tkx::widget->new('.');

my $b = $mw->new_ttk__button(	-text	=> 'Hello',
			-command => sub {$mw->g_destroy},
			-state => disabled,
		); 
$b->g_pack();

Tkx::MainLoop();

Pure Tcl with the following commands works just fine:
ttk::style map TButton -background [list disabled red]
ttk::button .b -text "Hello" -state "disabled"
pack .b

Thanks for your help,
Max

@chrstphrchvz
Copy link

I have not tried the example provided here, but I notice an example at https://tkdocs.com/tutorial/styles.html#styleoptions which uses Tkx::List() rather than Tcl list syntax. So I would try:

Tkx::ttk__style_map('TButton',
  -background => Tkx::list('disabled', 'red'),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants