[Gambas-user] How to organize dependent lists

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Feb 28 18:18:18 CET 2012


Hi folks,

I would be interested in your opinions. In a project I've got two lists 
of data and further data which are mutually dependent, such as

item 1:
    item 1 a
       data 1 aa
       data 1 ab
    item 1 b
       data 1 ba
       data 1 bb

and so on, which could be seen like a tree or directory structure.

Now my question is, how would YOU organize this internally? I mean, what 
kind of data structure would you prefer to be able to easily find your 
way through it? In the GUI, it looks like two ListBoxes and two TextBoxes:

List1   List2     TextBox1
                   TextBox2

If you choose item1 in List1, List2 will show item1a and item1b. When 
you choose item1a, the Textboxes show data1aa and data1ab. If you choose 
item1b, the Textboxes show data1ba and data1bb.

Of course, I could make a matrix of

item1  item1a  data1aa
item1  item1a  data1ab
item1  item1b  data1ba
item1  item1b  data1bb

but how would my program EASILY find which data to show if the user 
clicks item1a for instance? Another idea was to leave out repetitions:

item1  item1a  data1aa
                data1ab
        item1b  data1ba
                data1bb

This shows the tree-like structure better, but is it a professional 
approach?

Thanks for your ideas.

Rolf




More information about the User mailing list