- Home /
 
 
               Question by 
               jmorhart · Sep 25, 2015 at 06:01 PM · 
                editorinspectoreditor-scriptingeditorwindowpopup  
              
 
              Set the Rect of PopupWindowContent
Does anyone know how to set the Rect of a class which derives from PopupWindowContent?
I have a class
 public class SomeWindow : PopupWindowContent
 {
     // class contents here, including OnGUI(Rect) override
 }
 
               And I am using
 PopupWindow.Show(someButtonRect, new SomeWindow());
 
               to create the popup window. However, the popup is bigger than it needs to be, so I would like to set its size somehow. Any help would be much appreciated. Thanks!
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by jmorhart · Nov 04, 2015 at 11:16 PM
Figured this one out myself.
 public class SomeWindow : PopupWindowContent
 {
     Vector2 maxSize = new Vector2(100, 200);
     
     public override OnGUI(Rect rect)
     {
         editorWindow.maxSize = maxSize;
     }
  }
 
              Your answer
 
             Follow this Question
Related Questions
Custom Editor like Package Manager 0 Answers
How to have two inspectors of different types thats objects they are inspecting change 0 Answers
How to record hideFlags for Undo/Redo 0 Answers
How to make several separate Inspector window instances 1 Answer
Changes to Object made in custom Editor Window don't persist 0 Answers