How to solve the wxGrid class no "findWindowById" function?

Viewed 26

In the wxframe, there is one button and one "wxGrid" object. I want to "click“ the function to change the "wxGrid".

But wxStaticText hasn't function for "findWindowById". Now I solve as follows

-record(wx_ref, {ref, type, state=[]}).

button_debug_a_click(Event,Object)->
    A = wxWindow:findWindowById(?CONST_EQUIPMENT_GRID_ID),
    B = A#wx_ref{type = wxGrid},
    lager:debug("find equipment grid object:\t~p\t~p",[A,B]),
    wxGrid:hide(B),
    ok.

Only after it is converted to {wx_ref,45, wxGrid,[]}, it can be used. But “wx_ref” record's header file can't be visited.

Is there a better way to solve the problem (convert id to object)

0 Answers
Related