How to make the editor gui respond to hover as fast as the GUI.Button hover

I make a control, it has a white border, I want to modify the color of this border when hover, but when placed on OnGUI, this effect will have a little delay, I find that the Button of GUI. button can respond quickly to trigger OnGUI, may I ask how I can achieve the effect similar to this?
Does Unity provide a convenient interface to register this listener?

Is this for the inspector or for runtime use? If the latter… I would ask why you’re using IMGUI at runtime. Definitely should be using uGUI or UI Toolkit for runtime UI use.

Though far as I know GUIStyle can be used to determine this kind of stuff: Unity - Scripting API: GUIStyle

There’s docs on how to use them but they’re so old they still show java script examples: Unity - Manual: Customization

Thanks, I’m mainly an editor developer, so let me take a look at the two documents you sent.

It might be worth looking at UI Toolkit for editor tooling work as well. I know that transitions with it are fairly simple to set up either via USS styles or with the UI Builder itself: Unity - Manual: USS transition

9777747--1401804--upload_2024-4-18_11-38-32.png
This is the effect I want, but the delay in this response is really painful. It would be nice to be as responsive as GUI.button.

Maybe this is what you’re looking for?

or…
It might be a bad thing to mention a paid asset.
But Odin seems to be used and mentioned by so many people that it’s hard to find people who don’t use it

“RequestRepaint()” exists in Odin.
I think that makes real-time updates smooth without delay
When it comes to creating a custom editor, I recommend using Odin

I didn’t checked the implementation of Repaint in Odin,
But maybe, you can achieve something similar with Unity’s normal way of doing things
I think it would be nice to search about Repaint

Be careful trying to force the editor to run at a high refresh rate as it can very easily kill editor performance. It’s running the way it is because it’s meant to maximize actual development and playtesting.

From what I’ve seen, GUI isn’t updated if you don’t move your mouse or hover the window.

If you know something needs to be repainted in order to update visuals then there’s nothing wrong with calling a repaint to do so when you know the editor is optimizing out areas that you aren’t interacting with directly.