Terminal.Gui.Application.html 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class Application
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Application
  11. ">
  12. <meta name="generator" content="docfx 2.59.2.0">
  13. <link rel="shortcut icon" href="../../favicon.ico">
  14. <link rel="stylesheet" href="../../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../../styles/docfx.css">
  16. <link rel="stylesheet" href="../../styles/main.css">
  17. <meta property="docfx:navrel" content="../../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../../index.html">
  34. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list">Search Results for <span></span></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Terminal.Gui.Application">
  73. <h1 id="Terminal_Gui_Application" data-uid="Terminal.Gui.Application" class="text-break">Class Application
  74. </h1>
  75. <div class="markdown level0 summary">
  76. A static, singleton class providing the main application driver for Terminal.Gui apps.
  77. </div>
  78. <div class="markdown level0 conceptual"></div>
  79. <div class="inheritance">
  80. <h5>Inheritance</h5>
  81. <div class="level0"><span class="xref">System.Object</span></div>
  82. <div class="level1"><span class="xref">Application</span></div>
  83. </div>
  84. <div class="inheritedMembers">
  85. <h5>Inherited Members</h5>
  86. <div>
  87. <span class="xref">System.Object.Equals(System.Object)</span>
  88. </div>
  89. <div>
  90. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  91. </div>
  92. <div>
  93. <span class="xref">System.Object.GetHashCode()</span>
  94. </div>
  95. <div>
  96. <span class="xref">System.Object.GetType()</span>
  97. </div>
  98. <div>
  99. <span class="xref">System.Object.MemberwiseClone()</span>
  100. </div>
  101. <div>
  102. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  103. </div>
  104. <div>
  105. <span class="xref">System.Object.ToString()</span>
  106. </div>
  107. </div>
  108. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  109. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  110. <h5 id="Terminal_Gui_Application_syntax">Syntax</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public static class Application</code></pre>
  113. </div>
  114. <h5 id="Terminal_Gui_Application_remarks"><strong>Remarks</strong></h5>
  115. <div class="markdown level0 remarks">
  116. <p>
  117. Creates a instance of <a class="xref" href="Terminal.Gui.MainLoop.html">MainLoop</a> to process input events, handle timers and
  118. other sources of data. It is accessible via the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_MainLoop">MainLoop</a> property.
  119. </p>
  120. <p>
  121. You can hook up to the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Iteration">Iteration</a> event to have your method
  122. invoked on each iteration of the <a class="xref" href="Terminal.Gui.MainLoop.html">MainLoop</a>.
  123. </p>
  124. <p>
  125. When invoked sets the SynchronizationContext to one that is tied
  126. to the mainloop, allowing user code to use async/await.
  127. </p>
  128. </div>
  129. <h5 id="Terminal_Gui_Application_examples"><strong>Examples</strong></h5>
  130. <pre><code>// A simple Terminal.Gui app that creates a window with a frame and title with
  131. // 5 rows/columns of padding.
  132. Application.Init();
  133. var win = new Window (&quot;Hello World - CTRL-Q to quit&quot;) {
  134. X = 5,
  135. Y = 5,
  136. Width = Dim.Fill (5),
  137. Height = Dim.Fill (5)
  138. };
  139. Application.Top.Add(win);
  140. Application.Run();</code></pre>
  141. <h3 id="fields">Fields
  142. </h3>
  143. <h4 id="Terminal_Gui_Application_Driver" data-uid="Terminal.Gui.Application.Driver">Driver</h4>
  144. <div class="markdown level1 summary">
  145. The current <a class="xref" href="Terminal.Gui.ConsoleDriver.html">ConsoleDriver</a> in use.
  146. </div>
  147. <div class="markdown level1 conceptual"></div>
  148. <h5 class="decalaration">Declaration</h5>
  149. <div class="codewrapper">
  150. <pre><code class="lang-csharp hljs">public static ConsoleDriver Driver</code></pre>
  151. </div>
  152. <h5 class="fieldValue">Field Value</h5>
  153. <table class="table table-bordered table-striped table-condensed">
  154. <thead>
  155. <tr>
  156. <th>Type</th>
  157. <th>Description</th>
  158. </tr>
  159. </thead>
  160. <tbody>
  161. <tr>
  162. <td><a class="xref" href="Terminal.Gui.ConsoleDriver.html">ConsoleDriver</a></td>
  163. <td></td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <h4 id="Terminal_Gui_Application_Iteration" data-uid="Terminal.Gui.Application.Iteration">Iteration</h4>
  168. <div class="markdown level1 summary">
  169. This event is raised on each iteration of the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_MainLoop">MainLoop</a>
  170. </div>
  171. <div class="markdown level1 conceptual"></div>
  172. <h5 class="decalaration">Declaration</h5>
  173. <div class="codewrapper">
  174. <pre><code class="lang-csharp hljs">public static Action Iteration</code></pre>
  175. </div>
  176. <h5 class="fieldValue">Field Value</h5>
  177. <table class="table table-bordered table-striped table-condensed">
  178. <thead>
  179. <tr>
  180. <th>Type</th>
  181. <th>Description</th>
  182. </tr>
  183. </thead>
  184. <tbody>
  185. <tr>
  186. <td><span class="xref">System.Action</span></td>
  187. <td></td>
  188. </tr>
  189. </tbody>
  190. </table>
  191. <h5 id="Terminal_Gui_Application_Iteration_remarks">Remarks</h5>
  192. <div class="markdown level1 remarks">
  193. See also <span class="xref">System.Threading.Timeout</span>
  194. </div>
  195. <h4 id="Terminal_Gui_Application_Resized" data-uid="Terminal.Gui.Application.Resized">Resized</h4>
  196. <div class="markdown level1 summary">
  197. Invoked when the terminal was resized. The new size of the terminal is provided.
  198. </div>
  199. <div class="markdown level1 conceptual"></div>
  200. <h5 class="decalaration">Declaration</h5>
  201. <div class="codewrapper">
  202. <pre><code class="lang-csharp hljs">public static Action&lt;Application.ResizedEventArgs&gt; Resized</code></pre>
  203. </div>
  204. <h5 class="fieldValue">Field Value</h5>
  205. <table class="table table-bordered table-striped table-condensed">
  206. <thead>
  207. <tr>
  208. <th>Type</th>
  209. <th>Description</th>
  210. </tr>
  211. </thead>
  212. <tbody>
  213. <tr>
  214. <td><span class="xref">System.Action</span>&lt;<a class="xref" href="Terminal.Gui.Application.ResizedEventArgs.html">Application.ResizedEventArgs</a>&gt;</td>
  215. <td></td>
  216. </tr>
  217. </tbody>
  218. </table>
  219. <h4 id="Terminal_Gui_Application_RootKeyEvent" data-uid="Terminal.Gui.Application.RootKeyEvent">RootKeyEvent</h4>
  220. <div class="markdown level1 summary">
  221. <p>
  222. Called for new KeyPress events before any processing is performed or
  223. views evaluate. Use for global key handling and/or debugging.
  224. </p>
  225. <p>Return true to suppress the KeyPress event</p>
  226. </div>
  227. <div class="markdown level1 conceptual"></div>
  228. <h5 class="decalaration">Declaration</h5>
  229. <div class="codewrapper">
  230. <pre><code class="lang-csharp hljs">public static Func&lt;KeyEvent, bool&gt; RootKeyEvent</code></pre>
  231. </div>
  232. <h5 class="fieldValue">Field Value</h5>
  233. <table class="table table-bordered table-striped table-condensed">
  234. <thead>
  235. <tr>
  236. <th>Type</th>
  237. <th>Description</th>
  238. </tr>
  239. </thead>
  240. <tbody>
  241. <tr>
  242. <td><span class="xref">System.Func</span>&lt;<a class="xref" href="Terminal.Gui.KeyEvent.html">KeyEvent</a>, <span class="xref">System.Boolean</span>&gt;</td>
  243. <td></td>
  244. </tr>
  245. </tbody>
  246. </table>
  247. <h4 id="Terminal_Gui_Application_RootMouseEvent" data-uid="Terminal.Gui.Application.RootMouseEvent">RootMouseEvent</h4>
  248. <div class="markdown level1 summary">
  249. Merely a debugging aid to see the raw mouse events
  250. </div>
  251. <div class="markdown level1 conceptual"></div>
  252. <h5 class="decalaration">Declaration</h5>
  253. <div class="codewrapper">
  254. <pre><code class="lang-csharp hljs">public static Action&lt;MouseEvent&gt; RootMouseEvent</code></pre>
  255. </div>
  256. <h5 class="fieldValue">Field Value</h5>
  257. <table class="table table-bordered table-striped table-condensed">
  258. <thead>
  259. <tr>
  260. <th>Type</th>
  261. <th>Description</th>
  262. </tr>
  263. </thead>
  264. <tbody>
  265. <tr>
  266. <td><span class="xref">System.Action</span>&lt;<a class="xref" href="Terminal.Gui.MouseEvent.html">MouseEvent</a>&gt;</td>
  267. <td></td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. <h4 id="Terminal_Gui_Application_UseSystemConsole" data-uid="Terminal.Gui.Application.UseSystemConsole">UseSystemConsole</h4>
  272. <div class="markdown level1 summary">
  273. If set, it forces the use of the System.Console-based driver.
  274. </div>
  275. <div class="markdown level1 conceptual"></div>
  276. <h5 class="decalaration">Declaration</h5>
  277. <div class="codewrapper">
  278. <pre><code class="lang-csharp hljs">public static bool UseSystemConsole</code></pre>
  279. </div>
  280. <h5 class="fieldValue">Field Value</h5>
  281. <table class="table table-bordered table-striped table-condensed">
  282. <thead>
  283. <tr>
  284. <th>Type</th>
  285. <th>Description</th>
  286. </tr>
  287. </thead>
  288. <tbody>
  289. <tr>
  290. <td><span class="xref">System.Boolean</span></td>
  291. <td></td>
  292. </tr>
  293. </tbody>
  294. </table>
  295. <h3 id="properties">Properties
  296. </h3>
  297. <a id="Terminal_Gui_Application_AlternateBackwardKey_" data-uid="Terminal.Gui.Application.AlternateBackwardKey*"></a>
  298. <h4 id="Terminal_Gui_Application_AlternateBackwardKey" data-uid="Terminal.Gui.Application.AlternateBackwardKey">AlternateBackwardKey</h4>
  299. <div class="markdown level1 summary">
  300. Alternative key to navigate backwards through all views. Shift+Ctrl+Tab is always used.
  301. </div>
  302. <div class="markdown level1 conceptual"></div>
  303. <h5 class="decalaration">Declaration</h5>
  304. <div class="codewrapper">
  305. <pre><code class="lang-csharp hljs">public static Key AlternateBackwardKey { get; set; }</code></pre>
  306. </div>
  307. <h5 class="propertyValue">Property Value</h5>
  308. <table class="table table-bordered table-striped table-condensed">
  309. <thead>
  310. <tr>
  311. <th>Type</th>
  312. <th>Description</th>
  313. </tr>
  314. </thead>
  315. <tbody>
  316. <tr>
  317. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  318. <td></td>
  319. </tr>
  320. </tbody>
  321. </table>
  322. <a id="Terminal_Gui_Application_AlternateForwardKey_" data-uid="Terminal.Gui.Application.AlternateForwardKey*"></a>
  323. <h4 id="Terminal_Gui_Application_AlternateForwardKey" data-uid="Terminal.Gui.Application.AlternateForwardKey">AlternateForwardKey</h4>
  324. <div class="markdown level1 summary">
  325. Alternative key to navigate forwards through all views. Ctrl+Tab is always used.
  326. </div>
  327. <div class="markdown level1 conceptual"></div>
  328. <h5 class="decalaration">Declaration</h5>
  329. <div class="codewrapper">
  330. <pre><code class="lang-csharp hljs">public static Key AlternateForwardKey { get; set; }</code></pre>
  331. </div>
  332. <h5 class="propertyValue">Property Value</h5>
  333. <table class="table table-bordered table-striped table-condensed">
  334. <thead>
  335. <tr>
  336. <th>Type</th>
  337. <th>Description</th>
  338. </tr>
  339. </thead>
  340. <tbody>
  341. <tr>
  342. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  343. <td></td>
  344. </tr>
  345. </tbody>
  346. </table>
  347. <a id="Terminal_Gui_Application_AlwaysSetPosition_" data-uid="Terminal.Gui.Application.AlwaysSetPosition*"></a>
  348. <h4 id="Terminal_Gui_Application_AlwaysSetPosition" data-uid="Terminal.Gui.Application.AlwaysSetPosition">AlwaysSetPosition</h4>
  349. <div class="markdown level1 summary">
  350. Used only by <span class="xref">Terminal.Gui.NetDriver</span> to forcing always moving the cursor position when writing to the screen.
  351. </div>
  352. <div class="markdown level1 conceptual"></div>
  353. <h5 class="decalaration">Declaration</h5>
  354. <div class="codewrapper">
  355. <pre><code class="lang-csharp hljs">public static bool AlwaysSetPosition { get; set; }</code></pre>
  356. </div>
  357. <h5 class="propertyValue">Property Value</h5>
  358. <table class="table table-bordered table-striped table-condensed">
  359. <thead>
  360. <tr>
  361. <th>Type</th>
  362. <th>Description</th>
  363. </tr>
  364. </thead>
  365. <tbody>
  366. <tr>
  367. <td><span class="xref">System.Boolean</span></td>
  368. <td></td>
  369. </tr>
  370. </tbody>
  371. </table>
  372. <a id="Terminal_Gui_Application_Current_" data-uid="Terminal.Gui.Application.Current*"></a>
  373. <h4 id="Terminal_Gui_Application_Current" data-uid="Terminal.Gui.Application.Current">Current</h4>
  374. <div class="markdown level1 summary">
  375. The current <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> object. This is updated when <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Run_System_Func_System_Exception_System_Boolean__">Run(Func&lt;Exception, Boolean&gt;)</a> enters and leaves to point to the current <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> .
  376. </div>
  377. <div class="markdown level1 conceptual"></div>
  378. <h5 class="decalaration">Declaration</h5>
  379. <div class="codewrapper">
  380. <pre><code class="lang-csharp hljs">public static Toplevel Current { get; }</code></pre>
  381. </div>
  382. <h5 class="propertyValue">Property Value</h5>
  383. <table class="table table-bordered table-striped table-condensed">
  384. <thead>
  385. <tr>
  386. <th>Type</th>
  387. <th>Description</th>
  388. </tr>
  389. </thead>
  390. <tbody>
  391. <tr>
  392. <td><a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a></td>
  393. <td>The current.</td>
  394. </tr>
  395. </tbody>
  396. </table>
  397. <a id="Terminal_Gui_Application_HeightAsBuffer_" data-uid="Terminal.Gui.Application.HeightAsBuffer*"></a>
  398. <h4 id="Terminal_Gui_Application_HeightAsBuffer" data-uid="Terminal.Gui.Application.HeightAsBuffer">HeightAsBuffer</h4>
  399. <div class="markdown level1 summary">
  400. The current <a class="xref" href="Terminal.Gui.ConsoleDriver.html#Terminal_Gui_ConsoleDriver_HeightAsBuffer">HeightAsBuffer</a> used in the terminal.
  401. </div>
  402. <div class="markdown level1 conceptual"></div>
  403. <h5 class="decalaration">Declaration</h5>
  404. <div class="codewrapper">
  405. <pre><code class="lang-csharp hljs">public static bool HeightAsBuffer { get; set; }</code></pre>
  406. </div>
  407. <h5 class="propertyValue">Property Value</h5>
  408. <table class="table table-bordered table-striped table-condensed">
  409. <thead>
  410. <tr>
  411. <th>Type</th>
  412. <th>Description</th>
  413. </tr>
  414. </thead>
  415. <tbody>
  416. <tr>
  417. <td><span class="xref">System.Boolean</span></td>
  418. <td></td>
  419. </tr>
  420. </tbody>
  421. </table>
  422. <a id="Terminal_Gui_Application_IsMouseDisabled_" data-uid="Terminal.Gui.Application.IsMouseDisabled*"></a>
  423. <h4 id="Terminal_Gui_Application_IsMouseDisabled" data-uid="Terminal.Gui.Application.IsMouseDisabled">IsMouseDisabled</h4>
  424. <div class="markdown level1 summary">
  425. Disable or enable the mouse in this <a class="xref" href="Terminal.Gui.Application.html">Application</a>
  426. </div>
  427. <div class="markdown level1 conceptual"></div>
  428. <h5 class="decalaration">Declaration</h5>
  429. <div class="codewrapper">
  430. <pre><code class="lang-csharp hljs">public static bool IsMouseDisabled { get; set; }</code></pre>
  431. </div>
  432. <h5 class="propertyValue">Property Value</h5>
  433. <table class="table table-bordered table-striped table-condensed">
  434. <thead>
  435. <tr>
  436. <th>Type</th>
  437. <th>Description</th>
  438. </tr>
  439. </thead>
  440. <tbody>
  441. <tr>
  442. <td><span class="xref">System.Boolean</span></td>
  443. <td></td>
  444. </tr>
  445. </tbody>
  446. </table>
  447. <a id="Terminal_Gui_Application_MainLoop_" data-uid="Terminal.Gui.Application.MainLoop*"></a>
  448. <h4 id="Terminal_Gui_Application_MainLoop" data-uid="Terminal.Gui.Application.MainLoop">MainLoop</h4>
  449. <div class="markdown level1 summary">
  450. The <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_MainLoop">MainLoop</a> driver for the application
  451. </div>
  452. <div class="markdown level1 conceptual"></div>
  453. <h5 class="decalaration">Declaration</h5>
  454. <div class="codewrapper">
  455. <pre><code class="lang-csharp hljs">public static MainLoop MainLoop { get; }</code></pre>
  456. </div>
  457. <h5 class="propertyValue">Property Value</h5>
  458. <table class="table table-bordered table-striped table-condensed">
  459. <thead>
  460. <tr>
  461. <th>Type</th>
  462. <th>Description</th>
  463. </tr>
  464. </thead>
  465. <tbody>
  466. <tr>
  467. <td><a class="xref" href="Terminal.Gui.MainLoop.html">MainLoop</a></td>
  468. <td>The main loop.</td>
  469. </tr>
  470. </tbody>
  471. </table>
  472. <a id="Terminal_Gui_Application_MdiChildes_" data-uid="Terminal.Gui.Application.MdiChildes*"></a>
  473. <h4 id="Terminal_Gui_Application_MdiChildes" data-uid="Terminal.Gui.Application.MdiChildes">MdiChildes</h4>
  474. <div class="markdown level1 summary">
  475. Gets all the Mdi childes which represent all the not modal <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> from the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_MdiTop">MdiTop</a>.
  476. </div>
  477. <div class="markdown level1 conceptual"></div>
  478. <h5 class="decalaration">Declaration</h5>
  479. <div class="codewrapper">
  480. <pre><code class="lang-csharp hljs">public static List&lt;Toplevel&gt; MdiChildes { get; }</code></pre>
  481. </div>
  482. <h5 class="propertyValue">Property Value</h5>
  483. <table class="table table-bordered table-striped table-condensed">
  484. <thead>
  485. <tr>
  486. <th>Type</th>
  487. <th>Description</th>
  488. </tr>
  489. </thead>
  490. <tbody>
  491. <tr>
  492. <td><span class="xref">System.Collections.Generic.List</span>&lt;<a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a>&gt;</td>
  493. <td></td>
  494. </tr>
  495. </tbody>
  496. </table>
  497. <a id="Terminal_Gui_Application_MdiTop_" data-uid="Terminal.Gui.Application.MdiTop*"></a>
  498. <h4 id="Terminal_Gui_Application_MdiTop" data-uid="Terminal.Gui.Application.MdiTop">MdiTop</h4>
  499. <div class="markdown level1 summary">
  500. The <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> object used for the application on startup which <a class="xref" href="Terminal.Gui.Toplevel.html#Terminal_Gui_Toplevel_IsMdiContainer">IsMdiContainer</a> is true.
  501. </div>
  502. <div class="markdown level1 conceptual"></div>
  503. <h5 class="decalaration">Declaration</h5>
  504. <div class="codewrapper">
  505. <pre><code class="lang-csharp hljs">public static Toplevel MdiTop { get; }</code></pre>
  506. </div>
  507. <h5 class="propertyValue">Property Value</h5>
  508. <table class="table table-bordered table-striped table-condensed">
  509. <thead>
  510. <tr>
  511. <th>Type</th>
  512. <th>Description</th>
  513. </tr>
  514. </thead>
  515. <tbody>
  516. <tr>
  517. <td><a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a></td>
  518. <td></td>
  519. </tr>
  520. </tbody>
  521. </table>
  522. <a id="Terminal_Gui_Application_QuitKey_" data-uid="Terminal.Gui.Application.QuitKey*"></a>
  523. <h4 id="Terminal_Gui_Application_QuitKey" data-uid="Terminal.Gui.Application.QuitKey">QuitKey</h4>
  524. <div class="markdown level1 summary">
  525. Gets or sets the key to quit the application.
  526. </div>
  527. <div class="markdown level1 conceptual"></div>
  528. <h5 class="decalaration">Declaration</h5>
  529. <div class="codewrapper">
  530. <pre><code class="lang-csharp hljs">public static Key QuitKey { get; set; }</code></pre>
  531. </div>
  532. <h5 class="propertyValue">Property Value</h5>
  533. <table class="table table-bordered table-striped table-condensed">
  534. <thead>
  535. <tr>
  536. <th>Type</th>
  537. <th>Description</th>
  538. </tr>
  539. </thead>
  540. <tbody>
  541. <tr>
  542. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  543. <td></td>
  544. </tr>
  545. </tbody>
  546. </table>
  547. <a id="Terminal_Gui_Application_SupportedCultures_" data-uid="Terminal.Gui.Application.SupportedCultures*"></a>
  548. <h4 id="Terminal_Gui_Application_SupportedCultures" data-uid="Terminal.Gui.Application.SupportedCultures">SupportedCultures</h4>
  549. <div class="markdown level1 summary">
  550. Gets all supported cultures by the application without the invariant language.
  551. </div>
  552. <div class="markdown level1 conceptual"></div>
  553. <h5 class="decalaration">Declaration</h5>
  554. <div class="codewrapper">
  555. <pre><code class="lang-csharp hljs">public static List&lt;CultureInfo&gt; SupportedCultures { get; }</code></pre>
  556. </div>
  557. <h5 class="propertyValue">Property Value</h5>
  558. <table class="table table-bordered table-striped table-condensed">
  559. <thead>
  560. <tr>
  561. <th>Type</th>
  562. <th>Description</th>
  563. </tr>
  564. </thead>
  565. <tbody>
  566. <tr>
  567. <td><span class="xref">System.Collections.Generic.List</span>&lt;<span class="xref">System.Globalization.CultureInfo</span>&gt;</td>
  568. <td></td>
  569. </tr>
  570. </tbody>
  571. </table>
  572. <a id="Terminal_Gui_Application_Top_" data-uid="Terminal.Gui.Application.Top*"></a>
  573. <h4 id="Terminal_Gui_Application_Top" data-uid="Terminal.Gui.Application.Top">Top</h4>
  574. <div class="markdown level1 summary">
  575. The <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> object used for the application on startup (<a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Top">Top</a>)
  576. </div>
  577. <div class="markdown level1 conceptual"></div>
  578. <h5 class="decalaration">Declaration</h5>
  579. <div class="codewrapper">
  580. <pre><code class="lang-csharp hljs">public static Toplevel Top { get; }</code></pre>
  581. </div>
  582. <h5 class="propertyValue">Property Value</h5>
  583. <table class="table table-bordered table-striped table-condensed">
  584. <thead>
  585. <tr>
  586. <th>Type</th>
  587. <th>Description</th>
  588. </tr>
  589. </thead>
  590. <tbody>
  591. <tr>
  592. <td><a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a></td>
  593. <td>The top.</td>
  594. </tr>
  595. </tbody>
  596. </table>
  597. <h3 id="methods">Methods
  598. </h3>
  599. <a id="Terminal_Gui_Application_Begin_" data-uid="Terminal.Gui.Application.Begin*"></a>
  600. <h4 id="Terminal_Gui_Application_Begin_Terminal_Gui_Toplevel_" data-uid="Terminal.Gui.Application.Begin(Terminal.Gui.Toplevel)">Begin(Toplevel)</h4>
  601. <div class="markdown level1 summary">
  602. Building block API: Prepares the provided <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> for execution.
  603. </div>
  604. <div class="markdown level1 conceptual"></div>
  605. <h5 class="decalaration">Declaration</h5>
  606. <div class="codewrapper">
  607. <pre><code class="lang-csharp hljs">public static Application.RunState Begin(Toplevel toplevel)</code></pre>
  608. </div>
  609. <h5 class="parameters">Parameters</h5>
  610. <table class="table table-bordered table-striped table-condensed">
  611. <thead>
  612. <tr>
  613. <th>Type</th>
  614. <th>Name</th>
  615. <th>Description</th>
  616. </tr>
  617. </thead>
  618. <tbody>
  619. <tr>
  620. <td><a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a></td>
  621. <td><span class="parametername">toplevel</span></td>
  622. <td>Toplevel to prepare execution for.</td>
  623. </tr>
  624. </tbody>
  625. </table>
  626. <h5 class="returns">Returns</h5>
  627. <table class="table table-bordered table-striped table-condensed">
  628. <thead>
  629. <tr>
  630. <th>Type</th>
  631. <th>Description</th>
  632. </tr>
  633. </thead>
  634. <tbody>
  635. <tr>
  636. <td><a class="xref" href="Terminal.Gui.Application.RunState.html">Application.RunState</a></td>
  637. <td>The runstate handle that needs to be passed to the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_End_Terminal_Gui_Application_RunState_">End(Application.RunState)</a> method upon completion.</td>
  638. </tr>
  639. </tbody>
  640. </table>
  641. <h5 id="Terminal_Gui_Application_Begin_Terminal_Gui_Toplevel__remarks">Remarks</h5>
  642. <div class="markdown level1 remarks">
  643. This method prepares the provided toplevel for running with the focus,
  644. it adds this to the list of toplevels, sets up the mainloop to process the
  645. event, lays out the subviews, focuses the first element, and draws the
  646. toplevel in the screen. This is usually followed by executing
  647. the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_RunLoop_Terminal_Gui_Application_RunState_System_Boolean_">RunLoop(Application.RunState, Boolean)</a> method, and then the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_End_Terminal_Gui_Application_RunState_">End(Application.RunState)</a> method upon termination which will
  648. undo these changes.
  649. </div>
  650. <a id="Terminal_Gui_Application_DoEvents_" data-uid="Terminal.Gui.Application.DoEvents*"></a>
  651. <h4 id="Terminal_Gui_Application_DoEvents" data-uid="Terminal.Gui.Application.DoEvents">DoEvents()</h4>
  652. <div class="markdown level1 summary">
  653. Wakes up the mainloop that might be waiting on input, must be thread safe.
  654. </div>
  655. <div class="markdown level1 conceptual"></div>
  656. <h5 class="decalaration">Declaration</h5>
  657. <div class="codewrapper">
  658. <pre><code class="lang-csharp hljs">public static void DoEvents()</code></pre>
  659. </div>
  660. <a id="Terminal_Gui_Application_End_" data-uid="Terminal.Gui.Application.End*"></a>
  661. <h4 id="Terminal_Gui_Application_End_Terminal_Gui_Application_RunState_" data-uid="Terminal.Gui.Application.End(Terminal.Gui.Application.RunState)">End(Application.RunState)</h4>
  662. <div class="markdown level1 summary">
  663. Building block API: completes the execution of a <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> that was started with <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Begin_Terminal_Gui_Toplevel_">Begin(Toplevel)</a> .
  664. </div>
  665. <div class="markdown level1 conceptual"></div>
  666. <h5 class="decalaration">Declaration</h5>
  667. <div class="codewrapper">
  668. <pre><code class="lang-csharp hljs">public static void End(Application.RunState runState)</code></pre>
  669. </div>
  670. <h5 class="parameters">Parameters</h5>
  671. <table class="table table-bordered table-striped table-condensed">
  672. <thead>
  673. <tr>
  674. <th>Type</th>
  675. <th>Name</th>
  676. <th>Description</th>
  677. </tr>
  678. </thead>
  679. <tbody>
  680. <tr>
  681. <td><a class="xref" href="Terminal.Gui.Application.RunState.html">Application.RunState</a></td>
  682. <td><span class="parametername">runState</span></td>
  683. <td>The runstate returned by the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Begin_Terminal_Gui_Toplevel_">Begin(Toplevel)</a> method.</td>
  684. </tr>
  685. </tbody>
  686. </table>
  687. <a id="Terminal_Gui_Application_EnsuresTopOnFront_" data-uid="Terminal.Gui.Application.EnsuresTopOnFront*"></a>
  688. <h4 id="Terminal_Gui_Application_EnsuresTopOnFront" data-uid="Terminal.Gui.Application.EnsuresTopOnFront">EnsuresTopOnFront()</h4>
  689. <div class="markdown level1 summary">
  690. Ensures that the superview of the most focused view is on front.
  691. </div>
  692. <div class="markdown level1 conceptual"></div>
  693. <h5 class="decalaration">Declaration</h5>
  694. <div class="codewrapper">
  695. <pre><code class="lang-csharp hljs">public static void EnsuresTopOnFront()</code></pre>
  696. </div>
  697. <a id="Terminal_Gui_Application_GrabMouse_" data-uid="Terminal.Gui.Application.GrabMouse*"></a>
  698. <h4 id="Terminal_Gui_Application_GrabMouse_Terminal_Gui_View_" data-uid="Terminal.Gui.Application.GrabMouse(Terminal.Gui.View)">GrabMouse(View)</h4>
  699. <div class="markdown level1 summary">
  700. Grabs the mouse, forcing all mouse events to be routed to the specified view until UngrabMouse is called.
  701. </div>
  702. <div class="markdown level1 conceptual"></div>
  703. <h5 class="decalaration">Declaration</h5>
  704. <div class="codewrapper">
  705. <pre><code class="lang-csharp hljs">public static void GrabMouse(View view)</code></pre>
  706. </div>
  707. <h5 class="parameters">Parameters</h5>
  708. <table class="table table-bordered table-striped table-condensed">
  709. <thead>
  710. <tr>
  711. <th>Type</th>
  712. <th>Name</th>
  713. <th>Description</th>
  714. </tr>
  715. </thead>
  716. <tbody>
  717. <tr>
  718. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  719. <td><span class="parametername">view</span></td>
  720. <td>View that will receive all mouse events until UngrabMouse is invoked.</td>
  721. </tr>
  722. </tbody>
  723. </table>
  724. <a id="Terminal_Gui_Application_Init_" data-uid="Terminal.Gui.Application.Init*"></a>
  725. <h4 id="Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_Terminal_Gui_IMainLoopDriver_" data-uid="Terminal.Gui.Application.Init(Terminal.Gui.ConsoleDriver,Terminal.Gui.IMainLoopDriver)">Init(ConsoleDriver, IMainLoopDriver)</h4>
  726. <div class="markdown level1 summary">
  727. Initializes a new instance of <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a> Application.
  728. </div>
  729. <div class="markdown level1 conceptual"></div>
  730. <h5 class="decalaration">Declaration</h5>
  731. <div class="codewrapper">
  732. <pre><code class="lang-csharp hljs">public static void Init(ConsoleDriver driver = null, IMainLoopDriver mainLoopDriver = null)</code></pre>
  733. </div>
  734. <h5 class="parameters">Parameters</h5>
  735. <table class="table table-bordered table-striped table-condensed">
  736. <thead>
  737. <tr>
  738. <th>Type</th>
  739. <th>Name</th>
  740. <th>Description</th>
  741. </tr>
  742. </thead>
  743. <tbody>
  744. <tr>
  745. <td><a class="xref" href="Terminal.Gui.ConsoleDriver.html">ConsoleDriver</a></td>
  746. <td><span class="parametername">driver</span></td>
  747. <td></td>
  748. </tr>
  749. <tr>
  750. <td><a class="xref" href="Terminal.Gui.IMainLoopDriver.html">IMainLoopDriver</a></td>
  751. <td><span class="parametername">mainLoopDriver</span></td>
  752. <td></td>
  753. </tr>
  754. </tbody>
  755. </table>
  756. <h5 id="Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_Terminal_Gui_IMainLoopDriver__remarks">Remarks</h5>
  757. <div class="markdown level1 remarks">
  758. <p>
  759. Call this method once per instance (or after <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Shutdown">Shutdown()</a> has been called).
  760. </p>
  761. <p>
  762. Loads the right <a class="xref" href="Terminal.Gui.ConsoleDriver.html">ConsoleDriver</a> for the platform.
  763. </p>
  764. <p>
  765. Creates a <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> and assigns it to <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Top">Top</a>
  766. </p>
  767. </div>
  768. <a id="Terminal_Gui_Application_MakeCenteredRect_" data-uid="Terminal.Gui.Application.MakeCenteredRect*"></a>
  769. <h4 id="Terminal_Gui_Application_MakeCenteredRect_Terminal_Gui_Size_" data-uid="Terminal.Gui.Application.MakeCenteredRect(Terminal.Gui.Size)">MakeCenteredRect(Size)</h4>
  770. <div class="markdown level1 summary">
  771. Returns a rectangle that is centered in the screen for the provided size.
  772. </div>
  773. <div class="markdown level1 conceptual"></div>
  774. <h5 class="decalaration">Declaration</h5>
  775. <div class="codewrapper">
  776. <pre><code class="lang-csharp hljs">public static Rect MakeCenteredRect(Size size)</code></pre>
  777. </div>
  778. <h5 class="parameters">Parameters</h5>
  779. <table class="table table-bordered table-striped table-condensed">
  780. <thead>
  781. <tr>
  782. <th>Type</th>
  783. <th>Name</th>
  784. <th>Description</th>
  785. </tr>
  786. </thead>
  787. <tbody>
  788. <tr>
  789. <td><a class="xref" href="Terminal.Gui.Size.html">Size</a></td>
  790. <td><span class="parametername">size</span></td>
  791. <td>Size for the rectangle.</td>
  792. </tr>
  793. </tbody>
  794. </table>
  795. <h5 class="returns">Returns</h5>
  796. <table class="table table-bordered table-striped table-condensed">
  797. <thead>
  798. <tr>
  799. <th>Type</th>
  800. <th>Description</th>
  801. </tr>
  802. </thead>
  803. <tbody>
  804. <tr>
  805. <td><a class="xref" href="Terminal.Gui.Rect.html">Rect</a></td>
  806. <td>The centered rect.</td>
  807. </tr>
  808. </tbody>
  809. </table>
  810. <a id="Terminal_Gui_Application_MoveNext_" data-uid="Terminal.Gui.Application.MoveNext*"></a>
  811. <h4 id="Terminal_Gui_Application_MoveNext" data-uid="Terminal.Gui.Application.MoveNext">MoveNext()</h4>
  812. <div class="markdown level1 summary">
  813. Move to the next Mdi child from the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_MdiTop">MdiTop</a>.
  814. </div>
  815. <div class="markdown level1 conceptual"></div>
  816. <h5 class="decalaration">Declaration</h5>
  817. <div class="codewrapper">
  818. <pre><code class="lang-csharp hljs">public static void MoveNext()</code></pre>
  819. </div>
  820. <a id="Terminal_Gui_Application_MovePrevious_" data-uid="Terminal.Gui.Application.MovePrevious*"></a>
  821. <h4 id="Terminal_Gui_Application_MovePrevious" data-uid="Terminal.Gui.Application.MovePrevious">MovePrevious()</h4>
  822. <div class="markdown level1 summary">
  823. Move to the previous Mdi child from the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_MdiTop">MdiTop</a>.
  824. </div>
  825. <div class="markdown level1 conceptual"></div>
  826. <h5 class="decalaration">Declaration</h5>
  827. <div class="codewrapper">
  828. <pre><code class="lang-csharp hljs">public static void MovePrevious()</code></pre>
  829. </div>
  830. <a id="Terminal_Gui_Application_Refresh_" data-uid="Terminal.Gui.Application.Refresh*"></a>
  831. <h4 id="Terminal_Gui_Application_Refresh" data-uid="Terminal.Gui.Application.Refresh">Refresh()</h4>
  832. <div class="markdown level1 summary">
  833. Triggers a refresh of the entire display.
  834. </div>
  835. <div class="markdown level1 conceptual"></div>
  836. <h5 class="decalaration">Declaration</h5>
  837. <div class="codewrapper">
  838. <pre><code class="lang-csharp hljs">public static void Refresh()</code></pre>
  839. </div>
  840. <a id="Terminal_Gui_Application_RequestStop_" data-uid="Terminal.Gui.Application.RequestStop*"></a>
  841. <h4 id="Terminal_Gui_Application_RequestStop_Terminal_Gui_Toplevel_" data-uid="Terminal.Gui.Application.RequestStop(Terminal.Gui.Toplevel)">RequestStop(Toplevel)</h4>
  842. <div class="markdown level1 summary">
  843. Stops running the most recent <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> or the <code data-dev-comment-type="paramref" class="paramref">top</code> if provided.
  844. </div>
  845. <div class="markdown level1 conceptual"></div>
  846. <h5 class="decalaration">Declaration</h5>
  847. <div class="codewrapper">
  848. <pre><code class="lang-csharp hljs">public static void RequestStop(Toplevel top = null)</code></pre>
  849. </div>
  850. <h5 class="parameters">Parameters</h5>
  851. <table class="table table-bordered table-striped table-condensed">
  852. <thead>
  853. <tr>
  854. <th>Type</th>
  855. <th>Name</th>
  856. <th>Description</th>
  857. </tr>
  858. </thead>
  859. <tbody>
  860. <tr>
  861. <td><a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a></td>
  862. <td><span class="parametername">top</span></td>
  863. <td>The toplevel to request stop.</td>
  864. </tr>
  865. </tbody>
  866. </table>
  867. <h5 id="Terminal_Gui_Application_RequestStop_Terminal_Gui_Toplevel__remarks">Remarks</h5>
  868. <div class="markdown level1 remarks">
  869. <p>
  870. This will cause <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Run_System_Func_System_Exception_System_Boolean__">Run(Func&lt;Exception, Boolean&gt;)</a> to return.
  871. </p>
  872. <p>
  873. Calling <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_RequestStop_Terminal_Gui_Toplevel_">RequestStop(Toplevel)</a> is equivalent to setting the <a class="xref" href="Terminal.Gui.Toplevel.html#Terminal_Gui_Toplevel_Running">Running</a> property on the currently running <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> to false.
  874. </p>
  875. </div>
  876. <a id="Terminal_Gui_Application_Run_" data-uid="Terminal.Gui.Application.Run*"></a>
  877. <h4 id="Terminal_Gui_Application_Run_System_Func_System_Exception_System_Boolean__" data-uid="Terminal.Gui.Application.Run(System.Func{System.Exception,System.Boolean})">Run(Func&lt;Exception, Boolean&gt;)</h4>
  878. <div class="markdown level1 summary">
  879. Runs the application by calling <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Run_Terminal_Gui_Toplevel_System_Func_System_Exception_System_Boolean__">Run(Toplevel, Func&lt;Exception, Boolean&gt;)</a> with the value of <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Top">Top</a>
  880. </div>
  881. <div class="markdown level1 conceptual"></div>
  882. <h5 class="decalaration">Declaration</h5>
  883. <div class="codewrapper">
  884. <pre><code class="lang-csharp hljs">public static void Run(Func&lt;Exception, bool&gt; errorHandler = null)</code></pre>
  885. </div>
  886. <h5 class="parameters">Parameters</h5>
  887. <table class="table table-bordered table-striped table-condensed">
  888. <thead>
  889. <tr>
  890. <th>Type</th>
  891. <th>Name</th>
  892. <th>Description</th>
  893. </tr>
  894. </thead>
  895. <tbody>
  896. <tr>
  897. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Exception</span>, <span class="xref">System.Boolean</span>&gt;</td>
  898. <td><span class="parametername">errorHandler</span></td>
  899. <td></td>
  900. </tr>
  901. </tbody>
  902. </table>
  903. <a id="Terminal_Gui_Application_Run_" data-uid="Terminal.Gui.Application.Run*"></a>
  904. <h4 id="Terminal_Gui_Application_Run_Terminal_Gui_Toplevel_System_Func_System_Exception_System_Boolean__" data-uid="Terminal.Gui.Application.Run(Terminal.Gui.Toplevel,System.Func{System.Exception,System.Boolean})">Run(Toplevel, Func&lt;Exception, Boolean&gt;)</h4>
  905. <div class="markdown level1 summary">
  906. Runs the main loop on the given <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> container.
  907. </div>
  908. <div class="markdown level1 conceptual"></div>
  909. <h5 class="decalaration">Declaration</h5>
  910. <div class="codewrapper">
  911. <pre><code class="lang-csharp hljs">public static void Run(Toplevel view, Func&lt;Exception, bool&gt; errorHandler = null)</code></pre>
  912. </div>
  913. <h5 class="parameters">Parameters</h5>
  914. <table class="table table-bordered table-striped table-condensed">
  915. <thead>
  916. <tr>
  917. <th>Type</th>
  918. <th>Name</th>
  919. <th>Description</th>
  920. </tr>
  921. </thead>
  922. <tbody>
  923. <tr>
  924. <td><a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a></td>
  925. <td><span class="parametername">view</span></td>
  926. <td>The <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a> to run modally.</td>
  927. </tr>
  928. <tr>
  929. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Exception</span>, <span class="xref">System.Boolean</span>&gt;</td>
  930. <td><span class="parametername">errorHandler</span></td>
  931. <td>Handler for any unhandled exceptions (resumes when returns true, rethrows when null).</td>
  932. </tr>
  933. </tbody>
  934. </table>
  935. <h5 id="Terminal_Gui_Application_Run_Terminal_Gui_Toplevel_System_Func_System_Exception_System_Boolean___remarks">Remarks</h5>
  936. <div class="markdown level1 remarks">
  937. <p>
  938. This method is used to start processing events
  939. for the main application, but it is also used to
  940. run other modal <a class="xref" href="Terminal.Gui.View.html">View</a>s such as <a class="xref" href="Terminal.Gui.Dialog.html">Dialog</a> boxes.
  941. </p>
  942. <p>
  943. To make a <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Run_Terminal_Gui_Toplevel_System_Func_System_Exception_System_Boolean__">Run(Toplevel, Func&lt;Exception, Boolean&gt;)</a> stop execution, call <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_RequestStop_Terminal_Gui_Toplevel_">RequestStop(Toplevel)</a>.
  944. </p>
  945. <p>
  946. Calling <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Run_Terminal_Gui_Toplevel_System_Func_System_Exception_System_Boolean__">Run(Toplevel, Func&lt;Exception, Boolean&gt;)</a> is equivalent to calling <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Begin_Terminal_Gui_Toplevel_">Begin(Toplevel)</a>, followed by <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_RunLoop_Terminal_Gui_Application_RunState_System_Boolean_">RunLoop(Application.RunState, Boolean)</a>,
  947. and then calling <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_End_Terminal_Gui_Application_RunState_">End(Application.RunState)</a>.
  948. </p>
  949. <p>
  950. Alternatively, to have a program control the main loop and
  951. process events manually, call <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Begin_Terminal_Gui_Toplevel_">Begin(Toplevel)</a> to set things up manually and then
  952. repeatedly call <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_RunLoop_Terminal_Gui_Application_RunState_System_Boolean_">RunLoop(Application.RunState, Boolean)</a> with the wait parameter set to false. By doing this
  953. the <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_RunLoop_Terminal_Gui_Application_RunState_System_Boolean_">RunLoop(Application.RunState, Boolean)</a> method will only process any pending events, timers, idle handlers and
  954. then return control immediately.
  955. </p>
  956. <p>
  957. When <code data-dev-comment-type="paramref" class="paramref">errorHandler</code> is null the exception is rethrown, when it returns true the application is resumed and when false method exits gracefully.
  958. </p>
  959. </div>
  960. <a id="Terminal_Gui_Application_Run_" data-uid="Terminal.Gui.Application.Run*"></a>
  961. <h4 id="Terminal_Gui_Application_Run__1_System_Func_System_Exception_System_Boolean__" data-uid="Terminal.Gui.Application.Run``1(System.Func{System.Exception,System.Boolean})">Run&lt;T&gt;(Func&lt;Exception, Boolean&gt;)</h4>
  962. <div class="markdown level1 summary">
  963. Runs the application by calling <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Run_Terminal_Gui_Toplevel_System_Func_System_Exception_System_Boolean__">Run(Toplevel, Func&lt;Exception, Boolean&gt;)</a> with a new instance of the specified <a class="xref" href="Terminal.Gui.Toplevel.html">Toplevel</a>-derived class
  964. </div>
  965. <div class="markdown level1 conceptual"></div>
  966. <h5 class="decalaration">Declaration</h5>
  967. <div class="codewrapper">
  968. <pre><code class="lang-csharp hljs">public static void Run&lt;T&gt;(Func&lt;Exception, bool&gt; errorHandler = null)
  969. where T : Toplevel, new()</code></pre>
  970. </div>
  971. <h5 class="parameters">Parameters</h5>
  972. <table class="table table-bordered table-striped table-condensed">
  973. <thead>
  974. <tr>
  975. <th>Type</th>
  976. <th>Name</th>
  977. <th>Description</th>
  978. </tr>
  979. </thead>
  980. <tbody>
  981. <tr>
  982. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Exception</span>, <span class="xref">System.Boolean</span>&gt;</td>
  983. <td><span class="parametername">errorHandler</span></td>
  984. <td></td>
  985. </tr>
  986. </tbody>
  987. </table>
  988. <h5 class="typeParameters">Type Parameters</h5>
  989. <table class="table table-bordered table-striped table-condensed">
  990. <thead>
  991. <tr>
  992. <th>Name</th>
  993. <th>Description</th>
  994. </tr>
  995. </thead>
  996. <tbody>
  997. <tr>
  998. <td><span class="parametername">T</span></td>
  999. <td></td>
  1000. </tr>
  1001. </tbody>
  1002. </table>
  1003. <a id="Terminal_Gui_Application_RunLoop_" data-uid="Terminal.Gui.Application.RunLoop*"></a>
  1004. <h4 id="Terminal_Gui_Application_RunLoop_Terminal_Gui_Application_RunState_System_Boolean_" data-uid="Terminal.Gui.Application.RunLoop(Terminal.Gui.Application.RunState,System.Boolean)">RunLoop(Application.RunState, Boolean)</h4>
  1005. <div class="markdown level1 summary">
  1006. Building block API: Runs the main loop for the created dialog
  1007. </div>
  1008. <div class="markdown level1 conceptual"></div>
  1009. <h5 class="decalaration">Declaration</h5>
  1010. <div class="codewrapper">
  1011. <pre><code class="lang-csharp hljs">public static void RunLoop(Application.RunState state, bool wait = true)</code></pre>
  1012. </div>
  1013. <h5 class="parameters">Parameters</h5>
  1014. <table class="table table-bordered table-striped table-condensed">
  1015. <thead>
  1016. <tr>
  1017. <th>Type</th>
  1018. <th>Name</th>
  1019. <th>Description</th>
  1020. </tr>
  1021. </thead>
  1022. <tbody>
  1023. <tr>
  1024. <td><a class="xref" href="Terminal.Gui.Application.RunState.html">Application.RunState</a></td>
  1025. <td><span class="parametername">state</span></td>
  1026. <td>The state returned by the Begin method.</td>
  1027. </tr>
  1028. <tr>
  1029. <td><span class="xref">System.Boolean</span></td>
  1030. <td><span class="parametername">wait</span></td>
  1031. <td>By default this is true which will execute the runloop waiting for events, if you pass false, you can use this method to run a single iteration of the events.</td>
  1032. </tr>
  1033. </tbody>
  1034. </table>
  1035. <h5 id="Terminal_Gui_Application_RunLoop_Terminal_Gui_Application_RunState_System_Boolean__remarks">Remarks</h5>
  1036. <div class="markdown level1 remarks">
  1037. Use the wait parameter to control whether this is a
  1038. blocking or non-blocking call.
  1039. </div>
  1040. <a id="Terminal_Gui_Application_Shutdown_" data-uid="Terminal.Gui.Application.Shutdown*"></a>
  1041. <h4 id="Terminal_Gui_Application_Shutdown" data-uid="Terminal.Gui.Application.Shutdown">Shutdown()</h4>
  1042. <div class="markdown level1 summary">
  1043. Shutdown an application initialized with <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_Terminal_Gui_IMainLoopDriver_">Init(ConsoleDriver, IMainLoopDriver)</a>
  1044. </div>
  1045. <div class="markdown level1 conceptual"></div>
  1046. <h5 class="decalaration">Declaration</h5>
  1047. <div class="codewrapper">
  1048. <pre><code class="lang-csharp hljs">public static void Shutdown()</code></pre>
  1049. </div>
  1050. <a id="Terminal_Gui_Application_UngrabMouse_" data-uid="Terminal.Gui.Application.UngrabMouse*"></a>
  1051. <h4 id="Terminal_Gui_Application_UngrabMouse" data-uid="Terminal.Gui.Application.UngrabMouse">UngrabMouse()</h4>
  1052. <div class="markdown level1 summary">
  1053. Releases the mouse grab, so mouse events will be routed to the view on which the mouse is.
  1054. </div>
  1055. <div class="markdown level1 conceptual"></div>
  1056. <h5 class="decalaration">Declaration</h5>
  1057. <div class="codewrapper">
  1058. <pre><code class="lang-csharp hljs">public static void UngrabMouse()</code></pre>
  1059. </div>
  1060. </article>
  1061. </div>
  1062. <div class="hidden-sm col-md-2" role="complementary">
  1063. <div class="sideaffix">
  1064. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  1065. <h5>In This Article</h5>
  1066. <div></div>
  1067. </nav>
  1068. </div>
  1069. </div>
  1070. </div>
  1071. </div>
  1072. <footer>
  1073. <div class="grad-bottom"></div>
  1074. <div class="footer">
  1075. <div class="container">
  1076. <span class="pull-right">
  1077. <a href="#top">Back to top</a>
  1078. </span>
  1079. <span>Generated by <strong>DocFX</strong></span>
  1080. </div>
  1081. </div>
  1082. </footer>
  1083. </div>
  1084. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  1085. <script type="text/javascript" src="../../styles/docfx.js"></script>
  1086. <script type="text/javascript" src="../../styles/main.js"></script>
  1087. </body>
  1088. </html>