Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    TreeViews with GeListHead and a checkbox column can lock up C4D

    Cinema 4D SDK
    c++
    2
    3
    756
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kbarK
      kbar
      last edited by

      Just came across a bug that took me about 2 hours to figure out.

      1. Create a AutoAlloc<GeListHead> and add some child nodes. Store this in a GeDialog.
      2. In your GeDialog create a TreeView. Set the TreeViewCustomGui->SetRoot( mygelisthead->GetFirst(), &treeviewfuncs, this));
      3. In your TreeViewFunctions::GetFirst() { return root;}
      4. When setting your treeview layouts, add a checkbox. layout.SetInt32(TREE_COLUMNS_CHECK, LV_CHECKBOX);
      5. Implement the functions for IsChecked and SetCheck
      6. Run your code and when you click on the checkbox it will enter an endless loop somewhere in the c4dplugins code.

      The reason for this is (2). Instead of calling SetRoot(mygelisthead->GetFirst()...). I should have just passed in the GeListHead.

      Then for (3) I should have returned the First element: GeListHead op = (GeListHead)root; return op->GetFirst();

      With these changes it works, but that took a while to figure out.

      https://www.gamelogicdesign.com
      https://www.plugins4d.com

      1 Reply Last reply Reply Quote 1
      • a_blockA
        a_block
        last edited by

        Hi Kent,

        I'm not quite sure, if there's a question left in here?
        From what I understand, we probably need to improve the TreeView documentation. But there's no bug involved on our side, right?

        Cheers,
        Andreas

        1 Reply Last reply Reply Quote 0
        • kbarK
          kbar
          last edited by kbar

          There is no question here. Just a bug report and a warning/info to other users if they get C4D locking up when using a treeview.

          https://www.gamelogicdesign.com
          https://www.plugins4d.com

          1 Reply Last reply Reply Quote 0
          • First post
            Last post