Closed kojix2 closed 3 years ago
You would have to properly define the UI::AreaHandler
struct, and then do:
ah = uninitialized UI::AreaHandler
area = UI.new_area pointerof(ah)
However, if you try this code now without a proper UI::AreaHandler declaration, then it's going to crash.
I think it would look like this for starters:
struct AreaHandler
draw : Void*
mouse_event : Void*
mouse_crossed : Void*
drag_broken : Void*
key_event : Void*
end
Thank you!
I compiled the code below.
Then I got the error message "undefined method 'new' for UI::AreaHandler:Class" It may be because the UI::AreaHandler struct is not fully defined. I thought for a moment, but C pointers are difficult for me. I want to draw figures. Is there a good way to do it?