From d1bc9d62fa640bd2f123661d23ed9fb607dbd8e7 Mon Sep 17 00:00:00 2001 From: mlncn Date: Sat, 1 May 2021 12:48:32 -0400 Subject: [PATCH] Start a file for refactoring prompts to bypass zenipy, use Gtk --- prompt_window.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 prompt_window.py diff --git a/prompt_window.py b/prompt_window.py new file mode 100644 index 0000000..cd7a13c --- /dev/null +++ b/prompt_window.py @@ -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()