= PyGTK = 適当メモ.主に日記からの転載. == !TextView == {{{ #!python textField = gtk.TextView() textBuffer = textField.get_buffer() [startIter, endIter] = textBuffer.get_bounds() # [最初の位置, 最後の位置] print textBuffer.get_text(startIter, endIter) }}} * 最初の位置と最後の位置を取得し,中の文字列を得る == ある処理を x 秒後に裏で実行 == {{{ #!python def __init__(self): self.id = gtk.timeout_add(1000, self.run) def run(self): ... # process return True def stop(self): if self.id: gtk.timeout_remove(self.id) }}} * run が True を返し続ける限りは繰り返し実行される.False が返ると止まる. == ×ボタンが押された時にウィジェットを破壊せずに hide する == {{{ #!python window = gtk.Widnow(gtk.WINDOW_TOPLEVEL) window.connect("delete-event", close) open(window) def close(w): w.hide() return True def open(w): w.show() }}} 注意点は以下の通り. * destroy イベントでなく delete-event をフックする * close メソッドで True を返す