4 Replies Latest reply on Oct 26, 2010 12:25 PM by areohbee

    showModalProgressDialog: how to mark a long running task

    sschultz lr3 Level 1

      Hello,

      I have a method that should show a progress dialog while running:

       

      local function doSomething()
        LrFunctionContext.postAsyncTaskWithContext("ProgressContextId", function(context)
          local progressScope = LrDialogs.showModalProgressDialog({
            title = "Doing something",
            cannotCancel = true,
            functionContext = context
          })
          progressScope:setIndeterminate()

       

          -- do the long running work
          -- LrTasks.sleep( 0.1 )

       

              -- does lot of things   
        end)
      end

       

       

      The problem is: the progressbar never appears. How do I mark the function as "long running"?

      Workaround: the progressbar appears if I uncomment the sleep. The sleep may be as short as possible to make the progressbar work.