Skip to content

Commit

Permalink
- Add warning about macOS x86_64 tkinter bug
Browse files Browse the repository at this point in the history
- Update documentations
- Update screenshot
  • Loading branch information
laggykiller committed Oct 2, 2023
1 parent 533e7a0 commit f5d51ee
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
8 changes: 2 additions & 6 deletions docs/COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ Install the required python modules with `pip3 install -r requirements.txt`
Change directory into `sticker_convert` directory and run `python3 ./sticker-convert.py`

# Compiling on Windows and MacOS
This repository uses `nuitka` for compiling.

1. Install dependencies with `pip3 install -r requirements.txt` and `pip3 install -r requirements-build.txt`
2. Run `python compile.py`
3. Compilation result in `sticker-convert.dist` directory
This repository uses `nuitka` (factory branch) for compiling. Just run `python compile.py`, compilation result in `sticker-convert.dist` directory.

## Creating AppImage on Linux
1. Use Ubuntu 20.04 (May work on newer version if you change `sourceline` in `AppImageBuilder.yml`)
Expand All @@ -32,7 +28,7 @@ sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
2. Install [Wix](https://wixtoolset.org/docs/intro/): `dotnet tool install --global wix`
3. `wix extension add WixToolset.UI.wixext`
4. `python compile.py`
5. `mv dist\sticker-convert sticker-convert`
5. `mv sticker-convert.dist sticker-convert`
6. `python msicreator\createmsi.py msicreator.json`

# Build wheel
Expand Down
Binary file modified imgs/screenshot-docker-gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 20 additions & 6 deletions src/sticker_convert/gui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import os
import sys
import platform
import time
import math
from multiprocessing import cpu_count
Expand Down Expand Up @@ -58,14 +59,9 @@ def __init__(self):
self.apply_creds()
self.init_frames()
self.pack_frames()
self.warn_tkinter_bug()
GUIUtils.finalize_window(self)

self.msg_lock = Lock()
self.bar_lock = Lock()
self.response_dict_lock = Lock()
self.response_dict = {}
self.action_queue = Queue()
self.flow = None
self.after(500, self.poll_actions)

def __enter__(self):
Expand Down Expand Up @@ -155,6 +151,14 @@ def declare_variables(self):
# Config
self.settings_save_cred_var = BooleanVar()

# Other
self.msg_lock = Lock()
self.bar_lock = Lock()
self.response_dict_lock = Lock()
self.response_dict = {}
self.action_queue = Queue()
self.flow = None

def init_frames(self):
self.input_frame = InputFrame(self, self.scrollable_frame, borderwidth=1, text='Input')
self.comp_frame = CompFrame(self, self.scrollable_frame, borderwidth=1, text='Compression options')
Expand All @@ -173,6 +177,16 @@ def pack_frames(self):
self.progress_frame.grid(column=0, row=3, columnspan=2, sticky='news', padx=5, pady=5)
self.control_frame.grid(column=0, row=4, columnspan=2, sticky='news', padx=5, pady=5)

def warn_tkinter_bug(self):
if platform.system() == 'Darwin' and platform.machine() == 'x86_64':
msg = 'NOTICE: If buttons are not responsive, try to press '
msg += 'on title bar or move mouse cursor away from window for a while.'
self.cb_msg(msg)
msg = '(This is due to a bug in tkinter specific to x86_64 macOS)'
self.cb_msg(msg)
msg = '(https://github.com/python/cpython/issues/110218)'
self.cb_msg(msg)

def load_jsons(self):
self.help = JsonManager.load_json('resources/help.json')
self.input_presets = JsonManager.load_json('resources/input.json')
Expand Down

0 comments on commit f5d51ee

Please sign in to comment.