Hi There

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

Hi,

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

Go ahead :slight_smile:

Mathieu B.

2008/8/23 hendra kusuma [email protected]valid:

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 :slight_smile:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs