# EditorGUILayout.ScrollViewScope

> Disposable helper class for managing EditorGUILayout.BeginScrollView / EditorGUILayout.EndScrollView.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule
* **Inherits from:** Scope
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class EditorGUILayout.ScrollViewScope : GUI.Scope, IDisposable
```

## Remarks

These work just like [GUILayout.ScrollViewScope](/engine/6000.7/script-reference/unityengine/guilayout/scrollviewscope.md) but feel more application-like and should be used in the editor

![BeginEndScrollView (EditorGUILayout.ScrollViewScope)](/api/media?file=/engine/6000.7/media/images/BeginEndScrollView.png)

*Label inside a scroll view.*

## Examples

```csharp
using UnityEngine;
using UnityEditor;

// Simple Editor Window that creates a scroll view with a Label inside
class BeginEndScrollView : EditorWindow
{
    Vector2 scrollPos;
    string t = "This is a string inside a Scroll view!";

    [MenuItem("Examples/Write text on ScrollView")]
    static void Init()
    {
        var window = GetWindow<BeginEndScrollView>();
        window.Show();
    }

    void OnGUI()
    {
        using (var h = new EditorGUILayout.HorizontalScope())
        {
            using (var scrollView = new EditorGUILayout.ScrollViewScope(scrollPos, GUILayout.Width(100), GUILayout.Height(100)))
            {
                scrollPos = scrollView.scrollPosition;
                GUILayout.Label(t);
            }
            if (GUILayout.Button("Add More Text", GUILayout.Width(100), GUILayout.Height(100)))
                t += " \nAnd this is more text!";
        }
        if (GUILayout.Button("Clear"))
            t = "";
    }
}
```

## Constructors

| Constructor                                                                                                                                                                                                                                                                                                                              | Description                                                          |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [ScrollViewScope(UnityEngine.Vector2,System.Boolean,System.Boolean,UnityEngine.GUILayoutOption\[\])](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/ctor.md#scrollviewscope\(vector2-bool-bool-guilayoutoption\))                                                                                           | Create a new ScrollViewScope and begin the corresponding ScrollView. |
| [ScrollViewScope(UnityEngine.Vector2,System.Boolean,System.Boolean,UnityEngine.GUIStyle,UnityEngine.GUIStyle,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/ctor.md#scrollviewscope\(vector2-bool-bool-guistyle-guistyle-guistyle-guilayoutoption\)) | Create a new ScrollViewScope and begin the corresponding ScrollView. |
| [ScrollViewScope(UnityEngine.Vector2,UnityEngine.GUILayoutOption\[\])](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/ctor.md#scrollviewscope\(vector2-guilayoutoption\))                                                                                                                                   | Create a new ScrollViewScope and begin the corresponding ScrollView. |
| [ScrollViewScope(UnityEngine.Vector2,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/ctor.md#scrollviewscope\(vector2-guistyle-guilayoutoption\))                                                                                                     | Create a new ScrollViewScope and begin the corresponding ScrollView. |
| [ScrollViewScope(UnityEngine.Vector2,UnityEngine.GUIStyle,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/ctor.md#scrollviewscope\(vector2-guistyle-guistyle-guilayoutoption\))                                                                       | Create a new ScrollViewScope and begin the corresponding ScrollView. |

## Properties

| Property                                                                                                              | Description                                                                                         |
| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [handleScrollWheel](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/handlescrollwheel.md) | Whether this ScrollView should handle scroll wheel events. (default: true).                         |
| [scrollPosition](/engine/6000.7/script-reference/unityeditor/editorguilayout/scrollviewscope/scrollposition.md)       | The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. |
