HISE Logo Forum
    • Categories
    • Register
    • Login

    FileSystem.browse() if user cancels

    Scheduled Pinned Locked Moved Scripting
    4 Posts 3 Posters 31 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.
    • iamlampreyI
      iamlamprey
      last edited by

      Is there a way to check for this? I have a hacky processBlock which starts running when the user clicks the button, but if they cancel/close the fileBrowser it causes a runaway memory leak

      Something like this won't work:

      FileSystem.browse("", true, "*wav", function(fileToSave)
      {
          if (!isDefined(fileToSave) { /* do stuff */ } // doesn't get called when cancelled
      });
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • C
        charlotteemma
        last edited by

        on Change lets me detect when they choose a file, but I would also like to know when they cancel (close the file choose dialog without selecting anything). in both cases. That is, it is triggered by a click either on the Open spacebar clicker button or on the Cancel button in the File Dialog. The change event is triggered a few milliseconds after the Open button is clicked. It is never triggered if the Cancel button is clicked. The cancel event is also fired when the file picker dialog gets closed, or canceled, via the "cancel" button or the escape key

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

          @iamlamprey You need Christoph to merge my PR

          https://github.com/christophhart/HISE/pull/701

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          iamlampreyI 1 Reply Last reply Reply Quote 1
          • iamlampreyI
            iamlamprey @d.healey
            last edited by

            @d-healey Nice, in the meantime I'll modify it locally.

            @Christoph-Hart merge request initiated 🤖

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

            33

            Online

            2.0k

            Users

            12.8k

            Topics

            110.6k

            Posts