# Pop up window

**URL:** <https://www.ruby-forum.com/t/pop-up-window/229331>\
**Category:** Ruby-Gnome 2\
**Created:** [January 14, 2013, 6:35pm UTC](https://www.ruby-forum.com/t/pop-up-window/229331 "2013-01-14T18:35:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 14, 2013, 6:35pm UTC](https://www.ruby-forum.com/t/pop-up-window/229331/1 "2013-01-14T18:35:08Z")

</div>

Im trying to make something that when you first open the program it asks  
you which one you want to choose. Then you once you click on the button  
it opens up that program. how do i do this?

---

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 17, 2013, 10:20pm UTC](https://www.ruby-forum.com/t/pop-up-window/229331/2 "2013-01-17T22:20:29Z")

</div>

> gem install Ruiby

> ruiby button(~Hello Mr Nussbaum~) do exit!(0) end

---

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 17, 2013, 10:57pm UTC](https://www.ruby-forum.com/t/pop-up-window/229331/3 "2013-01-17T22:57:36Z")

</div>

(…continue)

> ruiby -width 300 -height 200   
> "l=list(~File~); l.set\_data(Dir.glob ~_._~);   
> buttoni(‘Validation’) {puts l.selection;exit!(0)} "

Or for startup un ruby script :

require ‘Ruiby’

def script(choice=“?”)  
p choice  
end

Ruiby.app(:width=\> 300, :height=\>200, :title=\> “Hello”) do stack do  
l=list(“Files…”)  
l.set\_data(Dir.glob “_._”)  
buttoni(‘Validation’) { script(l.selection) ; exit!(0)}  
end end

For the last one, You can do that with (green) shoes too

Regards,

---

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 18, 2013, 2:24am UTC](https://www.ruby-forum.com/t/pop-up-window/229331/4 "2013-01-18T02:24:52Z")

</div>

do you know how to do it in visual ruby?

---

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 19, 2013, 9:40pm UTC](https://www.ruby-forum.com/t/pop-up-window/229331/5 "2013-01-19T21:40:28Z")

</div>

Hi:

I would encourage you to watch the videos at:

> **[hi合乐888在线登录 - hi合乐手机网页版](http://www.visualruby.net/)**
>
> ♠欢迎点击hi合乐888在线登录,hi合乐手机网页版早就成为了世界性的强大娱乐平台,hi合乐888在线登录提供最新、最好玩、最全的单机游戏中文版下载、资讯、攻略、补丁,致力成为行业风向标。

Also, you can read the tutorials.

The basic things you would need to do are:

1. create a new project. This will create a “Hello World” app to start  
with.

2. Right click on the “MyClass.rb” file to edit the glade file.

3. Delete the label that says “Hello World” and replace it with a vbox  
with one cell. Keep the name “vbox1”

4. You code will look something like this:

def show()  
load\_glade( **FILE** )  
@view = VR::ListView.new(:filename =\> String)  
Dir.glob(“\*”).each do |fn|  
@view.add\_row(fn)  
end  
@builder[“vbox1”].add(@view)  
show\_window()  
end

If you add a button named “button1” you could write a handler:

def button1\_\_clicked(\*args)  
#open file here  
end

Or you can use the selection method from the listview:

def view\_\_row\_activated(\*args)  
#open file here  
end

Again, read the tutorials and watch the videos. It will be easy then.

Good luck,  
Eric

---

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 22, 2013, 5:06pm UTC](https://www.ruby-forum.com/t/pop-up-window/229331/6 "2013-01-22T17:06:24Z")

</div>

okay thank you very much! what is the difference in (\*argv) and (\*args)?

---

<div class="post-metadata">

**Author:** ![cbnewman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@cbnewman](https://www.ruby-forum.com/u/cbnewman)\
**Post date:** [January 27, 2013, 7:37am UTC](https://www.ruby-forum.com/t/pop-up-window/229331/7 "2013-01-27T07:37:52Z")

</div>

\*argv and \*args are exactly the same. They’re just a variable name.  
You could just as easily use \*var1 or \*x.
