# Hi There

**URL:** <https://www.ruby-forum.com/t/hi-there/146619>\
**Category:** Ruby-Gnome 2\
**Created:** [August 23, 2008, 3:51am UTC](https://www.ruby-forum.com/t/hi-there/146619 "2008-08-23T03:51:28Z")\
**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:** [August 23, 2008, 3:51am UTC](https://www.ruby-forum.com/t/hi-there/146619/1 "2008-08-23T03:51:28Z")

</div>

Hi there

I’m new member of this mailing-list  
Is this milist for asking about program-development using ruby-gnome2  
or for developing ruby-gnome2?  
Since I have some questions to ask about  
And I don’t wanna to bother you if I’m joining the wrong milist

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:** [August 23, 2008, 5:29am UTC](https://www.ruby-forum.com/t/hi-there/146619/2 "2008-08-23T05:29:05Z")

</div>

Hi,

The mailing-list is a little bit for both, with more user questions  
though.

Go ahead 🙂

Mathieu B.

2008/8/23 hendra kusuma [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<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:** [August 23, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/hi-there/146619/3 "2008-08-23T15:48:37Z")

</div>

OK then,

Let me start with something we used to do alot (but I failed to figure  
out how to do it)

How exacly we call a messagedialog from another Window  
for example I have a window with a button  
when I clicked the button,  
it display a messagedialog as a modal form  
and when I press the ok button at the messagedialog, it close

my code goes this far then I got lost 🙂

require ‘libglade2’  
class Win1  
include GetText

attr :glade  
PROG\_PATH = “win1.glade”  
PROG\_NAME = “YOUR\_APPLICATION\_NAME”

def initialize  
call(PROG\_PATH, nil, PROG\_NAME)  
end

def call(path\_or\_data, root = nil, domain = nil, localedir = nil,  
flag = GladeXML::FILE)  
bindtextdomain(domain, localedir, nil, “UTF-8”)  
@glade = GladeXML.new(path\_or\_data, root, domain, localedir, flag)  
{|handler| method(handler)}  
@messagedialog1 = @glade.get\_widget(“messagedialog1”)  
#GtkMessageDialog  
@dialog\_vbox1 = @glade.get\_widget(“dialog\_vbox1”) #GtkVBox  
@dialog\_action\_area1 = @glade.get\_widget(“dialog\_action\_area1”)  
#GtkHButtonBox  
@window1 = @glade.get\_widget(“window1”) #GtkWindow  
@button1 = @glade.get\_widget(“button1”) #GtkButton  
end

def on\_button1\_clicked() #button1(on\_button1\_clicked)  
#What should I type here???  
end

def showMessagedialog1 #procedure to show  
messagedialog1(GtkMessageDialog)  
#and here???  
end

def showWindow1 #procedure to show window1(GtkWindow)  
@window1.show  
Gtk.main  
end

end

a = Win1.new  
a.showWindow1

* * *

the glade file looks like this :

\<?xml version="1.0" encoding="UTF-8" standalone="no"?\> 5 False GTK\_WIN\_POS\_CENTER\_ON\_PARENT GDK\_WINDOW\_TYPE\_HINT\_DIALOG True False GTK\_MESSAGE\_ERROR GTK\_BUTTONS\_OK True 2 True GTK\_BUTTONBOX\_END False GTK\_PACK\_END True True True button 0
