From ba4a9abba4cc15d56c7d1f2ff8234b640fe9c2e1 Mon Sep 17 00:00:00 2001 From: FireG3cko <35481250+FireG3cko@users.noreply.github.com> Date: Mon, 13 Aug 2018 17:08:30 -0400 Subject: [PATCH] Fixed menu_item.cr on_click Makes the on_click function do what it's supposed to do --- src/hedron/menu/menu_item.cr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hedron/menu/menu_item.cr b/src/hedron/menu/menu_item.cr index b892a1c..659459c 100644 --- a/src/hedron/menu/menu_item.cr +++ b/src/hedron/menu/menu_item.cr @@ -37,6 +37,11 @@ module Hedron boxed_data = ::Box.box(proc) @@box = boxed_data @@item = self + new_proc = ->(item : UI::MenuItem*, window : UI::Window*, data : Void*) { + callback = ::Box(Proc(MenuItem, Nil)).unbox(data) + callback.call(@@item.not_nil!) + } + UI.menu_item_on_clicked(to_unsafe, new_proc, boxed_data) end def to_unsafe