- Home /
Custom EditorGUI widget should invoke EditorWindow.Repaint
I am trying to create a custom popup method that will work similar to EditorGUI.Popup, but with extended functionality (search bar etc). The problem i have is, that selecting an item won't send any message to the window / gui context that renders the popup, which means its effect won't be immediate (noone will read the changed value, noone will get the EndChangeCheck() true immediatelly). I've decompiled the EditorGUI.Popup and it seems like it's done using GUIView instance, which i can't obtain because it's all internal classes (which drives me nuts, how can i extend GUI if everything is interned / sealed? )
Is there some way how to force repaint if i don't have a reference to the window that draws my GUI? (I can't have it, it may be used in inspector, custom window, nested inside another inspector / editor / anywhere else)
I have the exact same problem atm. I'm building a treeview and dont want it to need a reference to the Window. Additionally I cannot focus/blur my custom drawn nodes properly because I don't know how to check which other object currently has focus. There is a lot of necessary stuff hidden in the internal classes. Could you get it to work now or could anybody else answer this question?
Well i gave my widget a delegate to Repaint as well as flag if the window is focused or not... found no other solution
I found a workaround for my case. Because I need to repaint the window as a reaction to a click I can suppose the window has focus and use EditorWindow.focusedWindow.Repaint(); $$anonymous$$aybe it also suits your case.
However I could not fix the focus issue. I still need 2 methods of my treeview specifically called from the window on Focus or LoseFocus
Your answer
Follow this Question
Related Questions
How completly remove GUI.Repaint() calls ? 1 Answer
GUI Popup problem…! 1 Answer
button drawn last not triggered 0 Answers
Text pop up when mouse over gui button 2 Answers
problem with a pop-up window 1 Answer