Start a file for refactoring prompts to bypass zenipy, use Gtk

This commit is contained in:
mlncn 2021-05-01 12:48:32 -04:00
parent 382fb4d79a
commit d1bc9d62fa

38
prompt_window.py Normal file
View file

@ -0,0 +1,38 @@
#!/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()