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 = "" task = ""
Gtk.Window.__init__(self, title="Pomodoro Prompt") Gtk.Window.__init__(self, title="Pomodoro Prompt")
self.set_size_request(400, 100) self.set_size_request(500, 100)
self.set_border_width(10)
self.timeout_id = None
self.entry = Gtk.Entry() self.entry = Gtk.Entry()
self.entry.set_text(task) self.entry.set_text(task)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6) self.entry.connect("activate", self.save)
self.add(vbox)
vbox.pack_start(self.entry, True, True, 0) self.add(self.entry)
self.set_border_width(5)
# self.set_title("Entry") # self.set_title("Entry")
self.connect("destroy", Gtk.main_quit) self.connect("destroy", Gtk.main_quit)
def on_key_release(self, widget, event): def save(self, entry):
self.label.set_text(widget.get_text()) 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") win = PromptWindow(task="Making money")