Okay, I have this ListStore called StorageLS that is supposed to have columns for name, capacity, usage and a GtkProgressBar that visualizes the space usage. Now I want to create a ListStore but the gtkc.gobjectypes: GType
enum does not seem to have anything for it. I'm stuck.
class StorageLS : ListStore {
private:
enum Columns {
id,
deviceName,
capacityGB,
usedGB
}
public:
this() {
// uint id, in string deviceName, double capacityGB, double usedGB
// construct a ListStore with corresponding GTypes
super([GType.UINT, GType.STRING, GType.DOUBLE, GType.DOUBLE]);
}
void addStorage(uint id, in string deviceName, double capacityGB, double usedGB) {
TreeIter iter = this.createIter(); // base ListStore.createIter()
this.setValue(iter, Columns.id, id); // base ListStore.setValue()
this.setValue(iter, Columns.deviceName, deviceName);
this.setValue(iter, Columns.capacityGB, capacityGB);
this.setValue(iter, Columns.usedGB, usedGB);
}
}
class StorageTV : TreeView {
import gtk.TreeViewColumn : TreeViewColumn;
private:
TreeViewColumn idCol, deviceNameCol, capacityGBCol, usedGBCol;
public:
this() {
}
}
How should I proceed?