SpeedBar change several buttons flashes
Posted: Sat Nov 21, 2015 4:54 am
Now that I have my speedbar up and running (for the most part), I am seeing some poor refreshing.
My toolbar has up to 25 AISS images (no text). Depending on what the user is doing I change the SBNA_Disabled state of all 25 at once. Some get disabled, some get enabled. When I do this the entire speedbar is "removed" (all the buttons are gone), then all redrawn. This causes a major flashing of the bar. Not smooth at all.
IIntuition->SetAttrs() can't seem to remove/add the list, correct? I have to use IIntuition->SetGadgetAttrs(). The autodoc says IIntuition->SetGadgetAttrs() does an immediate redraw, which I am seeing. I am not changing the button's type, spacing, etc. so a WM_RETHINK is not necessary. Is there a way around this method?
My toolbar has up to 25 AISS images (no text). Depending on what the user is doing I change the SBNA_Disabled state of all 25 at once. Some get disabled, some get enabled. When I do this the entire speedbar is "removed" (all the buttons are gone), then all redrawn. This causes a major flashing of the bar. Not smooth at all.
Code: Select all
IIntuition->SetGadgetAttrs((struct Gadget *)Objects[GAD_TOOLBAR1_SPEEDBAR],MainWindow,NULL,
SPEEDBAR_Buttons, NULL,
TAG_DONE);
// go through all 25
ISpeedBar->SetSpeedButtonNodeAttrs(MasterToolBarNode->SBNode,
SBNA_Disabled, TRUE,
TAG_DONE);
IIntuition->SetGadgetAttrs((struct Gadget *)Objects[GAD_TOOLBAR1_SPEEDBAR],MainWindow,NULL,
SPEEDBAR_Buttons, ToolBar1SpeedBarList,
TAG_DONE);