summaryrefslogtreecommitdiff
path: root/interaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'interaction.cpp')
-rw-r--r--interaction.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/interaction.cpp b/interaction.cpp
index f7763679..432859d9 100644
--- a/interaction.cpp
+++ b/interaction.cpp
@@ -172,6 +172,14 @@ static bool GetDirectoryNameInputCallback(void* ctxt, char** result, const char*
}
+static BNMessageBoxButtonResult ShowMessageBoxCallback(void* ctxt, const char* title, const char* text,
+ BNMessageBoxButtonSet buttons, BNMessageBoxIcon icon)
+{
+ InteractionHandler* handler = (InteractionHandler*)ctxt;
+ return handler->ShowMessageBox(title, text, buttons, icon);
+}
+
+
void BinaryNinja::RegisterInteractionHandler(InteractionHandler* handler)
{
BNInteractionHandlerCallbacks cb;
@@ -186,6 +194,7 @@ void BinaryNinja::RegisterInteractionHandler(InteractionHandler* handler)
cb.getOpenFileNameInput = GetOpenFileNameInputCallback;
cb.getSaveFileNameInput = GetSaveFileNameInputCallback;
cb.getDirectoryNameInput = GetDirectoryNameInputCallback;
+ cb.showMessageBox = ShowMessageBoxCallback;
BNRegisterInteractionHandler(&cb);
}
@@ -284,3 +293,10 @@ bool BinaryNinja::GetDirectoryNameInput(string& result, const string& prompt, co
BNFreeString(value);
return true;
}
+
+
+BNMessageBoxButtonResult BinaryNinja::ShowMessageBox(const string& title, const string& text,
+ BNMessageBoxButtonSet buttons, BNMessageBoxIcon icon)
+{
+ return BNShowMessageBox(title.c_str(), text.c_str(), buttons, icon);
+}