966: def ask_for_find_term
967: dialog = Dialog.new(
968: "Find a node matching regex in tree.",
969: nil, nil,
970: [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
971: [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
972: )
973: hbox = HBox.new(false, 5)
974:
975: hbox.add(Label.new("Regex:"))
976: hbox.pack_start(regex_input = Entry.new)
977: regex_input.text = @regex || ''
978:
979: dialog.vbox.add(hbox)
980:
981: dialog.signal_connect('key-press-event''key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
982: dialog.show_all
983: self.focus = dialog
984: dialog.run do |response|
985: if response == Dialog::RESPONSE_ACCEPT
986: return @regex = regex_input.text
987: end
988: end
989: return
990: ensure
991: dialog.destroy if dialog
992: end