prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Progressbar crash on start
  ## Expected Behavior
  <!--- If you're describing a bug, tell us what you expect to happen. -->
  Progress bar to load
  <!--- If you're requesting a new feature, tell us why you'd like this feature. -->
  
  
  ## Current Behavior
  <!--- If you're describing a bug, what currently happens? -->
  ```
  python -m progressbar
  Unhandled Exception: Python.Runtime.PythonException: TypeError : 'NoneType' value cannot be converted to System.Int32
     at Python.Runtime.Dispatcher.Dispatch(ArrayList args)
     at __System_Threading_ThreadStartDispatcher.Invoke()
     at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.ThreadHelper.ThreadStart()
  ```
  ## Steps to reproduce
  <!--- Provide a set of steps describing how to reproduce this bug. If you have a live example, provide the link below -->
  1. launch progressbar
  
  ## Your Environment
  <!--- Provide details on your current environment you found the bug in -->
  
  * Python Version (list the specific version number) 3.6.5
  
  * Operating System and Version (select from the following and list the specific version number; if your OS is not listed, list that as well)
  
    - [ ] macOS - version: 
    - [ ] Linux - distro:   - version:
    - [ * ] Windows - version: Win10 1607
    - [ ] Other - name:  - version:
  
  * Toga Target (the type of app you are trying to generate)
   
    - [ ] android
    - [ ] cocoa
    - [ ] django 
    - [ ] gtk
    - [ ] iOS
    - [ ] tvOS
    - [ ] watchOS
    - [ * ] winforms 
    - [ ] win32
    - [ ] Other (please specify)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/winforms/toga_winforms/widgets/progressbar.py`
  Content:
  ```
  1 from travertino.size import at_least
  2 
  3 from toga_winforms.libs import WinForms
  4 
  5 from .base import Widget
  6 
  7 
  8 class ProgressBar(Widget):
  9     def create(self):
  10         self.native = WinForms.ProgressBar()
  11 
  12     def start(self):
  13         '''Not supported for WinForms implementation'''
  14         self.interface.factory.not_implemented('ProgressBar.start()')
  15 
  16         # possible implementation (not tested):
  17         # self.native.Style = ProgressBarStyle.Marquee
  18 
  19     def stop(self):
  20         '''Not supported for WinForms implementation'''
  21         self.interface.factory.not_implemented('ProgressBar.stop()')
  22 
  23         # possible implementation (not tested):
  24         # self.native.Style = ProgressBarStyle.Continuous
  25 
  26     def set_max(self, value):
  27         self.native.Maximum = value
  28 
  29     def set_value(self, value):
  30         self.native.Value = value
  31 
  32     def rehint(self):
  33         # Height must be non-zero
  34         # Set a sensible min-width
  35         self.interface.intrinsic.width = at_least(self.interface.MIN_WIDTH)
  36         self.interface.intrinsic.height = self.native.PreferredSize.Height
  37
  ```
  
  Path: `examples/progressbar/progressbar/app.py`
  Content:
  ```
  1 import toga
  2 from toga.style import Pack
  3 from toga.constants import ROW, COLUMN
  4 
  5 
  6 class ProgressBarApp(toga.App):
  7 
  8     def startup(self):
  9         # Main window of the application with title and size
  10         self.main_window = toga.MainWindow(title=self.name, size=(500, 500))
  11 
  12         # the user may change the value with +/- buttons
  13         self.progress_adder = toga.ProgressBar()
  14 
  15         # the user may switch between "running" mode and a set value
  16         self.progress_runner = toga.ProgressBar(max=None)
  17 
  18         # set up common styles
  19         label_style = Pack(flex=1, padding_right=24)
  20         row_box_style = Pack(direction=ROW, padding=24)
  21         col_box_style = Pack(direction=COLUMN, padding=24)
  22 
  23         # Add the content on the main window
  24         self.main_window.content = toga.Box(style=col_box_style, children=[
  25             toga.Box(style=col_box_style, children=[
  26                 toga.Label("Use the +/- buttons to change the progress",
  27                            style=label_style),
  28 
  29                 self.progress_adder,
  30 
  31                 toga.Box(children=[
  32                     toga.Button("+", on_press=self.increase_progress,
  33                                 style=Pack(flex=1)),
  34                     toga.Button("-", on_press=self.decrease_progress,
  35                                 style=Pack(flex=1)),
  36                 ]),
  37 
  38                 toga.Switch("Toggle running mode", on_toggle=self.toggle_running)
  39             ]),
  40 
  41             toga.Box(style=row_box_style, children=[
  42                 toga.Label("default ProgressBar", style=label_style),
  43                 toga.ProgressBar(),
  44             ]),
  45 
  46             toga.Box(style=row_box_style, children=[
  47                 toga.Label("disabled ProgressBar", style=label_style),
  48                 toga.ProgressBar(max=None,  running=False),
  49             ]),
  50 
  51             toga.Box(style=row_box_style, children=[
  52                 toga.Label("indeterminate ProgressBar", style=label_style),
  53                 toga.ProgressBar(max=None,  running=True),
  54             ]),
  55 
  56             toga.Box(style=row_box_style, children=[
  57                 toga.Label("determinate ProgressBar", style=label_style),
  58                 toga.ProgressBar(max=1, running=False, value=0.5),
  59             ]),
  60 
  61             toga.Box(style=row_box_style, children=[
  62                 toga.Label("running determinate ProgressBar", style=label_style),
  63                 toga.ProgressBar(max=1, running=True, value=0.5),
  64             ]),
  65         ])
  66 
  67         self.main_window.show()
  68 
  69     def increase_progress(self, button, **kw):
  70         if not self.progress_adder.is_running:
  71             self.progress_adder.value += 0.1 * self.progress_adder.max
  72 
  73     def decrease_progress(self, button, **kw):
  74         if not self.progress_adder.is_running:
  75             self.progress_adder.value -= 0.1 * self.progress_adder.max
  76 
  77     def toggle_running(self, switch, **kw):
  78         if switch.is_on:
  79             self.progress_adder.max = None
  80             self.progress_adder.start()
  81         else:
  82             self.progress_adder.max = 1
  83             self.progress_adder.stop()
  84 
  85 
  86 def main():
  87     # App name and namespace
  88     return ProgressBarApp('ProgressBar', 'org.beeware.examples.progressbar')
  89
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/progressbar/progressbar/app.py b/examples/progressbar/progressbar/app.py
  --- a/examples/progressbar/progressbar/app.py
  +++ b/examples/progressbar/progressbar/app.py
  @@ -2,6 +2,8 @@
   from toga.style import Pack
   from toga.constants import ROW, COLUMN
   
  +MAX_PROGRESSBAR_VALUE = 100
  +
   
   class ProgressBarApp(toga.App):
   
  @@ -10,10 +12,7 @@
           self.main_window = toga.MainWindow(title=self.name, size=(500, 500))
   
           # the user may change the value with +/- buttons
  -        self.progress_adder = toga.ProgressBar()
  -
  -        # the user may switch between "running" mode and a set value
  -        self.progress_runner = toga.ProgressBar(max=None)
  +        self.progress_adder = toga.ProgressBar(max=MAX_PROGRESSBAR_VALUE)
   
           # set up common styles
           label_style = Pack(flex=1, padding_right=24)
  @@ -55,12 +54,18 @@
   
               toga.Box(style=row_box_style, children=[
                   toga.Label("determinate ProgressBar", style=label_style),
  -                toga.ProgressBar(max=1, running=False, value=0.5),
  +                toga.ProgressBar(
  +                    max=MAX_PROGRESSBAR_VALUE,
  +                    running=False,
  +                    value=0.5 * MAX_PROGRESSBAR_VALUE),
               ]),
   
               toga.Box(style=row_box_style, children=[
                   toga.Label("running determinate ProgressBar", style=label_style),
  -                toga.ProgressBar(max=1, running=True, value=0.5),
  +                toga.ProgressBar(
  +                    max=MAX_PROGRESSBAR_VALUE,
  +                    running=True,
  +                    value=0.5 * MAX_PROGRESSBAR_VALUE),
               ]),
           ])
   
  @@ -79,7 +84,7 @@
               self.progress_adder.max = None
               self.progress_adder.start()
           else:
  -            self.progress_adder.max = 1
  +            self.progress_adder.max = MAX_PROGRESSBAR_VALUE
               self.progress_adder.stop()
   
   
  diff --git a/src/winforms/toga_winforms/widgets/progressbar.py b/src/winforms/toga_winforms/widgets/progressbar.py
  --- a/src/winforms/toga_winforms/widgets/progressbar.py
  +++ b/src/winforms/toga_winforms/widgets/progressbar.py
  @@ -10,21 +10,31 @@
           self.native = WinForms.ProgressBar()
   
       def start(self):
  -        '''Not supported for WinForms implementation'''
  -        self.interface.factory.not_implemented('ProgressBar.start()')
  -
  -        # possible implementation (not tested):
  -        # self.native.Style = ProgressBarStyle.Marquee
  +        self.set_running_style()
   
       def stop(self):
  -        '''Not supported for WinForms implementation'''
  -        self.interface.factory.not_implemented('ProgressBar.stop()')
  +        self.set_stopping_style()
   
  -        # possible implementation (not tested):
  -        # self.native.Style = ProgressBarStyle.Continuous
  +    @property
  +    def max(self):
  +        return self.interface.max
   
       def set_max(self, value):
  -        self.native.Maximum = value
  +        if value is not None:
  +            self.native.Maximum = value
  +        if self.interface.is_running:
  +            self.set_running_style()
  +        else:
  +            self.set_stopping_style()
  +
  +    def set_running_style(self):
  +        if self.max is None:
  +            self.native.Style = WinForms.ProgressBarStyle.Marquee
  +        else:
  +            self.native.Style = WinForms.ProgressBarStyle.Blocks
  +
  +    def set_stopping_style(self):
  +        self.native.Style = WinForms.ProgressBarStyle.Continuous
   
       def set_value(self, value):
           self.native.Value = value
  
verification_info: {"golden_diff": "diff --git a/examples/progressbar/progressbar/app.py b/examples/progressbar/progressbar/app.py\n--- a/examples/progressbar/progressbar/app.py\n+++ b/examples/progressbar/progressbar/app.py\n@@ -2,6 +2,8 @@\n from toga.style import Pack\n from toga.constants import ROW, COLUMN\n \n+MAX_PROGRESSBAR_VALUE = 100\n+\n \n class ProgressBarApp(toga.App):\n \n@@ -10,10 +12,7 @@\n         self.main_window = toga.MainWindow(title=self.name, size=(500, 500))\n \n         # the user may change the value with +/- buttons\n-        self.progress_adder = toga.ProgressBar()\n-\n-        # the user may switch between \"running\" mode and a set value\n-        self.progress_runner = toga.ProgressBar(max=None)\n+        self.progress_adder = toga.ProgressBar(max=MAX_PROGRESSBAR_VALUE)\n \n         # set up common styles\n         label_style = Pack(flex=1, padding_right=24)\n@@ -55,12 +54,18 @@\n \n             toga.Box(style=row_box_style, children=[\n                 toga.Label(\"determinate ProgressBar\", style=label_style),\n-                toga.ProgressBar(max=1, running=False, value=0.5),\n+                toga.ProgressBar(\n+                    max=MAX_PROGRESSBAR_VALUE,\n+                    running=False,\n+                    value=0.5 * MAX_PROGRESSBAR_VALUE),\n             ]),\n \n             toga.Box(style=row_box_style, children=[\n                 toga.Label(\"running determinate ProgressBar\", style=label_style),\n-                toga.ProgressBar(max=1, running=True, value=0.5),\n+                toga.ProgressBar(\n+                    max=MAX_PROGRESSBAR_VALUE,\n+                    running=True,\n+                    value=0.5 * MAX_PROGRESSBAR_VALUE),\n             ]),\n         ])\n \n@@ -79,7 +84,7 @@\n             self.progress_adder.max = None\n             self.progress_adder.start()\n         else:\n-            self.progress_adder.max = 1\n+            self.progress_adder.max = MAX_PROGRESSBAR_VALUE\n             self.progress_adder.stop()\n \n \ndiff --git a/src/winforms/toga_winforms/widgets/progressbar.py b/src/winforms/toga_winforms/widgets/progressbar.py\n--- a/src/winforms/toga_winforms/widgets/progressbar.py\n+++ b/src/winforms/toga_winforms/widgets/progressbar.py\n@@ -10,21 +10,31 @@\n         self.native = WinForms.ProgressBar()\n \n     def start(self):\n-        '''Not supported for WinForms implementation'''\n-        self.interface.factory.not_implemented('ProgressBar.start()')\n-\n-        # possible implementation (not tested):\n-        # self.native.Style = ProgressBarStyle.Marquee\n+        self.set_running_style()\n \n     def stop(self):\n-        '''Not supported for WinForms implementation'''\n-        self.interface.factory.not_implemented('ProgressBar.stop()')\n+        self.set_stopping_style()\n \n-        # possible implementation (not tested):\n-        # self.native.Style = ProgressBarStyle.Continuous\n+    @property\n+    def max(self):\n+        return self.interface.max\n \n     def set_max(self, value):\n-        self.native.Maximum = value\n+        if value is not None:\n+            self.native.Maximum = value\n+        if self.interface.is_running:\n+            self.set_running_style()\n+        else:\n+            self.set_stopping_style()\n+\n+    def set_running_style(self):\n+        if self.max is None:\n+            self.native.Style = WinForms.ProgressBarStyle.Marquee\n+        else:\n+            self.native.Style = WinForms.ProgressBarStyle.Blocks\n+\n+    def set_stopping_style(self):\n+        self.native.Style = WinForms.ProgressBarStyle.Continuous\n \n     def set_value(self, value):\n         self.native.Value = value\n", "issue": "Progressbar crash on start\n## Expected Behavior\r\n<!--- If you're describing a bug, tell us what you expect to happen. -->\r\nProgress bar to load\r\n<!--- If you're requesting a new feature, tell us why you'd like this feature. -->\r\n\r\n\r\n## Current Behavior\r\n<!--- If you're describing a bug, what currently happens? -->\r\n```\r\npython -m progressbar\r\nUnhandled Exception: Python.Runtime.PythonException: TypeError : 'NoneType' value cannot be converted to System.Int32\r\n   at Python.Runtime.Dispatcher.Dispatch(ArrayList args)\r\n   at __System_Threading_ThreadStartDispatcher.Invoke()\r\n   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()\r\n```\r\n## Steps to reproduce\r\n<!--- Provide a set of steps describing how to reproduce this bug. If you have a live example, provide the link below -->\r\n1. launch progressbar\r\n\r\n## Your Environment\r\n<!--- Provide details on your current environment you found the bug in -->\r\n\r\n* Python Version (list the specific version number) 3.6.5\r\n\r\n* Operating System and Version (select from the following and list the specific version number; if your OS is not listed, list that as well)\r\n\r\n  - [ ] macOS - version: \r\n  - [ ] Linux - distro:   - version:\r\n  - [ * ] Windows - version: Win10 1607\r\n  - [ ] Other - name:  - version:\r\n\r\n* Toga Target (the type of app you are trying to generate)\r\n \r\n  - [ ] android\r\n  - [ ] cocoa\r\n  - [ ] django \r\n  - [ ] gtk\r\n  - [ ] iOS\r\n  - [ ] tvOS\r\n  - [ ] watchOS\r\n  - [ * ] winforms \r\n  - [ ] win32\r\n  - [ ] Other (please specify)\r\n\n", "before_files": [{"content": "from travertino.size import at_least\n\nfrom toga_winforms.libs import WinForms\n\nfrom .base import Widget\n\n\nclass ProgressBar(Widget):\n    def create(self):\n        self.native = WinForms.ProgressBar()\n\n    def start(self):\n        '''Not supported for WinForms implementation'''\n        self.interface.factory.not_implemented('ProgressBar.start()')\n\n        # possible implementation (not tested):\n        # self.native.Style = ProgressBarStyle.Marquee\n\n    def stop(self):\n        '''Not supported for WinForms implementation'''\n        self.interface.factory.not_implemented('ProgressBar.stop()')\n\n        # possible implementation (not tested):\n        # self.native.Style = ProgressBarStyle.Continuous\n\n    def set_max(self, value):\n        self.native.Maximum = value\n\n    def set_value(self, value):\n        self.native.Value = value\n\n    def rehint(self):\n        # Height must be non-zero\n        # Set a sensible min-width\n        self.interface.intrinsic.width = at_least(self.interface.MIN_WIDTH)\n        self.interface.intrinsic.height = self.native.PreferredSize.Height\n", "path": "src/winforms/toga_winforms/widgets/progressbar.py"}, {"content": "import toga\nfrom toga.style import Pack\nfrom toga.constants import ROW, COLUMN\n\n\nclass ProgressBarApp(toga.App):\n\n    def startup(self):\n        # Main window of the application with title and size\n        self.main_window = toga.MainWindow(title=self.name, size=(500, 500))\n\n        # the user may change the value with +/- buttons\n        self.progress_adder = toga.ProgressBar()\n\n        # the user may switch between \"running\" mode and a set value\n        self.progress_runner = toga.ProgressBar(max=None)\n\n        # set up common styles\n        label_style = Pack(flex=1, padding_right=24)\n        row_box_style = Pack(direction=ROW, padding=24)\n        col_box_style = Pack(direction=COLUMN, padding=24)\n\n        # Add the content on the main window\n        self.main_window.content = toga.Box(style=col_box_style, children=[\n            toga.Box(style=col_box_style, children=[\n                toga.Label(\"Use the +/- buttons to change the progress\",\n                           style=label_style),\n\n                self.progress_adder,\n\n                toga.Box(children=[\n                    toga.Button(\"+\", on_press=self.increase_progress,\n                                style=Pack(flex=1)),\n                    toga.Button(\"-\", on_press=self.decrease_progress,\n                                style=Pack(flex=1)),\n                ]),\n\n                toga.Switch(\"Toggle running mode\", on_toggle=self.toggle_running)\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"default ProgressBar\", style=label_style),\n                toga.ProgressBar(),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"disabled ProgressBar\", style=label_style),\n                toga.ProgressBar(max=None,  running=False),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"indeterminate ProgressBar\", style=label_style),\n                toga.ProgressBar(max=None,  running=True),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"determinate ProgressBar\", style=label_style),\n                toga.ProgressBar(max=1, running=False, value=0.5),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"running determinate ProgressBar\", style=label_style),\n                toga.ProgressBar(max=1, running=True, value=0.5),\n            ]),\n        ])\n\n        self.main_window.show()\n\n    def increase_progress(self, button, **kw):\n        if not self.progress_adder.is_running:\n            self.progress_adder.value += 0.1 * self.progress_adder.max\n\n    def decrease_progress(self, button, **kw):\n        if not self.progress_adder.is_running:\n            self.progress_adder.value -= 0.1 * self.progress_adder.max\n\n    def toggle_running(self, switch, **kw):\n        if switch.is_on:\n            self.progress_adder.max = None\n            self.progress_adder.start()\n        else:\n            self.progress_adder.max = 1\n            self.progress_adder.stop()\n\n\ndef main():\n    # App name and namespace\n    return ProgressBarApp('ProgressBar', 'org.beeware.examples.progressbar')\n", "path": "examples/progressbar/progressbar/app.py"}], "after_files": [{"content": "from travertino.size import at_least\n\nfrom toga_winforms.libs import WinForms\n\nfrom .base import Widget\n\n\nclass ProgressBar(Widget):\n    def create(self):\n        self.native = WinForms.ProgressBar()\n\n    def start(self):\n        self.set_running_style()\n\n    def stop(self):\n        self.set_stopping_style()\n\n    @property\n    def max(self):\n        return self.interface.max\n\n    def set_max(self, value):\n        if value is not None:\n            self.native.Maximum = value\n        if self.interface.is_running:\n            self.set_running_style()\n        else:\n            self.set_stopping_style()\n\n    def set_running_style(self):\n        if self.max is None:\n            self.native.Style = WinForms.ProgressBarStyle.Marquee\n        else:\n            self.native.Style = WinForms.ProgressBarStyle.Blocks\n\n    def set_stopping_style(self):\n        self.native.Style = WinForms.ProgressBarStyle.Continuous\n\n    def set_value(self, value):\n        self.native.Value = value\n\n    def rehint(self):\n        # Height must be non-zero\n        # Set a sensible min-width\n        self.interface.intrinsic.width = at_least(self.interface.MIN_WIDTH)\n        self.interface.intrinsic.height = self.native.PreferredSize.Height\n", "path": "src/winforms/toga_winforms/widgets/progressbar.py"}, {"content": "import toga\nfrom toga.style import Pack\nfrom toga.constants import ROW, COLUMN\n\nMAX_PROGRESSBAR_VALUE = 100\n\n\nclass ProgressBarApp(toga.App):\n\n    def startup(self):\n        # Main window of the application with title and size\n        self.main_window = toga.MainWindow(title=self.name, size=(500, 500))\n\n        # the user may change the value with +/- buttons\n        self.progress_adder = toga.ProgressBar(max=MAX_PROGRESSBAR_VALUE)\n\n        # set up common styles\n        label_style = Pack(flex=1, padding_right=24)\n        row_box_style = Pack(direction=ROW, padding=24)\n        col_box_style = Pack(direction=COLUMN, padding=24)\n\n        # Add the content on the main window\n        self.main_window.content = toga.Box(style=col_box_style, children=[\n            toga.Box(style=col_box_style, children=[\n                toga.Label(\"Use the +/- buttons to change the progress\",\n                           style=label_style),\n\n                self.progress_adder,\n\n                toga.Box(children=[\n                    toga.Button(\"+\", on_press=self.increase_progress,\n                                style=Pack(flex=1)),\n                    toga.Button(\"-\", on_press=self.decrease_progress,\n                                style=Pack(flex=1)),\n                ]),\n\n                toga.Switch(\"Toggle running mode\", on_toggle=self.toggle_running)\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"default ProgressBar\", style=label_style),\n                toga.ProgressBar(),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"disabled ProgressBar\", style=label_style),\n                toga.ProgressBar(max=None,  running=False),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"indeterminate ProgressBar\", style=label_style),\n                toga.ProgressBar(max=None,  running=True),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"determinate ProgressBar\", style=label_style),\n                toga.ProgressBar(\n                    max=MAX_PROGRESSBAR_VALUE,\n                    running=False,\n                    value=0.5 * MAX_PROGRESSBAR_VALUE),\n            ]),\n\n            toga.Box(style=row_box_style, children=[\n                toga.Label(\"running determinate ProgressBar\", style=label_style),\n                toga.ProgressBar(\n                    max=MAX_PROGRESSBAR_VALUE,\n                    running=True,\n                    value=0.5 * MAX_PROGRESSBAR_VALUE),\n            ]),\n        ])\n\n        self.main_window.show()\n\n    def increase_progress(self, button, **kw):\n        if not self.progress_adder.is_running:\n            self.progress_adder.value += 0.1 * self.progress_adder.max\n\n    def decrease_progress(self, button, **kw):\n        if not self.progress_adder.is_running:\n            self.progress_adder.value -= 0.1 * self.progress_adder.max\n\n    def toggle_running(self, switch, **kw):\n        if switch.is_on:\n            self.progress_adder.max = None\n            self.progress_adder.start()\n        else:\n            self.progress_adder.max = MAX_PROGRESSBAR_VALUE\n            self.progress_adder.stop()\n\n\ndef main():\n    # App name and namespace\n    return ProgressBarApp('ProgressBar', 'org.beeware.examples.progressbar')\n", "path": "examples/progressbar/progressbar/app.py"}]}