Skip to main content

CTkProgressBar

Example Code​

progressbar = customtkinter.CTkProgressBar(app, orientation="horizontal")
CTkProgressBar example on macOS in dark mode

Arguments​

argumentvalue
masterroot, tkinter.Frame or CTkFrame
widthslider width in px
heightslider height in px
border_widthborder width in px
corner_radiuscorner_radius in px
bg_colorcolor behind the widget, only visible at the rounded corners, "transparent" (default) takes the color of the parent widget, tuple: (light_color, dark_color) or single color
fg_colorforeground color, tuple: (light_color, dark_color) or single color
border_colorslider border color, tuple: (light_color, dark_color) or single color
progress_colorprogress color, tuple: (light_color, dark_color) or single color
variabletkinter.DoubleVar or tkinter.IntVar to control or read the progress value between 0 and 1
orientation"horizontal" (default) or "vertical"
mode"determinate" for linear progress (default), "indeterminate" for unknown progress
determinate_speedspeed for automatic progress in determinate mode started by .start(), default is 1
indeterminate_speedspeed for automatic progress in indeterminate mode started by .start(), default is 1

Arguments and methods that all widgets share, like bg_color, .bind(), .focus() or .destroy(), are described on Common arguments and methods.

Methods​

  • .configure(attribute=value, ...)​

    All attributes can be configured and updated, for example:

    progressbar.configure(mode="indeterminate")
  • .cget(attribute_name)​

    Pass attribute name as string and get current value of attribute, for example.

    mode = progressbar.cget("mode")
  • .set(value)​

    Set progress bar to specific value (range 0 to 1).

  • .get()​

    Get current value of progress bar.

    value = ctk_progressbar.get()
  • .start()​

    Start automatic progress. Speed is set by indeterminate_speed and determinate_speed attributes, default is 1. If mode is set to "indeterminate", the progress bar will oscillate, otherwise it will fill up and then repeat.

  • .stop()​

    Stop automatic progress.

  • .step()​

    Do single step manually otherwise done by .start() and .stop() automatic loop. Step size is set by determinate_speed and indeterminate_speed attributes.