Ruby gtk dialog

Hi. I'm writing this just as i'm about to implode - (really really
tired)

ok basically, I have a Gtk::TreeView which is nicely displaying a tree
for me. I want to be able to edit the data in each row. The way thought
of doing this was to use a Gtk::Dialog with an editable TextView. This
is because i need it to edit multiple line text.

Now, I can't for the life of me figure out how to use this thing;

    def edit_row
      dialog = Gtk::Dialog.new('Edit', @window['window'],
                               Gtk::Dialog::MODAL | Gtk::Dialog::DESTROY_WITH_PARENT,
                               [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_ACCEPT],
                               [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_REJECT])
      text_buffer = Gtk::TextBuffer.new
      text_view = Gtk::TextView.new(text_buffer)
      text_view.visible = true

      dialog.vbox.add(text_view)
      dialog.run do |response|
        if response == Gtk::Dialog::RESPONSE_ACCEPT
          puts text_buffer.text
        end
      end
    end

and when i run my program, i get a dialog with a nice text field with 2
completely useless buttons at the bottom labelled ok and cancel. How do
i make these buttons actually do something?

···

--
Luke Worth

Sorry, it needed dialog.destroy.
never mind (tiredness is bad)

···

      dialog.run do |response|
        if response == Gtk::Dialog::RESPONSE_ACCEPT
          puts text_buffer.text
        end
      end
    end

--
Luke Worth