We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ProgressBar doesn't appears in a Box [Core] [Cocoa]
Example code: https://gist.github.com/Dayof/528f9dc38f4178dbc25db6bab553e19a

When a progress bar is add inside of a box (bellow the label is the progress bar):

![captura de tela 2017-07-04 as 19 43 31](https://user-images.githubusercontent.com/8198348/27844002-b0c949e2-60f1-11e7-853c-ba0630bc481f.png)


--- 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/cocoa/toga_cocoa/widgets/progressbar.py`
Content:
```
1 from toga.interface import ProgressBar as ProgressBarInterface
2 
3 from ..libs import *
4 from .base import WidgetMixin
5 
6 
7 class ProgressBar(ProgressBarInterface, WidgetMixin):
8     def __init__(self, id=None, style=None, max=None, value=None):
9         super().__init__(id=id, style=style, max=max, value=value)
10         self._create()
11 
12     def create(self):
13         self._impl = NSProgressIndicator.new()
14         self._impl.setStyle_(NSProgressIndicatorBarStyle)
15         self._impl.setDisplayedWhenStopped_(True)
16 
17         # Add the layout constraints
18         self._add_constraints()
19 
20     def _set_value(self, value):
21         if value is not None:
22             self._impl.setDoubleValue_(value)
23 
24     def start(self):
25         if self._impl and not self._running:
26             self._impl.startAnimation_(self._impl)
27             self._running = True
28 
29     def stop(self):
30         if self._impl and self._running:
31             self._impl.stopAnimation_(self._impl)
32             self._running = False
33 
34     def _set_max(self, value):
35         if value:
36             self._impl.setIndeterminate_(False)
37             self._impl.setMaxValue_(value)
38         else:
39             self._impl.setIndeterminate_(True)
40
```
--- 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()

```

diff --git a/src/cocoa/toga_cocoa/widgets/progressbar.py b/src/cocoa/toga_cocoa/widgets/progressbar.py
--- a/src/cocoa/toga_cocoa/widgets/progressbar.py
+++ b/src/cocoa/toga_cocoa/widgets/progressbar.py
@@ -16,6 +16,7 @@
 
         # Add the layout constraints
         self._add_constraints()
+        self.rehint()
 
     def _set_value(self, value):
         if value is not None:
@@ -37,3 +38,9 @@
             self._impl.setMaxValue_(value)
         else:
             self._impl.setIndeterminate_(True)
+
+    def rehint(self):
+        self.style.hint(
+            height=self._impl.fittingSize().height,
+            width=self._impl.fittingSize().width
+        )

{"golden_diff": "diff --git a/src/cocoa/toga_cocoa/widgets/progressbar.py b/src/cocoa/toga_cocoa/widgets/progressbar.py\n--- a/src/cocoa/toga_cocoa/widgets/progressbar.py\n+++ b/src/cocoa/toga_cocoa/widgets/progressbar.py\n@@ -16,6 +16,7 @@\n \n         # Add the layout constraints\n         self._add_constraints()\n+        self.rehint()\n \n     def _set_value(self, value):\n         if value is not None:\n@@ -37,3 +38,9 @@\n             self._impl.setMaxValue_(value)\n         else:\n             self._impl.setIndeterminate_(True)\n+\n+    def rehint(self):\n+        self.style.hint(\n+            height=self._impl.fittingSize().height,\n+            width=self._impl.fittingSize().width\n+        )\n", "issue": "ProgressBar doesn't appears in a Box [Core] [Cocoa]\nExample code: https://gist.github.com/Dayof/528f9dc38f4178dbc25db6bab553e19a\r\n\r\nWhen a progress bar is add inside of a box (bellow the label is the progress bar):\r\n\r\n![captura de tela 2017-07-04 as 19 43 31](https://user-images.githubusercontent.com/8198348/27844002-b0c949e2-60f1-11e7-853c-ba0630bc481f.png)\r\n\n", "before_files": [{"content": "from toga.interface import ProgressBar as ProgressBarInterface\n\nfrom ..libs import *\nfrom .base import WidgetMixin\n\n\nclass ProgressBar(ProgressBarInterface, WidgetMixin):\n    def __init__(self, id=None, style=None, max=None, value=None):\n        super().__init__(id=id, style=style, max=max, value=value)\n        self._create()\n\n    def create(self):\n        self._impl = NSProgressIndicator.new()\n        self._impl.setStyle_(NSProgressIndicatorBarStyle)\n        self._impl.setDisplayedWhenStopped_(True)\n\n        # Add the layout constraints\n        self._add_constraints()\n\n    def _set_value(self, value):\n        if value is not None:\n            self._impl.setDoubleValue_(value)\n\n    def start(self):\n        if self._impl and not self._running:\n            self._impl.startAnimation_(self._impl)\n            self._running = True\n\n    def stop(self):\n        if self._impl and self._running:\n            self._impl.stopAnimation_(self._impl)\n            self._running = False\n\n    def _set_max(self, value):\n        if value:\n            self._impl.setIndeterminate_(False)\n            self._impl.setMaxValue_(value)\n        else:\n            self._impl.setIndeterminate_(True)\n", "path": "src/cocoa/toga_cocoa/widgets/progressbar.py"}], "after_files": [{"content": "from toga.interface import ProgressBar as ProgressBarInterface\n\nfrom ..libs import *\nfrom .base import WidgetMixin\n\n\nclass ProgressBar(ProgressBarInterface, WidgetMixin):\n    def __init__(self, id=None, style=None, max=None, value=None):\n        super().__init__(id=id, style=style, max=max, value=value)\n        self._create()\n\n    def create(self):\n        self._impl = NSProgressIndicator.new()\n        self._impl.setStyle_(NSProgressIndicatorBarStyle)\n        self._impl.setDisplayedWhenStopped_(True)\n\n        # Add the layout constraints\n        self._add_constraints()\n        self.rehint()\n\n    def _set_value(self, value):\n        if value is not None:\n            self._impl.setDoubleValue_(value)\n\n    def start(self):\n        if self._impl and not self._running:\n            self._impl.startAnimation_(self._impl)\n            self._running = True\n\n    def stop(self):\n        if self._impl and self._running:\n            self._impl.stopAnimation_(self._impl)\n            self._running = False\n\n    def _set_max(self, value):\n        if value:\n            self._impl.setIndeterminate_(False)\n            self._impl.setMaxValue_(value)\n        else:\n            self._impl.setIndeterminate_(True)\n\n    def rehint(self):\n        self.style.hint(\n            height=self._impl.fittingSize().height,\n            width=self._impl.fittingSize().width\n        )\n", "path": "src/cocoa/toga_cocoa/widgets/progressbar.py"}]}