Mail Archives: djgpp/1997/07/04/09:37:33
Tim Lloyd <tlloyd AT zetnet DOT co DOT uk> wrote:
>Hi,
>
>This is a simple question for those of you that use the JPTUI
>interface libraries.
>
>I have created my interface, no probs. However I need to read in a
>file line by line and add each line to a JPTUI listbox.
>
>Here is the code for adding items manually:
>
>TListItem ListBoxItems[]= {
> {"Item 1",LI_NOATTR},
> {"Item 2",LI_NOATTR},
> {"Item 3",LI_NOATTR},
> {NULL,LI_NOATTR}
>};
>TListBox ListBox (&MainWindow,2,2,20,10,"List Bo~x",ListBoxItems);
>
>I presume that I need to fill ListBoxItems[] with each line from my
>file, however I think that may eat memory (as my text file is quite
>large) so loading it directly into the listbox might be a better option.
>
>However I'm only a beginner with C++, I'd really apreciate some help
>with this one as I'm pretty clueless as to where to go from here.
>
>I'm using JPTUI 3.xx.
>
>Thanks in advance, Tim Lloyd.
>
>
>
TListBox is derived from TSimpleList which is derived from TList. So
you can use any method of one of this class.
Search for m_add_item and m_insert_item (methods of TSimpleList.
I advise that you get the last version (4.0a). The doc has been
formatted and I've removed many mistakes.
Jeepy
Jeepy (Jean-Pierre Delprat)
jpdelprat AT teaser DOT fr
www.teaser.fr/~jpdelprat (JPTUI home page)
- Raw text -