ImGui Button over PlotHistogram don't trigger IsItemActive

Hello •ᴗ•

Trying to make a custom UI using ImGui.
I’ve followed this great tutorial to stack elements on top of eachothers :
Custom Widgets with Dear ImGui - vvvvTv S02 E04

Using the method mention in this episode (re-placing cursor to stack elements), i’ve stacked a Button on top of a PlotHistrogram.

After this i can call ÌsItemHovered, IsItemClicked on the context to check wether the stacked button is hovered or clicked.
But unfortunatly IsItemActive do not seem to work on this button (when the click is hold on the button).

IsItemActive work on a non-stacked button, so i was wondering if you know any way to get this working on a stacked one.

What i’ve tryed allready :

  • Stacking the Button on top of a ProgressBar instead : IsItemActive work !
    This probably mean that the issue come from the interactive part of the Plot. (don’t seem we can disable that).
  • Placing the PlotHistogram first, then stacking a ProgressBar, then stacking theButton : IsItemActive do not work !

A way to disable the interactivity of the PlotHistrogram would be a solution, but how ?

Thanks !

It’s working here.


ButtonOnTopHistogram.vl (18.7 KB)

Intersting, you placed the Button first then the PlotHistogram, in all my tests i was doing the opposite.

So having the Button bellow the PlotHistogram instead of over seem to fix my issue !
Thanks !

And if anyone have any other recomandation, this may also be cool to know about !
Like some way to set custom flags on widget to disable interactivity or something ?

For now i’ll go with ur solution @bjoern •ᴗ•

Wasn’t even aware lol. Alternative approach this time really on top:

Thought about this, but i am making a dragging sytem..
This mean the Hover won’t always be valid while dragging :/ (IsItemActive do)

Here is a demo of what i’m making.
The button are bellow the PlotHistogram and i am using IsItemActive right now.
2025_10_16_10-43_vvvv_BejEo

Also in your case, if we click and hold outside the button, then go on top of the button while holding, this will return True while it shouldn’t.

Just noticed this block, haven’t tryed but it look like exactly what i needed !
It still display but the mouse don’t react to the plot !

ImGui.Widgets > Disabled (block)

Edit : Don’t seem to work either ..