Skip to content

Instantly share code, notes, and snippets.

@sh4869
Created March 25, 2014 15:49
Show Gist options
  • Save sh4869/9764734 to your computer and use it in GitHub Desktop.
Save sh4869/9764734 to your computer and use it in GitHub Desktop.
i# -*- coding: utf-8 -*-
Plugin.create(:mikutter_sintyoku) do
on_appear do |ms|
ms.each do |m|
if m.message.to_s =~ /進捗どうですか/
to_name = m.user.idname
dialog = Gtk::Dialog.new("進捗どうですか",
$main_application_window,
Gtk::Dialog::DESTROY_WITH_PARENT,
[ Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK ],
[ Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL ])
dialog.vbox.add(Gtk::Label.new("進捗の情況を入力しよう"))
input_box = Gtk::Entry.new
dialog.vbox.add(input_box)
dialog.show_all
result = dialog.run
str = nil
if result == Gtk::Dialog::RESPONSE_OK
str = input_box.text
f = 1
end
dialog.destroy
if f == 1
Service.primary.post(:message => to_name + "さんへ 進捗は#{str}です" )
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment