10.7.3. Class cerebro.gui.ProgressBox

class cerebro.gui.ProgressBox(title, min=0, max=100)[source]
Parameters:
  • title (string) – progress window title.
  • min (int) – progress minimal value.
  • max (int) – progress maximal value.

Progress window class.

Methods

_images/capi_gui_progress.png
prgbar = cerebro.gui.ProgressBox('Progress Window', 0, 100)
prgbar.set_label('Progress...')
prgbar.show()
for i in range(0,100):                  
        if prgbar.was_canceled() == True: # checking if the operation hasn't been canceled by user
                break
                
        prgbar.set_value(i)                     
        
prgbar.close()  
close()[source]

Closes a progress window.

See also

show().

hide_cancel_button()[source]

Hides “Cancel” button.

Use this method if you want to prevent users from canceling the operation. If you leave the option to cancel available, you should use the was_canceled() method in order to know if the “Cancel” button was pressed or not.

label()[source]
Returns:text label.
Return type:string

See also

set_label().

max()[source]
Returns:maximal progress value.
Return type:int

See also

set_range().

min()[source]
Returns:minimal progress value.
Return type:int

See also

set_range().

reset()[source]

Resets progress value the minimum.

set_label(label)[source]
Parameters:label (string) – text label.

Sets a text label.

See also

label().

set_range(min, max)[source]
Parameters:
  • min (int) – minimal progress value.
  • max (int) – maximal progress value.

Sets minimal and maximal progress values.

See also

max(), min().

set_title(title)[source]
Parameters:title (string) – window title.

Sets a progress window title.

See also

title().

set_value(value)[source]
Parameters:value (int) – progress value.

Sets progress value.

See also

value().

show()[source]

Displays a progress window.

See also

close().

title()[source]
Returns:progress window title.
Return type:string

See also

set_title().

value()[source]
Returns:progress value.
Return type:int

See also

set_value().

was_canceled()[source]
Returns:True, if the user pressed the “Cancel” button.
Return type:bool