|
@@ -572,17 +572,14 @@ namespace Terminal.Gui {
|
|
|
|
|
|
public void Run (Action action)
|
|
public void Run (Action action)
|
|
{
|
|
{
|
|
- if (action == null)
|
|
|
|
|
|
+ if (action == null || host == null)
|
|
return;
|
|
return;
|
|
|
|
|
|
Application.UngrabMouse ();
|
|
Application.UngrabMouse ();
|
|
host.CloseAllMenus ();
|
|
host.CloseAllMenus ();
|
|
Application.Refresh ();
|
|
Application.Refresh ();
|
|
|
|
|
|
- Application.MainLoop.AddIdle (() => {
|
|
|
|
- action ();
|
|
|
|
- return false;
|
|
|
|
- });
|
|
|
|
|
|
+ host.Run (action);
|
|
}
|
|
}
|
|
|
|
|
|
public override bool OnLeave (View view)
|
|
public override bool OnLeave (View view)
|
|
@@ -1130,7 +1127,11 @@ namespace Terminal.Gui {
|
|
Application.UngrabMouse ();
|
|
Application.UngrabMouse ();
|
|
CloseAllMenus ();
|
|
CloseAllMenus ();
|
|
Application.Refresh ();
|
|
Application.Refresh ();
|
|
|
|
+ Run (action);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ internal void Run (Action action)
|
|
|
|
+ {
|
|
Application.MainLoop.AddIdle (() => {
|
|
Application.MainLoop.AddIdle (() => {
|
|
action ();
|
|
action ();
|
|
return false;
|
|
return false;
|
|
@@ -1667,10 +1668,7 @@ namespace Terminal.Gui {
|
|
if (mi.IsEnabled ()) {
|
|
if (mi.IsEnabled ()) {
|
|
var action = mi.Action;
|
|
var action = mi.Action;
|
|
if (action != null) {
|
|
if (action != null) {
|
|
- Application.MainLoop.AddIdle (() => {
|
|
|
|
- action ();
|
|
|
|
- return false;
|
|
|
|
- });
|
|
|
|
|
|
+ Run (action);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
@@ -1706,10 +1704,7 @@ namespace Terminal.Gui {
|
|
if (mi.IsEnabled ()) {
|
|
if (mi.IsEnabled ()) {
|
|
var action = mi.Action;
|
|
var action = mi.Action;
|
|
if (action != null) {
|
|
if (action != null) {
|
|
- Application.MainLoop.AddIdle (() => {
|
|
|
|
- action ();
|
|
|
|
- return false;
|
|
|
|
- });
|
|
|
|
|
|
+ Run (action);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|