ListBrowser disable / enable bug?

This forum is for general developer support questions.
Post Reply
User avatar
ktadd
Posts: 48
Joined: Wed Nov 09, 2011 5:50 am

ListBrowser disable / enable bug?

Post by ktadd »

I'm using a listbrowser in my program and I when I set it up I have it disabled.

Code: Select all

LAYOUT_AddChild, gadgets[GID_EFFECTS_LIST] = (struct Gadget *)ListBrowserObject,
					GA_ID, GID_EFFECTS_LIST,
					GA_RelVerify, TRUE,
					GA_Disabled, TRUE,
					LISTBROWSER_AutoFit, TRUE,
					LISTBROWSER_Labels, (ULONG)effects_list,
					LISTBROWSER_ColumnInfo, (ULONG)&effects_list_column_info,
					LISTBROWSER_ColumnTitles, TRUE,
					LISTBROWSER_MultiSelect, FALSE,
					LISTBROWSER_ShowSelected, TRUE,
					LISTBROWSER_Selected, 0,
					LISTBROWSER_VerticalProp, TRUE,
					LISTBROWSER_HorizontalProp, TRUE,
					LISTBROWSER_MinVisible, MIN_EFFECTS_LIST_ROWS,
					LISTBROWSER_VertSeparators, TRUE,
					LISTBROWSER_HorizSeparators, FALSE,
					LISTBROWSER_Spacing, 2,
					LISTBROWSER_Editable, FALSE,
					LISTBROWSER_Striping, TRUE,
				ListBrowserEnd, 
Then I use the following to enable it:
IIntuition->OnGadget(gadgets[GID_EFFECTS_LIST], win, NULL);

The main part of the list is enabled but scrollers aren't enabled until I click on them and it's not possilbe to enable the arrows in the corner at all.
Am I doing something wrong?
Image
Kevin - X1000 first contact / uA1
User avatar
trixie
Posts: 409
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: ListBrowser disable / enable bug?

Post by trixie »

With BOOPSI/ReAction gadgets, always use SetAttrs() / SetGadgetAttrs() to change their attributes. Never use old Intuition functions like OnGadget():

Code: Select all

IIntuition->SetGadgetAttrs(gadgets[GID_EFFECTS_LIST], win, NULL, GA_Disabled, FALSE, TAG_END);
You need to use SetGadgetAttrs() here instead of SetAttrs() because you want the gadget to refresh its imagery.
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
ktadd
Posts: 48
Joined: Wed Nov 09, 2011 5:50 am

Re: ListBrowser disable / enable bug?

Post by ktadd »

@trixie

Thanks, I'll change my code....tomorrow.
It's 2:30am. Time to go to bed.

Kevin
Kevin - X1000 first contact / uA1
User avatar
ktadd
Posts: 48
Joined: Wed Nov 09, 2011 5:50 am

Re: ListBrowser disable / enable bug?

Post by ktadd »

Hmm....so in my program I went and changed all the gadget enable and disable lines to use the recommended call:

IIntuition->SetGadgetAttrs(gadgets[GID_START_TIME], win, NULL, GA_Disabled, FALSE, TAG_END);

This worked and solved the problem of hte list gadget not enabling right but now using that call my string gadgets don't ghost or un-ghost until I actually click in them. They activate and de-activate properly though. If I use

IIntuition->OnGadget(gadgets[GID_START_TIME], win, NULL);

They activate and become ghosted or un-ghosted as they should. Is there a bug?

Here is the gadget setup:

LAYOUT_AddChild, gadgets[GID_START_TIME] = (struct Gadget *)StringObject,
GA_ID, GID_START_TIME,
GA_RelVerify, TRUE,
GA_Disabled, TRUE,
GA_ReadOnly, FALSE,
GA_TabCycle, TRUE,
GA_Underscore, '_',
GA_ActivateKey, "s",
STRINGA_EditHook, (Tag)&time_edithook,
STRINGA_ReplaceMode, TRUE,
STRINGA_AllowMarking, FALSE,
STRINGA_DisablePopup, TRUE,
STRINGA_TextVal, cmds.start_time,
StringEnd,
CHILD_Label, LabelObject, LABEL_Text, "_Start Time", LabelEnd,
CHILD_WeightedHeight, 0,
CHILD_WeightedWidth, 10,
Kevin - X1000 first contact / uA1
User avatar
trixie
Posts: 409
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: ListBrowser disable / enable bug?

Post by trixie »

@ ktadd

Perhaps IIntuition->RefreshSetGadgetAttrs() is needed for the string gadgets?
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Post Reply