issue effecting only standalone instance

Home Forums General Programming issue effecting only standalone instance

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11481
    msepsis
    Participant
      • Topics: 219
      • Replies: 732
      • Total: 951
      • ★★★

      I have a few buttons on my panel that have attached to them methods to either load or save data from the panel to a file (see here for the approach I took).

      As I mention at the end of that thread I had some issues with these buttons being triggered on panel load. I solved the issue by adding a button off canvas “fileFunctions” which I originally have set to 0 but then the get set to 1 from a timer that runs a few ms after the panel loads. Any of these file save/load buttons have a check to see if the “fileFunctions” button is true or false. it must be true to run.

      This works great with the panel in ctrlr, if I don’t have something like this implemented, I will get prompted to save a bunch of data from the panel to files, then load the data from files, as that’s what my file buttons do.

      So like I’ve said above everything works as it should with this in place when in ctrlr. When I close the panel, close ctrlr then reload ctrlr and the panel it still functions just as it should. I never see these messages asking to save/load data from/to the panel.

      When I export the panel to a restricted instance however after the first load of the resulting panel application I get prompted to save/load data. The only real fix here is to go to the user folder and trash the panel’s preferences. Fine but a pain in the ass. You also can just save a dummy file then load that dummy file but when the panel loads it never seems to run the method that’s supposed to run after the panel loads. If I cancel when it asks to save data the whole panel freezes until you force-quit it.

      any suggestions or ideas??

      Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

      #11491
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        It’s not a bug as much as it’s a poor design (my fault).

        There are a couple of stages when Ctrlr loads, in the case of a single instance (doesn’t matter if it’s restricted or not) there are some additional stages.

        Anyway for now you have a check panel:getRestoreState() that’s valid, but it only checks if Ctrlr is in the first stage of loading, i added a panel:getProgramState() that checks when the panel is getting it’s program parameters. When Ctrlr loads a single instance the values that are set initially come from a program, so that call will return true whenever a program is set (on load too), but will return false in normal running state. This will be useful in a moment when using the program manager.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The forum ‘Programming’ is closed to new topics and replies.
      There is currently 0 users and 108 guests online
      No users are currently active
      Forum Statistics
      Threads: 2,495, Posts: 17,374, Members: 77,605
      Most users ever online was 12 on January 22, 2019 3:47 pm
      Ctrlr