void InitIfNeeded()
        {
            if (_db == null)
            {
                _db = VariablesUtility.Settings;
            }

            if (_rectLayout == null || _resized)
            {
                _resized = false;
                Rect rpos = base.position.CopyToZero();
                _rectLayout = rpos.Split(SplitMode.Vertical, 20, 21, -1);
                //Rect r;
                Vector2 center;
                for (int x = 1; x < _rectLayout.Length; x++)
                {
                    center = _rectLayout[x].center;
                    _rectLayout[x].size   = new Vector2(_rectLayout[x].width - 40, _rectLayout[x].height - 5);
                    _rectLayout[x].center = center;
                }
            }


            VariablesUtilityEditor.onNewVariablesCreated -= ReupdateTable;
            VariablesUtilityEditor.onNewVariablesCreated += ReupdateTable;

            if (!m_Initialized)
            {
                // Check if it already exists (deserialized from window layout file or scriptable object)
                if (m_TreeViewState == null)
                {
                    m_TreeViewState = new TreeViewState();
                }

                bool firstInit   = m_MultiColumnHeaderState == null;
                var  headerState = VariablesTable.CreateDefaultMultiColumnHeaderState(EntryTableViewRect.width);
                if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState))
                {
                    MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState);
                }
                m_MultiColumnHeaderState = headerState;

                var multiColumnHeader = new MyMultiColumnHeader(headerState);
                if (firstInit)
                {
                    multiColumnHeader.ResizeToFit();
                }

                var treeModel = new TreeModel <VariablesElement>(GetData());

                m_TreeView = new VariablesTable(m_TreeViewState, multiColumnHeader, treeModel);

                m_SearchField = new UnityEditor.IMGUI.Controls.SearchField();
                m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem;

                m_TreeView.searchString = "";
                m_Initialized           = true;
            }
        }