UnityEditor.ContainerWindow.ShowPopup C# (CSharp) Method

ShowPopup() private method

private ShowPopup ( ) : void
return void
        internal void ShowPopup()
        {
            this.m_ShowMode = 1;
            this.Internal_Show(this.m_PixelRect, this.m_ShowMode, this.m_MinSize, this.m_MaxSize);
            if (this.m_RootView != null)
            {
                this.m_RootView.SetWindowRecurse(this);
            }
            this.Internal_SetTitle(this.m_Title);
            this.Save();
            this.Internal_BringLiveAfterCreation(false, false);
        }

Usage Example

        void Setup(string tooltip, Rect rect)
        {
            m_hoverRect    = rect;
            m_tooltip.text = tooltip;

            // Calculate size and position tooltip view
            m_Style = EditorStyles.tooltip;

            m_Style.wordWrap = false;
            m_optimalSize    = m_Style.CalcSize(m_tooltip);

            if (m_optimalSize.x > MAX_WIDTH)
            {
                m_Style.wordWrap = true;
                m_optimalSize.x  = MAX_WIDTH;
                m_optimalSize.y  = m_Style.CalcHeight(m_tooltip, MAX_WIDTH);
            }

            m_tooltipContainer.position = new Rect(
                Mathf.Floor(m_hoverRect.x + (m_hoverRect.width / 2) - (m_optimalSize.x / 2)),
                Mathf.Floor(m_hoverRect.y + (m_hoverRect.height) + 10.0f),
                m_optimalSize.x, m_optimalSize.y);

            position = new Rect(0, 0, m_optimalSize.x, m_optimalSize.y);

            m_tooltipContainer.ShowPopup();
            m_tooltipContainer.SetAlpha(1.0f);
            s_guiView.mouseRayInvisible = true;

            RepaintImmediately(); // Force repaint to fix that the tooltip text did sometimes not update (we did not get a new OnGUI if the rect had the same size)
        }
All Usage Examples Of UnityEditor.ContainerWindow::ShowPopup