Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
112 user(s) are online (91 user(s) are browsing Forums)

Members: 0
Guests: 112

more...

Support us!

Headlines

 
  Register To Post  

listbrowser and struct list question
Home away from home
Home away from home


See User information
When i add nodes to a struct list, all goes well and the new node is added at the end of the list. But now i'm trying to add a node in the middle or at the beginning of the list, and no matter what i try it always goes at the end. Anyone here good at this thing? some code is at the bottom so people can see what i do.

SetGadgetAttrs(gadgets[GID_LISTVIEW], windows[WID_MAIN], NULL,LISTBROWSER_Labels, ~0,TAG_DONE); 
node = (struct Node *)AllocListBrowserNode(4,
                    
LBNA_Column0,
                    
LBNCA_CopyTextTRUE,
                    
LBNCA_Text,tall,
                    
LBNA_Column1,
                    
LBNCA_CopyTextTRUE,
                    
LBNCA_MaxChars255,
                    
LBNCA_Text,test,
                    
LBNA_Column2,
                    
LBNCA_CopyTextTRUE,
                    
LBNCA_Text,type,
                    
LBNCA_JustificationLCJ_CENTRE,
                    
LBNA_Column3,
                    
LBNCA_CopyTextTRUE,
                    
LBNCA_Text,text,
                
TAG_DONE); 
             
AddTail( &listenode); 
RefreshSetGadgetAttrs(gadgets[GID_LISTVIEW], windows[WID_MAIN], NULL,LISTBROWSER_Labels,&liste ,TAG_DONE);


X5000
Go to top
Re: listbrowser and struct list question
Just can't stay away
Just can't stay away


See User information
@Antique

You are using AddTail, which automatically adds the node to the end of the list. You should use

void Insert(struct List *l, struct Node *node, struct Node *nodeToFollow);

...which adds "node" to the list right after "nodeToFollow".

Go to top
Re: listbrowser and struct list question
Just can't stay away
Just can't stay away


See User information
There's also the AddHead function which is like AddTail but adds to the beginning of the list.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project