dontpanic92 / wxGo

Golang wxWidgets Wrapper
Other
403 stars 51 forks source link

DataViewListCtrl AppendItem panics #67

Open sawyersteven opened 5 years ago

sawyersteven commented 5 years ago

run time panic: runtime error: cgo argument has Go pointer to Go pointer

github.com/dontpanic92/wxGo/wx.SwigClassDataViewListCtrl.AppendItem__SWIG_1.func1:103001

This panic is caused by attempting to add a row to a DataViewListCtrl

func window() wx.Dialog {
    f := wx.NewDialog(wx.NullWindow, -1, "Hello World", wx.DefaultPosition, wx.NewSizeT(300, 400))

    vboxMain := wx.NewBoxSizer(wx.VERTICAL)

    fileList := wx.NewDataViewListCtrl(f, wx.ID_ANY)
    fileList.AppendTextColumn("Column 1", wx.LIST_FORMAT_LEFT, 150)

    row := []wx.Variant{wx.NewVariant("HI")}

    fileList.AppendItem(row)

    vboxMain.Add(fileList, 0, wx.EXPAND)

    f.SetSizer(vboxMain)

    return f
}