Exemple #1
0
        /// <summary>
        /// Initializes Curses Sharp and the underlying curses implementation.
        /// </summary>
        ///
        /// <remarks>
        /// It should be the first function called as most other functions
        /// require the library be initialized.
        /// <para>
        /// The Window object returned can be later retrieved using
        /// <see cref="StdScr"/> property.
        /// </para>
        /// </remarks>
        /// <returns>The default Window object</returns>
        public static Window InitScr()
        {
            if (stdscr != null)
            {
                throw new InvalidOperationException("Curses is already initialized.");
            }

            stdscr = Window.WrapHandle(CursesMethods.initscr());
            return(stdscr);
        }