[GH-ISSUE #159] How to build treeview option using OptionTree or TreeCtrl? #67

Closed
opened 2026-05-05 03:37:27 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @erusyd on GitHub (Aug 10, 2023).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/159

How to build treeview option like this using OptionTree or TreeCtrl?
treeview
I've read the api, only lead to this:

    optree.Clear();
    optree.SetRoot("Select line");
    for (int i = 0; i < total_sensor; ++i) {
        optree.Add(0, "Sensor: " + AsString(i));
        optree.Add(1, "rawCount");
        optree.Add(1, "baseLine");
        optree.Add(1, "diffCount");
    }

2023-08-10_14-59

Originally created by @erusyd on GitHub (Aug 10, 2023). Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/159 How to build treeview option like this using OptionTree or TreeCtrl? ![treeview](https://github.com/ultimatepp/ultimatepp/assets/1529102/a72ab799-fe0b-48be-9ca3-f2a6cb127b87) I've read the api, only lead to this: ``` optree.Clear(); optree.SetRoot("Select line"); for (int i = 0; i < total_sensor; ++i) { optree.Add(0, "Sensor: " + AsString(i)); optree.Add(1, "rawCount"); optree.Add(1, "baseLine"); optree.Add(1, "diffCount"); } ``` ![2023-08-10_14-59](https://github.com/ultimatepp/ultimatepp/assets/1529102/4d3dc989-dc36-468c-ada5-cd9320669adf)
Author
Owner

@erusyd commented on GitHub (Aug 10, 2023):

Change code to this succeeded:

    optree.Clear();
    optree.SetRoot("Select line");
    int id
    for (int i = 0; i < total_sensor; ++i) {
        id = optree.Add(0, "Sensor: " + AsString(i));
        optree.Add(id, "rawCount");
        optree.Add(id, "baseLine");
        optree.Add(id, "diffCount");
    }
<!-- gh-comment-id:1672963380 --> @erusyd commented on GitHub (Aug 10, 2023): Change code to this succeeded: ``` optree.Clear(); optree.SetRoot("Select line"); int id for (int i = 0; i < total_sensor; ++i) { id = optree.Add(0, "Sensor: " + AsString(i)); optree.Add(id, "rawCount"); optree.Add(id, "baseLine"); optree.Add(id, "diffCount"); } ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ultimatepp#67
No description provided.