#!/usr/bin/env python
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import Gtk
tree_view = Gtk.TreeView()
tree_view.set_headers_visible(False)
store = Gtk.ListStore(str)
store.append(("abc",))
store.append(("def",))
store.append(("ghi",))
tree_view.set_model(store)
tree_view.set_enable_search(True)
tree_view.set_search_column(0)
def search_equals(store, column, key, itr, data):
    return not store.get_value(itr, 0).startswith(key)
tree_view.set_search_equal_func(search_equals, None)
renderer = Gtk.CellRendererText()
column = Gtk.TreeViewColumn("", renderer, text=0)
tree_view.append_column(column)
window = Gtk.Window()
window.connect("delete-event", Gtk.main_quit)
window.set_position(Gtk.WindowPosition.CENTER)
window.set_default_size(200, 100)
window.add(tree_view)
window.show_all()
Gtk.main()
