Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
60 user(s) are online (57 user(s) are browsing Forums)

Members: 0
Guests: 60

more...

Support us!

Headlines

 
  Register To Post  

ListBrowser gadget question
Just popping in
Just popping in


See User information
Hi all,

I got that far with displaying a column in my program but I get stuck with displaying something in there. I know I need to setup a node but that is the point I get stuck. I know I need to use AllocListBrowserNode and I was hoping someone had a simple example for me. I checked all the available examples out there but I can't seem to figure it out.

I appreciate any help in this matter.

Cheers,
Coder

Can't get enough of me?
The Bucket Diary
Go to top
Re: ListBrowser gadget question
Just popping in
Just popping in


See User information
@Coder

You can find rather comprehensive examples in sdk:Examples/Reaction/OS4Examples/ListBrowser/.

Go to top
Re: ListBrowser gadget question
Home away from home
Home away from home


See User information
@Coder
Here is how i add text to my listbrowser. I have 3 rows.
But always deatach the list from the listbrowser before altering it. And then reattach it afterwards. Hope it helps.

SetGadgetAttrs(gadgets[GID_LISTVIEW], windows[WID_MAIN], NULL,LISTBROWSER_Labels, ~0,TAG_DONE);
node = (struct Node *)AllocListBrowserNode(3,
LBNA_Column, 0,
LBNCA_CopyText, TRUE,
LBNCA_Text,"This is row 1",
LBNA_Column, 1,
LBNCA_CopyText, TRUE,
LBNCA_Text,"This is row 2",
LBNA_Column, 2,
LBNCA_CopyText, TRUE,
LBNCA_Text,"This is row 3",
TAG_DONE);
AddTail( &liste, node);
RefreshSetGadgetAttrs(gadgets[GID_LISTVIEW], windows[WID_MAIN], NULL,LISTBROWSER_Labels,&liste ,TAG_DONE);

X5000
Go to top
Re: ListBrowser gadget question
Amigans Defender
Amigans Defender


See User information
@Antique

You have a multi-column listbrowser there. Have you provided a pointer to struct ColumnInfo with your gadget? Your example won't work unless you AllocLBColumnInfo() first and pass it in the LISTBROWSER_ColumnInfo tag. Even if you don't need column titles you must still provide a ColumnInfo! Here's the code:

struct ColumnInfo *colinfo = NULL;

colinfo = IListBrowser->AllocLBColumnInfo(3,
LBCIA_Column, 0,
LBCIA_Title, NULL,
LBCIA_Weight, 33,
LBCIA_DraggableSeparator, TRUE,
LBCIA_Column, 1,
LBCIA_Title, NULL,
LBCIA_Weight, 33,
LBCIA_DraggableSeparator, TRUE,
LBCIA_Column, 2,
LBCIA_Title, NULL,
LBCIA_Weight, 34,
TAG_DONE);

LBCIA_Weight takes a proportional width of the respective column. The total of the widths must equal 100. Here the listbrowser has three columns of the same width.

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
Go to top
Re: ListBrowser gadget question
Home away from home
Home away from home


See User information
@trixie

Yes i do have that. But since he managed to get columns in his listbrowser i think that part is ok.

struct ColumnInfo ci[] =
{
{ 10, "Nr", 0 },
{ 180, "Produkt", CIF_SORTABLE },
{ 20, "Antall", 0 },
{ -1, (STRPTR)~0, -1 }
};

X5000
Go to top
Re: ListBrowser gadget question
Amigans Defender
Amigans Defender


See User information
@Antique

Good. Let's see what Coder does in HIS code

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
Go to top
Re: ListBrowser gadget question
Just popping in
Just popping in


See User information
@all

Thanks guys. I will have a crack at this. Seems my Sunday is planned.

Coder

Can't get enough of me?
The Bucket Diary
Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project