Changing Command Icons of the Toolbar
-
Thanks TIG, but I already tried that way and it didn't work after the command was added to the toolbar, u can refer to the Mr.K post above.
-
@anton_s said:
Thanks TIG, but I already tried that way and it didn't work after the command was added to the toolbar, u can refer to the Mr.K post above.
It will change ToolTips etc so perhaps if you hide/show the toolbar ?
-
Ya I tried this several ways, text does change but the icons never do(hide, show, remove toolbar and add it again nothing changes).
It seems SU only loads those images once and they can't be refresh through Ruby. -
Yup. Seems that only the tooltip in the Command objects are actually linked to the toolbar objects it represent. The rest seem to be forgotten.
-
Bum!
The best you could do then for something like a 'Play' > 'Stop' button is to have two buttons side by side, with one disabled [grayed-out] if the other one is enabled - using a validation_proc... -
@tig said:
Bum!
The best you could do then for something like a 'Play' > 'Stop' button is to have two buttons side by side, with one disabled [grayed-out] if the other one is enabled - using a validation_proc...Or for Play/Stop, just make the Play button pressed or not pressed - using
MF_CHECKED
andMF_UNCHECKED
. -
@thomthom said:
@tig said:
Bum!
The best you could do then for something like a 'Play' > 'Stop' button is to have two buttons side by side, with one disabled [grayed-out] if the other one is enabled - using a validation_proc...Or for Play/Stop, just make the Play button pressed or not pressed - using
MF_CHECKED
andMF_UNCHECKED
.Yeah Thanks!...
This would not be a bad idea.
I think changing toolbar icons should be part of SU 9 wishes. -
I've found this rather old topic, and have a question is it possible now to change toolbar icons.
I would like to change tool icon when some variable (@@active_extension) is changed.
[ruby]@@activateCmd.set_validation_proc(){ puts "Active #{@@active_extension}" puts "before #{@@activateCmd.small_icon}" if @@active_extension == 'ext1' @@activateCmd.small_icon = File.join(icons_dir,"ext1_16.png") @@activateCmd.large_icon = File.join(icons_dir,"ext1_24.png") elseif @@active_extension == 'ext2' @@activateCmd.small_icon = File.join(icons_dir,"ext2_16.png") @@activateCmd.large_icon = File.join(icons_dir,"ext2_24.png") end puts "after #{@@activateCmd.small_icon}" MF_ENABLED }[/ruby]
This part of code validates command and prints correct icon path (which is changed in accordance with @@active_extension variable), but tool image in toolbar is not updated.
I've also tried to put this change not in set_validation_proc(), but in code after variable is changed. Again correct values are printed, but image remains the same.
Thanks in advance,
Marija -
Hi Marija, I just tested changing icons on SU2016, on Windows OS, and it still doesn't work.
-
Thanks Anton,
I was thinking, that I'm doing something wrong, but it seems that this behaviour is not changed yet.
Advertisement