# coyote: CGPROGRESSBAR__DEFINE

- coyote/Graphics
- [Source code]

Description

      This program is used to draw a progress bar on the display.
      .. image:: cgprogressbar.png
      The program requires the `Coyote Library <http://www.idlcoyote.com/documents/programs.php>`
      to be installed on your machine.

Categories

      Graphics

Examples

      To display a progress bar in a program with a FOR loop::
            cgProgressBar = Obj_New("CGPROGRESSBAR", /Cancel)
            cgProgressBar -> Start
            FOR j=0,9 DO BEGIN
               IF cgProgressBar -> CheckCancel() THEN BEGIN
                  ok = Dialog_Message('The user cancelled operation.')
                  RETURN
               ENDIF
               Wait, 0.5  ; Would probably be doing something ELSE here!
               cgProgressBar -> Update, (j+1)*10
            ENDFOR
            cgProgressBar -> Destroy
      An additional example can be found my compiling the program and typing
      this command::
         IDL> ProgressBar_Example

Author

      FANNING SOFTWARE CONSULTING::
         David W. Fanning
         1645 Sheely Drive
         Fort Collins, CO 80526 USA
         Phone: 970-221-0438
         E-mail: david@idlcoyote.com
         Coyote's Guide to IDL Programming: http://www.idlcoyote.com

History

      Change History::
         Written by:  David W. Fanning, 27 September 2012. Inspired by Ronn Kling's program krProgressBar.

Copyright

      Copyright (c) 2012, Fanning Software Consulting, Inc.
      ks the cancel button to see if it has been selected.

Returns

      Returns a 1 if the user clicked the Cancel button and a 0 otherwise.
       initialization routine for the cgPROGRESSBAR object class.

Keywords

      message: in, optional, type=string
         If the RESPOND keyword is set, this is the message set in the blocking
         dialog widget. By default: "Current Operation Cancelled by User".
      respond: in, optional, type=boolean, default=0
         If this keyword is set, the program responds to a positive cancel flag
         by destroying the progress bar and setting a blocking dialog widget
         for the user. The keyword is ignored if the cancel flag is zero.
      ate the object image for the program. Taken from Ronn Kling's
      ally cool" background image in krProgressBar.
      troys the progress bar.
      ates the progress bar.

Params

      class: out, optional, type=structure
         The object class definition as a structure. Occasionally useful.