Skip to content

wxTreeListCtrl::GetItemData returns base wxClientData with no methods #125

Description

@sokolas

I'm trying to store custom data in a wxTreeListCtrl items like this:

local item = myListCtrl:AppendItem(parentItem, "name", -1, -1)
local obj = wx.wxStringClientData("test data")
myListCtrl:SetItemData(item, obj)

It runs fine with no errors. However, when I try to retrieve this data, I get errors:

local s = myListCtrl:GetItemData(item)
Log(s)  -- produces "userdata: 000001eeef206148 [wxClientData(000001eeef2e2070, 26)]"
Log(s:GetData()) -- "attempt to call method 'GetData' (a nil value)"

Is it possible to cast wxClientData back to wxStringClientData or use another class to store the data?
I'm using luaJIT 2.1, wxlua built from master with webview;xrc;xml;media;richtext;propgrid;gl;html;adv;core;net;base libraries, wxWidgets 3.2.2.1 with 3.0 compatibility.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions