# How to make Window run cli, disable until command finish, then 	re-enable?

**URL:** <https://www.ruby-forum.com/t/how-to-make-window-run-cli-disable-until-command-finish-then-re-enable/176204>\
**Category:** wxRuby\
**Created:** [September 26, 2009, 11:30am UTC](https://www.ruby-forum.com/t/how-to-make-window-run-cli-disable-until-command-finish-then-re-enable/176204 "2009-09-26T11:30:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [September 26, 2009, 11:30am UTC](https://www.ruby-forum.com/t/how-to-make-window-run-cli-disable-until-command-finish-then-re-enable/176204/1 "2009-09-26T11:30:22Z")

</div>

Dear all,

confused with the subject? me too

I plan to create my own gui for avg for Linux (on ver 8.5, they only  
provide  
cli)  
my plan is, when I press button, it will run command line (plan to use  
puts  
`some command here`)  
but when the command is running, my window must not be able to receive  
input  
until it finish  
how can I achieve such behaviour?

Thank you  
Regards  
Hendra

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [September 26, 2009, 9:42pm UTC](https://www.ruby-forum.com/t/how-to-make-window-run-cli-disable-until-command-finish-then-re-enable/176204/2 "2009-09-26T21:42:36Z")

</div>

Heya Hendra,

Take a look at this code, should do what you want:

[Taken from examples/dialogs/dialogs.rb]  
WindowDisabler.disable(self) do  
info = BusyInfo.busy(“Working, please wait…”, self) do

```
    for i in 0 ... 18
      Wx::get_app.yield()
    end
    sleep(2)
  end
end
```

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [September 29, 2009, 5:53am UTC](https://www.ruby-forum.com/t/how-to-make-window-run-cli-disable-until-command-finish-then-re-enable/176204/3 "2009-09-29T05:53:40Z")

</div>

wow, we got everything in example directory 🙂  
Thank you
