diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-09-19 23:57:39 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2016-09-19 23:57:39 -0400 |
| commit | 91c9990b0f51864f60e71d4004cfb2eb75154eb8 (patch) | |
| tree | f82f2bdb9a4e6253c98797347b918634834184dc /interaction.cpp | |
| parent | 1364a9bc7b3887441540cd27685c1addb028afb3 (diff) | |
Add API for showing a message box in the UI
Diffstat (limited to 'interaction.cpp')
| -rw-r--r-- | interaction.cpp | 16 |
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); +} |
