With i3 use separate windows again.
This commit is contained in:
parent
7c4e488d1c
commit
c326f335ed
|
|
@ -46,7 +46,7 @@ _log.info('Starting with JOY_HOME=%s', JOY_HOME)
|
||||||
|
|
||||||
# Now that logging is set up, continue loading the system.
|
# Now that logging is set up, continue loading the system.
|
||||||
|
|
||||||
from joy.gui.textwidget import TextViewerWidget, tk, get_font, make_main_window
|
from joy.gui.textwidget import TextViewerWidget, tk, get_font
|
||||||
from joy.gui.world import StackDisplayWorld
|
from joy.gui.world import StackDisplayWorld
|
||||||
from joy.library import initialize, DefinitionWrapper
|
from joy.library import initialize, DefinitionWrapper
|
||||||
from joy.utils.stack import stack_to_string
|
from joy.utils.stack import stack_to_string
|
||||||
|
|
@ -116,8 +116,8 @@ def commands():
|
||||||
|
|
||||||
|
|
||||||
def show_log(*args):
|
def show_log(*args):
|
||||||
# log_window.wm_deiconify()
|
log_window.wm_deiconify()
|
||||||
# log_window.update()
|
log_window.update()
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -144,7 +144,14 @@ DefinitionWrapper.load_definitions(DEFS_FN, D)
|
||||||
|
|
||||||
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
|
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
|
||||||
|
|
||||||
top, t, log = make_main_window(world)
|
t = TextViewerWidget(world, **VIEWER_DEFAULTS)
|
||||||
|
|
||||||
|
log_window = tk.Toplevel()
|
||||||
|
# Make it so that you can't actually close the log window, if you try it
|
||||||
|
# will just "withdraw" (which is like minifying but without a entry in
|
||||||
|
# the taskbar or icon or whatever.)
|
||||||
|
log_window.protocol("WM_DELETE_WINDOW", log_window.withdraw)
|
||||||
|
log = TextViewerWidget(world, log_window, **VIEWER_DEFAULTS)
|
||||||
|
|
||||||
FONT = get_font('Iosevka', size=14) # Requires Tk root already set up.
|
FONT = get_font('Iosevka', size=14) # Requires Tk root already set up.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -426,6 +426,7 @@ class TextViewerWidget(tk.Text, MouseBindingsMixin, SavingMixin):
|
||||||
return 'break'
|
return 'break'
|
||||||
|
|
||||||
def init(self, title, filename, repo_relative_filename, repo, font):
|
def init(self, title, filename, repo_relative_filename, repo, font):
|
||||||
|
self.set_window_title(title)
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
|
@ -433,6 +434,7 @@ class TextViewerWidget(tk.Text, MouseBindingsMixin, SavingMixin):
|
||||||
# Prevent this from triggering a git commit.
|
# Prevent this from triggering a git commit.
|
||||||
self.update()
|
self.update()
|
||||||
self._cancelSave()
|
self._cancelSave()
|
||||||
|
self.pack(expand=True, fill=tk.BOTH)
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.repo_relative_filename = repo_relative_filename
|
self.repo_relative_filename = repo_relative_filename
|
||||||
self.repo = repo
|
self.repo = repo
|
||||||
|
|
@ -470,15 +472,3 @@ class TextViewerWidget(tk.Text, MouseBindingsMixin, SavingMixin):
|
||||||
|
|
||||||
T.pack(expand=1, fill=tk.BOTH)
|
T.pack(expand=1, fill=tk.BOTH)
|
||||||
T.see(tk.END)
|
T.see(tk.END)
|
||||||
|
|
||||||
|
|
||||||
def make_main_window(world):
|
|
||||||
m = tk.PanedWindow(orient=tk.HORIZONTAL)
|
|
||||||
m.winfo_toplevel().title('Thun')
|
|
||||||
m.pack(fill=tk.BOTH, expand=True)
|
|
||||||
H = 45
|
|
||||||
t = TextViewerWidget(world, m, width=128, height=H)
|
|
||||||
log = TextViewerWidget(world, m, width=73, height=H)
|
|
||||||
m.add(log)
|
|
||||||
m.add(t)
|
|
||||||
return m, t, log
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue