Here we can actually retrieve what is written on enter

This commit is contained in:
mlncn 2021-05-01 13:13:12 -04:00
parent d1bc9d62fa
commit 0def577866

View file

@ -12,25 +12,25 @@ class PromptWindow(Gtk.Window):
task = ""
Gtk.Window.__init__(self, title="Pomodoro Prompt")
self.set_size_request(400, 100)
self.timeout_id = None
self.set_size_request(500, 100)
self.set_border_width(10)
self.entry = Gtk.Entry()
self.entry.set_text(task)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
self.add(vbox)
self.entry.connect("activate", self.save)
vbox.pack_start(self.entry, True, True, 0)
self.add(self.entry)
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())
def save(self, entry):
task = entry.get_text()
print(task)
# A little concerned this might be sort of the nuclear option here.
Gtk.main_quit()
win = PromptWindow(task="Making money")