class Iup::ProgressDialog
A predefined dialog to show the progress of an operation. It is often used alongside a Iup::Timer, which triggers updates at regular intervals.
Example
dlg = Iup::ProgressDialog.new do |d| d.title = "Progress on task ..." d.description = "... taking a long time" d.totalcount = 100 d.count = 30 d.cancel_cb = ->{ puts "Task cancelled" Iup::CLOSE } end dlg.show
The dialog is meant to be shown using show.
Attributes
n, number of iterations completed so far.
The text to show within the dialog, describing operation.
n, increases progress by n.
n, current percent of iterations.
current state of the iteration, values ‘idle’ / ‘processing’ / ‘undefined’ / ‘aborted’.
n, total number of iterations to complete.
Public Class Methods
Source
# File lib/wrapped/progressdialog.rb, line 27 def initialize @handle = IupLib.IupProgressDlg # run any provided block on instance, to set up further attributes yield self if block_given? end
Creates an instance of the dialog. If a block is given, the new instance is yielded to it.
Callbacks
Attributes
Callback called when the user clicked on the Cancel button. Callback must respond to call and take no arguments. Returns different to Iup::CONTINUE will set state to ‘aborted’.