Search Unity

EditorGUILayout.BeginScrollView AutoSize problem

Discussion in 'Immediate Mode GUI (IMGUI)' started by Jakobs, Dec 15, 2014.

  1. Jakobs

    Jakobs

    Joined:
    Nov 10, 2010
    Posts:
    4
    Hi, after i spent lot of time for find solution off this problem,i decided to go here

    i have trouble with EditorGUILayout.BeginScrollView in my node based editor

    Code (CSharp):
    1.  
    2. scroolPos = EditorGUILayout.BeginScrollView(scroolPos,GUI.skin.customStyles[20]);
    3.  
    4.         NodeDraw.DrawGrid(700,100000);
    5.         BeginWindows();
    6.         foreach(QALine a in QAL)
    7.         {
    8.                 NodeDraw.Draw(QAT.Find(x => x.id == a.outId).rect,
    9.                               QAT.Find(x => x.id == a.inId).rect);
    10.         }
    11.         foreach(QAText a in QAT)
    12.         {
    13.             a.rect = GUILayout.Window(a.id, a.rect, MyWindow,"","button");
    14.         }
    15.         EndWindows();
    16.  
    17. EditorGUILayout.EndScrollView();
    18.  
    Need extend area automatically when GUILayout.Window Rect overseas EditorGUILayout.BeginScrollView and add scroll bars
     

    Attached Files:

    • FOrg.jpg
      FOrg.jpg
      File size:
      189.3 KB
      Views:
      10,658
    Last edited: Dec 15, 2014
  2. Jakobs

    Jakobs

    Joined:
    Nov 10, 2010
    Posts:
    4
    Any one can halp me? please?
     
  3. djTomServo2

    djTomServo2

    Joined:
    Mar 22, 2013
    Posts:
    14
    Hi,

    I am having a similar issue here, which I asked about in this thread:
    http://forum.unity3d.com/threads/ed...owing-access-to-all-enclosed-elements.285656/

    Unfortunately, the solutions presented don't work. I've pretty much tried every combination of settings and calls I can think of, but I've been unable to get ScrollView to work the way you would think a ScrollView works. Makes me wonder if maybe something is bugged.
     
  4. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
  5. djTomServo2

    djTomServo2

    Joined:
    Mar 22, 2013
    Posts:
    14
    I definitely did try using different combinations of GUILayoutOptions and nothing seemed to work (I even copy pasted the above line, and still no scrollbars). The only way still that I'm able to see all my data is by resizing the window.
     
  6. Jakobs

    Jakobs

    Joined:
    Nov 10, 2010
    Posts:
    4
  7. AhrenM

    AhrenM

    Joined:
    Aug 30, 2014
    Posts:
    74
    Did anyone work this out?
    It's driving me mental. How do you define a scroll view when you don't know the size of the view, because it hasn't actually been populated yet???

    If the sizes of my content were fixed (as per the helpful documentation) I probably wouldn't need to scroll!!!....<cries into keyboard>

    I've tried using GetLastRec() in a few places, but I either get the size of the scroll view as defined (fair enough) OR .height & y* values = 0

    And I thought FoldOuts were painful......


    [EDIT]
    As usually happens when nothing makes sense, there was something fundamentally wrong. I was mixing Layout and non Layout calls which was throwing everything out....live and learn.
     
    Last edited: May 27, 2015