prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Table rows not rendering correctly in `update_data` winforms
  ## Expected Behavior
  View text in the rows
  
  ## Current Behavior
  Rows are created but text is not displayed.
  ![image](https://user-images.githubusercontent.com/479689/78953344-20995d80-7b0b-11ea-80da-889b488372be.png)
  When I insert a new row (with insert button) is working ok:
  ![image](https://user-images.githubusercontent.com/479689/78953506-a3221d00-7b0b-11ea-8ec5-b1429da77e54.png)
  
  In found that a change was made in `update_data` ( https://github.com/beeware/toga/commit/cb326e79ea1884f9e71fadfb1d7daf0688e78753) and `update_data` use a different ListViewItem creation than `insert` method which is working ok.
  
  The specific line is the change made from this one:
  ```
  item._impl = WinForms.ListViewItem([
              str(getattr(item, attr)) for attr in self.interface._accessors
          ])
  ```
  to this:
  ```
  item._impl = WinForms.ListViewItem(self.row_data(item))
  ```
  
  ## Steps to reproduce
  1. Open example and that's it
  
  ## Your Environment
  
  * Python Version (list the specific version number)
  3.7.7
  
  * 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:
    - [x] Windows - version: 10 Pro
    - [ ] Other - name:  - version:
  
  * Toga Version (list the specific version number or git hash)
  Master branch of toga.
  
  * Toga Target (the type of app you are trying to generate)
  
    - [ ] android
    - [ ] cocoa
    - [ ] django
    - [ ] gtk
    - [ ] iOS
    - [ ] tvOS
    - [ ] watchOS
    - [x] winforms
    - [ ] win32
    - [ ] Other (please specify)
  
  
  </issue>
  <code>
  [start of src/winforms/toga_winforms/widgets/table.py]
  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 Table(Widget):
  9     def create(self):
  10         self._container = self
  11         self.native = WinForms.ListView()
  12         self.native.View = WinForms.View.Details
  13 
  14         dataColumn = []
  15         for heading in self.interface.headings:
  16             col = WinForms.ColumnHeader()
  17             col.Text = heading
  18             dataColumn.append(col)
  19 
  20         self.native.FullRowSelect = True
  21         self.native.Multiselect = self.interface.multiple_select
  22         self.native.DoubleBuffered = True
  23         self.native.Columns.AddRange(dataColumn)
  24 
  25     def change_source(self, source):
  26         self.update_data()
  27 
  28     def row_data(self, item):
  29         # TODO: Winforms can't support icons in tree cells; so, if the data source
  30         # specifies an icon, strip it when converting to row data.
  31         def strip_icon(item, attr):
  32             val = getattr(item, attr)
  33             if isinstance(val, tuple):
  34                 return str(val[1])
  35             return str(val)
  36 
  37         return [item] + [
  38             strip_icon(item, attr)
  39             for attr in self.interface._accessors
  40         ]
  41 
  42     def update_data(self):
  43         self.native.BeginUpdate()
  44         self.native.Items.Clear()
  45         items = []
  46         for item in self.interface.data:
  47             item._impl = WinForms.ListViewItem(self.row_data(item))
  48             items.append(item._impl)
  49         self.native.Items.AddRange(items)
  50         self.native.EndUpdate()
  51 
  52     def insert(self, index, item):
  53         self.native.BeginUpdate()
  54         item._impl = WinForms.ListViewItem([
  55             str(getattr(item, attr)) for attr in self.interface._accessors
  56         ])
  57         self.native.Items.Insert(index, item._impl)
  58         self.native.EndUpdate()
  59 
  60     def change(self, item):
  61         self.interface.factory.not_implemented('Table.change()')
  62 
  63     def remove(self, item):
  64         self.update_data()
  65 
  66     def clear(self):
  67         self.native.Items.Clear()
  68 
  69     def set_on_select(self, handler):
  70         self.interface.factory.not_implemented('Table.set_on_select()')
  71 
  72     def scroll_to_row(self, row):
  73         self.native.EnsureVisible(row)
  74         self.interface.factory.not_implemented('Table.scroll_to_row()')
  75 
  76     def rehint(self):
  77         self.interface.intrinsic.width = at_least(self.interface.MIN_WIDTH)
  78         self.interface.intrinsic.height = at_least(self.interface.MIN_HEIGHT)
  79
  [end of src/winforms/toga_winforms/widgets/table.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/winforms/toga_winforms/widgets/table.py b/src/winforms/toga_winforms/widgets/table.py
  --- a/src/winforms/toga_winforms/widgets/table.py
  +++ b/src/winforms/toga_winforms/widgets/table.py
  @@ -34,7 +34,7 @@
                   return str(val[1])
               return str(val)
   
  -        return [item] + [
  +        return [
               strip_icon(item, attr)
               for attr in self.interface._accessors
           ]
  @@ -51,9 +51,7 @@
   
       def insert(self, index, item):
           self.native.BeginUpdate()
  -        item._impl = WinForms.ListViewItem([
  -            str(getattr(item, attr)) for attr in self.interface._accessors
  -        ])
  +        item._impl = WinForms.ListViewItem(self.row_data(item))
           self.native.Items.Insert(index, item._impl)
           self.native.EndUpdate()
  
verification_info: {"golden_diff": "diff --git a/src/winforms/toga_winforms/widgets/table.py b/src/winforms/toga_winforms/widgets/table.py\n--- a/src/winforms/toga_winforms/widgets/table.py\n+++ b/src/winforms/toga_winforms/widgets/table.py\n@@ -34,7 +34,7 @@\n                 return str(val[1])\n             return str(val)\n \n-        return [item] + [\n+        return [\n             strip_icon(item, attr)\n             for attr in self.interface._accessors\n         ]\n@@ -51,9 +51,7 @@\n \n     def insert(self, index, item):\n         self.native.BeginUpdate()\n-        item._impl = WinForms.ListViewItem([\n-            str(getattr(item, attr)) for attr in self.interface._accessors\n-        ])\n+        item._impl = WinForms.ListViewItem(self.row_data(item))\n         self.native.Items.Insert(index, item._impl)\n         self.native.EndUpdate()\n", "issue": "Table rows not rendering correctly in `update_data` winforms\n## Expected Behavior\r\nView text in the rows\r\n\r\n## Current Behavior\r\nRows are created but text is not displayed.\r\n![image](https://user-images.githubusercontent.com/479689/78953344-20995d80-7b0b-11ea-80da-889b488372be.png)\r\nWhen I insert a new row (with insert button) is working ok:\r\n![image](https://user-images.githubusercontent.com/479689/78953506-a3221d00-7b0b-11ea-8ec5-b1429da77e54.png)\r\n\r\nIn found that a change was made in `update_data` ( https://github.com/beeware/toga/commit/cb326e79ea1884f9e71fadfb1d7daf0688e78753) and `update_data` use a different ListViewItem creation than `insert` method which is working ok.\r\n\r\nThe specific line is the change made from this one:\r\n```\r\nitem._impl = WinForms.ListViewItem([\r\n            str(getattr(item, attr)) for attr in self.interface._accessors\r\n        ])\r\n```\r\nto this:\r\n```\r\nitem._impl = WinForms.ListViewItem(self.row_data(item))\r\n```\r\n\r\n## Steps to reproduce\r\n1. Open example and that's it\r\n\r\n## Your Environment\r\n\r\n* Python Version (list the specific version number)\r\n3.7.7\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  - [x] Windows - version: 10 Pro\r\n  - [ ] Other - name:  - version:\r\n\r\n* Toga Version (list the specific version number or git hash)\r\nMaster branch of toga.\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  - [x] 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 Table(Widget):\n    def create(self):\n        self._container = self\n        self.native = WinForms.ListView()\n        self.native.View = WinForms.View.Details\n\n        dataColumn = []\n        for heading in self.interface.headings:\n            col = WinForms.ColumnHeader()\n            col.Text = heading\n            dataColumn.append(col)\n\n        self.native.FullRowSelect = True\n        self.native.Multiselect = self.interface.multiple_select\n        self.native.DoubleBuffered = True\n        self.native.Columns.AddRange(dataColumn)\n\n    def change_source(self, source):\n        self.update_data()\n\n    def row_data(self, item):\n        # TODO: Winforms can't support icons in tree cells; so, if the data source\n        # specifies an icon, strip it when converting to row data.\n        def strip_icon(item, attr):\n            val = getattr(item, attr)\n            if isinstance(val, tuple):\n                return str(val[1])\n            return str(val)\n\n        return [item] + [\n            strip_icon(item, attr)\n            for attr in self.interface._accessors\n        ]\n\n    def update_data(self):\n        self.native.BeginUpdate()\n        self.native.Items.Clear()\n        items = []\n        for item in self.interface.data:\n            item._impl = WinForms.ListViewItem(self.row_data(item))\n            items.append(item._impl)\n        self.native.Items.AddRange(items)\n        self.native.EndUpdate()\n\n    def insert(self, index, item):\n        self.native.BeginUpdate()\n        item._impl = WinForms.ListViewItem([\n            str(getattr(item, attr)) for attr in self.interface._accessors\n        ])\n        self.native.Items.Insert(index, item._impl)\n        self.native.EndUpdate()\n\n    def change(self, item):\n        self.interface.factory.not_implemented('Table.change()')\n\n    def remove(self, item):\n        self.update_data()\n\n    def clear(self):\n        self.native.Items.Clear()\n\n    def set_on_select(self, handler):\n        self.interface.factory.not_implemented('Table.set_on_select()')\n\n    def scroll_to_row(self, row):\n        self.native.EnsureVisible(row)\n        self.interface.factory.not_implemented('Table.scroll_to_row()')\n\n    def rehint(self):\n        self.interface.intrinsic.width = at_least(self.interface.MIN_WIDTH)\n        self.interface.intrinsic.height = at_least(self.interface.MIN_HEIGHT)\n", "path": "src/winforms/toga_winforms/widgets/table.py"}]}