I am gettin ideas how to inverse the selection state in a listbrowser, but none seems straightforward.
Id someone has programmed such functionality, i would be glad to know how.
I haven't tested it but this function should do what you want:
void InvertListBrowser(Object *wnd, Object *lb) { struct Window *window; struct List *list; struct Node *node; uint32 selected; // get list IIntuition->GetAttr(LISTBROWSER_Labels, lb, (uint32 *)&list); // remove list IIntuition->SetAttrs(lb, LISTBROWSER_Labels, ~0, TAG_END); // make changes for (node = list->lh_Head; node->ln_Succ; node = node->ln_Succ) { selected = FALSE; IListBrowser->GetListBrowserNodeAttrs(node, LBNA_Selected, &selected, TAG_END); IListBrowser->SetListBrowserNodeAttrs(node, LBNA_Selected, !selected, TAG_END); } // get intuition window pointer window = NULL; IIntuition->GetAttr(WINDOW_Window, wnd, (uint32)&window); // readd list and refresh IIntuition->SetGadgetAttrs((struct Gadget *)lb, window, NULL, LISTBROWSER_Labels, list, TAG_END);}
@salss00 Worked out of the box.
So much more simple than i imagined
Thanks a lot
I haven't tested it but this function should do what you want:
@salss00
Worked out of the box.
So much more simple than i imagined
Thanks a lot