[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby gtk dialog

Luke Worth

7/14/2005 4:23:00 PM

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? currently i can click my
life away and the dialog will sit there staring at me like i'm some kind
of weirdo.
bye, thanks in advance
--
Luke Worth




1 Answer

Luke Worth

7/15/2005 12:10:00 AM

0

sorry for double post, i'm not sure what happened last night but my
brain must have been fried

--
Luke Worth