ListBrowser disable / enable bug?

This forum is for general developer support questions.

ListBrowser disable / enable bug?

Postby ktadd » Wed Mar 28, 2012 9:58 am

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
ktadd
 
Posts: 21
Joined: Wed Nov 09, 2011 5:50 am

Re: ListBrowser disable / enable bug?

Postby trixie » Wed Mar 28, 2012 10:17 am

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.
SAM440ep-flex @ 667MHz / 1GB RAM / ATI Radeon 9250 / AmigaOS 4.1 Update 6
Author of WordNet for OS4
User avatar
trixie
 
Posts: 135
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: ListBrowser disable / enable bug?

Postby ktadd » Wed Mar 28, 2012 10:24 am

@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: 21
Joined: Wed Nov 09, 2011 5:50 am

Re: ListBrowser disable / enable bug?

Postby ktadd » Sat Mar 31, 2012 11:26 pm

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
ktadd
 
Posts: 21
Joined: Wed Nov 09, 2011 5:50 am

Re: ListBrowser disable / enable bug?

Postby trixie » Mon Apr 02, 2012 6:52 am

@ ktadd

Perhaps IIntuition->RefreshSetGadgetAttrs() is needed for the string gadgets?
SAM440ep-flex @ 667MHz / 1GB RAM / ATI Radeon 9250 / AmigaOS 4.1 Update 6
Author of WordNet for OS4
User avatar
trixie
 
Posts: 135
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic


Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 0 guests