Regarding colums and listbrowsers. Do you have to show all the columns? Or can i have more info(more columns) in the node than i want to be shown in the listbrowser? I'd like to have 2 extra columns that contains info that i do not want to be visible.
Yes, that works, and is something I make use of occasionally.
Probably the better way though, is to allocate a structure, fill the data and add it to the LBNA_UserData field.
But hidden columns works as well.
Simon
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such. ---- http://codebench.co.uk
Speaking of hiding: have you noticed that when you hide a node (or any odd number of nodes) in a listbrowser list with LISTBROWSER_Striping, TRUE, the striping effect will be borked? It appears that the stripes are applied to all nodes in the list, not just the visible ones as it should be. This is with the latest public listbrowser.gadget, 53.52.
No, I haven't, but then I don't use that feature anywhere.
Perhaps you have a small example showing this?
Simon
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such. ---- http://codebench.co.uk
Just check the striping feature section of the listbrowser code; if you don't see the LBFLG_HIDDEN flag being checked for, then you know that the feature is wrongly implemented.
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such. ---- http://codebench.co.uk
Is there any example on how we could use it, adding data to it, and sort the same column based on these data?
You define a data structure, allocate memory for it, fill in your data, then add the pointer to the structure to the LBNA_UserData field via SetListBrowserNodeAttrs(). When freeing your listbrowser list you must retrieve all existing pointers from all LBNA_UserData fields and free the allocated memory.
But I don't think you can sort columns based on that because the user data field relates to the entire node, not individual columns.
@trixie I see... Thanks for your remarks. So, if you want to sort the list based on info you don't want to be visible, then the only easy way to do it is to have a hidden column in listbrowser.
If you don't want the info you are sorting on to be visible then ofcourse you can use the UserData field.
Check the info in the LBM_SORT method. You need to create a hook function and it will be passed a message structure in that structure, suprise suprise are pointers to the userdata pointers of the two nodes being compared in any one invocation of the hook.