Last active
August 29, 2015 14:05
-
-
Save firstspring1845/f08128e18dda92da355e to your computer and use it in GitHub Desktop.
mikutterで名前変えるやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
Plugin.create :change_name do | |
command(:change_name, | |
name: '名前変更', | |
condition: lambda{|opt|true}, | |
visible: false, | |
role: :window) do |opt| | |
d = Gtk::Dialog.new('名前変更') | |
l = Gtk::Label.new('名前を入れてEnter押してね') | |
e = Gtk::Entry.new | |
e.signal_connect('activate') do |w, r| | |
(Service.primary.twitter/:account/:update_profile).json(:name => w.text).next do |u| | |
activity :system, "名前を#{u[:name]}に変更しました" | |
end | |
d.destroy | |
end | |
d.vbox.pack_start(l, true, true, 0) | |
d.vbox.pack_start(e, true, true, 0) | |
d.show_all | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment