Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.GTK
comparison Widgets/UnitDisplayWidget.cs @ 58:7bba99c368c8
Re #60: Add UI to add/remove/edit weapons in GTK
* Fix GTK error about tree model columns by populating the store correctly
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Thu, 26 Aug 2010 19:34:57 +0000 |
parents | 28b242612ad7 |
children | c3415c6df551 |
comparison
equal
deleted
inserted
replaced
57:293d204e40db | 58:7bba99c368c8 |
---|---|
91 CellRendererText renderer = new CellRendererText(); | 91 CellRendererText renderer = new CellRendererText(); |
92 equipmentList.AppendColumn("", renderer, new TreeCellDataFunc(RenderEquipmentLine)); | 92 equipmentList.AppendColumn("", renderer, new TreeCellDataFunc(RenderEquipmentLine)); |
93 | 93 |
94 | 94 |
95 TreeStore model = new TreeStore(typeof(UnitEquipmentItem)); | 95 TreeStore model = new TreeStore(typeof(UnitEquipmentItem)); |
96 model.AppendValues(unit.GetEquipment()); | 96 foreach (UnitEquipmentItem item in unit.GetEquipment()) |
97 { | |
98 model.AppendValues(item); | |
99 } | |
100 | |
97 equipmentList.Model = model; | 101 equipmentList.Model = model; |
98 } | 102 } |
99 | 103 |
100 public void RenderEquipmentLine(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) | 104 public void RenderEquipmentLine(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) |
101 { | 105 { |