HISE Logo Forum
    • Categories
    • Register
    • Login

    .get("childComponents") does not work or am I misunderstanding something?

    Scheduled Pinned Locked Moved Scripting
    6 Posts 2 Posters 191 Views
    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.
    • VirtualVirginV
      VirtualVirgin
      last edited by VirtualVirgin

      Screenshot 2025-05-04 at 5.09.23 PM.png

      Child components can be seen in the JSON of Panel1:

      Screenshot 2025-05-04 at 5.09.30 PM.png

      What am I doing wrong? Is there some other method that is supposed to be used to get the child components?

      You can listen to my orchestral mockups here:
      https://www.virtualvirgin.net/

      d.healeyD 1 Reply Last reply Reply Quote 1
      • d.healeyD
        d.healey @VirtualVirgin
        last edited by d.healey

        @VirtualVirgin With a few exceptions .get only retrieves properties that are accessible in the property editor.

        You can use this method to get the children. As is always the case when getting component references, this should only be used in on init (or an inline function called from on init).

        for (c in Content.getAllComponents(""))
        {
        	if (c.get("parentComponent") == "Panel1")
        		Console.print(c.getId() + " is a child of the panel");
        	else
        		Console.print(c.getId() + " is not a child of the panel");
        }
        

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        VirtualVirginV 1 Reply Last reply Reply Quote 1
        • VirtualVirginV
          VirtualVirgin @d.healey
          last edited by

          @d-healey Thanks :) I guess I will have to store the component references in a panel then as I need to use them during a callback.

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @VirtualVirgin
            last edited by

            @VirtualVirgin You can store them in consts within on init or in a namespace like any other component reference.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            VirtualVirginV 1 Reply Last reply Reply Quote 0
            • VirtualVirginV
              VirtualVirgin @d.healey
              last edited by VirtualVirgin

              @d-healey Thanks :) The components are being created and referenced in an inline function though.

              You can listen to my orchestral mockups here:
              https://www.virtualvirgin.net/

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @VirtualVirgin
                last edited by

                @VirtualVirgin Ah I see, then yeah a panel is probably the way to go unless you want to return them in an array or object

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

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

                25

                Online

                1.7k

                Users

                11.9k

                Topics

                103.4k

                Posts