SpeedBar change several buttons flashes

This forum is for general developer support questions.

SpeedBar change several buttons flashes

Postby mritter0 » Sat Nov 21, 2015 5: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.

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);


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?
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 211
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: SpeedBar change several buttons flashes

Postby salass00 » Sat Nov 21, 2015 10:45 am

You should use:
Code: Select all
IIntuition->SetAttrs(Objects[GAD_TOOLBAR1_SPEEDBAR],
   SPEEDBAR_Buttons, ~0,
TAG_DONE);

to detach the list and SetGadgetAttrs() only to attach it.

The ~0 value for SPEEDBAR_Buttons is made for temporary list removal like this and is explained in the autodoc.

The only difference between SetAttrs() and SetGadgetAttrs() is that SetGadgetAttrs() provides a GadgetInfo structure allowing the gadget to refresh itself if it wants to, but in this case you don't want it to so SetAttrs() is enough.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 503
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: SpeedBar change several buttons flashes

Postby mritter0 » Sun Nov 22, 2015 12:31 am

Thanks
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 211
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA


Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron