summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-08-22 15:06:15 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-08-22 15:06:15 -0400
commit3196c24604551745645f4737a67ecfebb416a4fc (patch)
treed37d34e19c49c58a3c124d8a1ac24bff64e584d3
parent7c283bf98c54245e87c43aac100bb87cb04bb04e (diff)
pke-editor: handle callback list popup empty
-rw-r--r--editor/editor.cpp4
-rw-r--r--src/plugins.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index e1c10d2..c90fb08 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -1534,6 +1534,10 @@ bool RecordImGui_CallbackSelectModal(long &selectedIndex) {
}
}
ImGui::EndPopup();
+ if (ImGui::IsPopupOpen("CallbackSelect") == true && count == 0) {
+ fprintf(stderr, "[RecordImGui_CallbackSelectModal] No available callback signatures.\n");
+ ImGui::CloseCurrentPopup();
+ }
}
return returnValue;
}
diff --git a/src/plugins.cpp b/src/plugins.cpp
index 010c20e..838237b 100644
--- a/src/plugins.cpp
+++ b/src/plugins.cpp
@@ -72,7 +72,7 @@ CallbackSignature *PkePlugin_GetSortedSignatures(long &count) {
qsort(sortedSignatures.data, sortedSignatures.next, sizeof(CallbackSignature), pstrncmp);
}
count = sortedSignatures.next;
- return &sortedSignatures[0];
+ return reinterpret_cast<CallbackSignature*>(sortedSignatures.data);
}
void PkePlugin_Teardown() {
pk_arr_reset(&sortedSignatures);