Sublime Forum

Show Progress Bar in View

#1

Hello,

Sometimes when loading a large file a progress bar is shown in the view. Is it possible to show that same progress bar during a threaded operation? I don’t see anything about it in the API.

Thanks,
Dave

0 Likes

#2

Hi Dave,

That progress bar is sublime loading the file and then applying any syntax highlighting that might be associated with the file type. There is no API that will do something similar, but some developers create an “in progress” status message that will animate to show something is happening.

Take a look at package control when you select install plugin. You should see something like “= ]” appear in. The status bar and the equal sign will be animating when it is parsing the channel file. I think this has become the unofficial standard for what you’re trying to do. You might be able to take it a step further and show true progress, but I’ve always just done what package control has in place.

Hope that helps!

Nick

0 Likes

#3

If you look at my post on using generators to interface with Sublime Text’s API, then you’ll see an example of a throbber - a non-specific action indicator. I’ve updated the gist linked to on that page to include a function which utilizes Sublime Text’s status_message function to repeatedly set an externally updatable, static, message. If you’re wondering why I took out the view parameters, those can be set view a view object’s set_status method, and they don’t go away until explicitly unset (negating the need for a function which repeatedly sets it).

0 Likes