Browse Source

FIX: Bug in ttkDesigner after the introduction of the new Paint Event.

pull/142/head
Eugenio Parodi 3 years ago
parent
commit
f36797dc90
  1. 14
      docs/MDNotes/Resources.md
  2. 2
      setup.ttkDesigner.py
  3. 4
      ttkDesigner/app/notepad.py
  4. 2
      ttkDesigner/app/superobj/superwidget.py

14
docs/MDNotes/Resources.md

@ -97,4 +97,16 @@ Check as reference:
Pty Demo:
- https://docs.python.org/3/library/pty.html#example
- https://docs.python.org/3/library/pty.html#example
Run Python - pyTermTk on Wine32:
```bash
~/.var/app/net.lutris.Lutris/data/lutris/runners/wine/lutris-GE-Proton8-5-x86_64/bin/wine /home/one/.wine/drive_c/windows/system32/cmd.exe
# Install python from https://www.python.org/downloads/windows/
# Copy the pyTermTk demo and TermTk folder in
# ~/.wine/drive_c/users/one/AppData/Local/Programs/Python/Python310-32
cd C:\users\one\AppData\Local\Programs\Python\Python310-32
python.exe demo/demo.py
```

2
setup.ttkDesigner.py

@ -33,7 +33,7 @@ setup(
package_data={'ttkDesigner': ['tui/*']},
python_requires=">=3.8",
install_requires=[
'pyTermTk>=0.30.0a48',
'pyTermTk>=0.30.0a66',
'pyperclip',
'Pillow'],
entry_points={

4
ttkDesigner/app/notepad.py

@ -22,7 +22,7 @@
import TermTk as ttk
class superSimpleHorizontalLine(ttk.TTkWidget):
class SuperSimpleHorizontalLine(ttk.TTkWidget):
def paintEvent(self, canvas):
w,h = self.size()
canvas.drawText(pos=(0,h-1), text=''+(''*(w-2))+'',color=ttk.TTkColor.fg("#888888"))
@ -78,7 +78,7 @@ class NotePad(ttk.TTkGridLayout):
btn_redo.clicked.connect(te.redo)
# Useless custom horizontal bar for aestetic reason
fontLayout.addWidget(superSimpleHorizontalLine(),0,12,2,1)
fontLayout.addWidget(SuperSimpleHorizontalLine(),0,12,2,1)
@ttk.pyTTkSlot(ttk.TTkColor)
def _currentColorChangedCB(format):

2
ttkDesigner/app/superobj/superwidget.py

@ -267,7 +267,7 @@ class SuperWidget(ttk.TTkWidget):
# canvas.fill(pos=(l,t), size=(w-r-l,h-b-t), color=self._layoutPadColor)
else:
self._wid.getCanvas().updateSize()
self._wid.paintEvent(canvas)
self._wid.paintEvent(self._wid.getCanvas())
canvas.paintCanvas(
self._wid.getCanvas(),
( 0, 0, w, h), # geometry

Loading…
Cancel
Save