pomodoroprompt/prompt_window.py

39 lines
845 B
Python
Raw Normal View History

#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib
class PromptWindow(Gtk.Window):
def __init__(self, task=None):
if task is None:
task = ""
Gtk.Window.__init__(self, title="Pomodoro Prompt")
self.set_size_request(400, 100)
self.timeout_id = None
self.entry = Gtk.Entry()
self.entry.set_text(task)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
self.add(vbox)
vbox.pack_start(self.entry, True, True, 0)
self.set_border_width(5)
# self.set_title("Entry")
self.connect("destroy", Gtk.main_quit)
def on_key_release(self, widget, event):
self.label.set_text(widget.get_text())
win = PromptWindow(task="Making money")
win.show_all()
Gtk.main()