From: MENON Jean-Francois Date: 2002-04-15T17:03:30+09:00 Subject: Re: button_configs in TkDialog Adam VanderHook wrote: > > Sorry if this has been asked before. I've been all over the archives > and Google to no avail. > > I have created a TkDialog box to be used for rating a song. There are > five different rating options, and a cancel button. I've created the > TkDialog just fine, but am having trouble configuring the buttons to do > specific things. I took a look at tkdialog.rb and it helped somewhat, > but I know I'm just not understanding it fully. (btw, I'm using Ruby > 1.6.7) > > Here is what I have for the dialog: > > dlgAbout = TkDialog.new( > { > 'title' => 'About TkMserv', > 'message' => "TkMserv\nby: Adam VanderHook\nacidos@users.sf.net\nhttp://www.capcol.edu/student/avanderhook/", > 'buttons' => 'OK', > 'button_configs' => proc { puts "Superb", puts "Good" } > } > ) > > My thought being clicking on the first button would print "Superb" to > stdout, second button puts "Good", etc, but it still isn't working. I > get no parse errors and it doesn't complain at run time. Any ideas? > > Adam > > -- > Adam VanderHook > acidos@users.sourceforge.net > http://www.capcol.edu/student/avanderhook/ hello, here is a solution that I use : require 'tk' reply = Tk::messageBox ( 'icon'=> 'warning', 'title' => 'About TkMserv', 'message' => "TkMserv\nby: Adam VanderHook\nacidos@users.sf.net\nhttp://www.capcol.edu/student/avanderhook/", 'type'=>'okcancel') puts reply Tk.mainloop jf -- _________________________________ / Do you play go? \ \ http://www.multimania.com/cdlib / --------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||