SELF header display on imgui elf window

This commit is contained in:
georgemoralis 2023-05-06 11:35:42 +03:00
parent 24e68b58f5
commit cda7c67e36
3 changed files with 33 additions and 21 deletions

View file

@ -11,6 +11,7 @@ void ElfViewer::display(bool enabled)
{
enum
{
SELF_HEADER,
ELF_HEADER
};
static int selected = -1;
@ -21,7 +22,11 @@ void ElfViewer::display(bool enabled)
{
if (ImGui::TreeNode("Self"))
{
ImGui::TreeNodeEx("Self Header", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen, "Self Header");
if (ImGui::TreeNodeEx("Self Header", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen, "Self Header"))
{
if (ImGui::IsItemClicked())
selected = SELF_HEADER;
}
if (ImGui::TreeNode("Self Segment Header"))
{
@ -62,11 +67,10 @@ void ElfViewer::display(bool enabled)
ImGui::SameLine();
ImGui::BeginChild("Table View", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); // Leave room for 1 line below us
if (selected == ELF_HEADER) {
ImGui::Text("hello");
if (selected == SELF_HEADER) {
ImGui::TextWrapped(elf->SElfHeaderStr().c_str());
}
ImGui::EndChild();
selected = -1;
ImGui::End();
}