Giter VIP home page Giter VIP logo

betterprogressmessage's Introduction

Better Progress Message

An improved API for setting ENVI progress messages build on what is provided in ENVI. Simply wraps the existing objects that are used to create progress dialogs in ENVI.

Requirements

ENVI 5.4 or later. Should work on ENVI 5.3 as well (untested).

Usage

Once you have added the object to IDL's search path, you can simply use the folowing example for how to initialize, update progress, and check to see if a user has pressed the cancel button:

;start ENVI
e = envi()

;initialize the progress message 
prog = betterENVIProgress('Progress title')

;set our first progress update
prog.SetProgress, 'Processing...', 50

;check to see if a user has tried to cancel processing
print, prog.AbortRequested()

;clean up properly
prog.finish

Notes on Proper Usage

When using progress messages in ENVI, you need to make sure that you are properly handling errors so that the progress messages are closed correctly. Otherwise they can be left in a bad state and new ones will no longer pop up. To do this, simply use a catch statement after you intialize the progress message:

;start ENVI
e = envi()

;initialize the progress message 
prog = betterENVIProgress('Progress title')

;properly hadle errors
catch, err
if (err ne 0) then begin
    catch, /CANCEL
    prog.finsh
    message, /REISSUE_LAST
endif

;set our first progress update
prog.SetProgress, 'Processing...', 50

;check to see if a user has tried to cancel processing
print, prog.AbortRequested()

;clean up properly
prog.finish

Licensing

Licensed under MIT. Full details in LICENSE.txt.

betterprogressmessage's People

Contributors

currenttv avatar znorman-harris avatar

Forkers

hanzongtao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.