
def cb_help(code)
    text=$lang.help(code)
    text=$lang.message("102") unless text
    dialog=HelpDialog::new(text)
    dialog.run
    dialog.destroy
end

class HelpDialog < Gtk::Dialog
    def initialize(text)
	super("Rechercher une expression",
              $main_window,
              Gtk::Dialog::DESTROY_WITH_PARENT
             )
	ok_button=add_button(Gtk::Stock::OK,Gtk::Dialog::RESPONSE_OK)
        accel_group=Gtk::AccelGroup::new
        add_accel_group(accel_group)
        ok_button.add_accelerator('clicked',accel_group,Gdk::Keyval::GDK_Escape,0,0)
        ok_button.add_accelerator('clicked',accel_group,Gdk::Keyval::GDK_Return,0,0)
	hbox=Gtk::HBox::new(false,0)
        vbox.pack_start(hbox)
        img=Gtk::Image::new(Gtk::Stock::DIALOG_INFO,Gtk::IconSize::DIALOG)
        hbox.pack_start(img,false,false,0)
	scrolled_window=Gtk::ScrolledWindow::new(nil,nil)
	scrolled_window.hscrollbar_policy=Gtk::PolicyType::AUTOMATIC
	scrolled_window.vscrollbar_policy=Gtk::PolicyType::AUTOMATIC
        textview=Gtk::TextView::new
	textview.wrap_mode=Gtk::TextTag::WRAP_WORD
	textview.buffer.text=text
	scrolled_window.add(textview)
        hbox.pack_start(scrolled_window,true,true,0)
	width,height=$main_window.size
	resize(width/2,height/2)
	hbox.show_all
    end
end
