Skip to content

Instantly share code, notes, and snippets.

@rhenium
Created February 15, 2014 08:15
Show Gist options
  • Save rhenium/9016048 to your computer and use it in GitHub Desktop.
Save rhenium/9016048 to your computer and use it in GitHub Desktop.
mikutter のライセンスに準じます
Plugin.create :filter_track do
querybox = ::Gtk::Entry.new()
querycont = ::Gtk::VBox.new(false, 0)
searchbtn = ::Gtk::Button.new(_('検索'))
querycont.
closeup(::Gtk::HBox.new(false, 0).
pack_start(querybox).
closeup(searchbtn))
tab(:filter_track, _("フィルター")) do
set_icon Skin.get("search.png")
shrink
nativewidget querycont
expand
timeline :filter_track
end
searchbtn.signal_connect('clicked'){ |elm|
filter_filter_stream_track {|str|
[querybox.text.to_s] }
Plugin.call(:filter_stream_force_retry)
ss = querybox.text.split(",")
on_appear do |messages|
messages.each {|message|
timeline(:filter_track) << message if ss.any? {|s| message.to_s.include?(s) } } end }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment