Browse Source

Merge pull request #200 from ceccopierangiolieugenio/ttkDesigner-input-crash

Ttk designer input crash
pull/202/head
Ceccopierangiolieugenio 3 years ago committed by GitHub
parent
commit
1bb2ce7b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      README.md
  2. 2
      TermTk/TTkCore/TTkTerm/__init__.py
  3. 8
      TermTk/TTkTestWidgets/tominspector.py
  4. 8
      demo/showcase/formwidgets02.py
  5. 2
      docs/source/info/features/index.rst
  6. 22
      docs/source/info/features/widgets.rst
  7. 2
      docs/source/info/installing.rst
  8. 4
      ttkDesigner/app/superobj/superlayoutgrid.py
  9. 6
      ttkDesigner/app/treeinspector.py

4
README.md

@ -21,8 +21,8 @@ and inspired by a mix of [Qt5](https://www.riverbankcomputing.com/static/Docs/Py
## [Features](https://ceccopierangiolieugenio.github.io/pyTermTk/info/features/index.html)
- Self Contained (no external lib required)
- [Cross compatible](https://ceccopierangiolieugenio.github.io/pyTermTk/info/features/crosscompatible.html): [Linux](https://en.wikipedia.org/wiki/Linux)🐧, [MacOS](https://en.wikipedia.org/wiki/MacOS)🍎, [MS Windows](https://en.wikipedia.org/wiki/Microsoft_Windows)🪟, [HTML5](https://en.wikipedia.org/wiki/HTML5)🌍([Try](https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html))
- Basic widgets for [TUI](https://en.wikipedia.org/wiki/Text-based_user_interface) development (Button, Label, checkbox, ...)
- Specialized widgets to improve the usability (Windows, Frames, Tables, ...)
- [Basic widgets](https://ceccopierangiolieugenio.github.io/pyTermTk/info/features/widgets.html#base-widgets) for [TUI](https://en.wikipedia.org/wiki/Text-based_user_interface) development (Button, Label, checkbox, ...)
- [Specialized widgets](https://ceccopierangiolieugenio.github.io/pyTermTk/info/features/widgets.html#specialised-widgets) to improve the usability (Windows, Frames, Tables, ...)
- QT Like Layout system to help arrange the widgets in the terminal
- True color support
- Ful/Half/Zero sized Unicode characters 😎

2
TermTk/TTkCore/TTkTerm/__init__.py

@ -1,5 +1,5 @@
# from .inputkey import *
# from .inputmouse import *
# from .colors import *
# from .input import *
from .input import *
from .term import *

8
TermTk/TTkTestWidgets/tominspector.py

@ -209,8 +209,8 @@ class TTkTomInspector(TTkContainer):
TTkLog.debug(f"{kevt} {mevt}")
if mevt.evt == TTkK.Press:
# TTkHelper._rootWidget.setEnabled(True)
# TTkHelper._rootWidget._input.inputEvent.connect(TTkHelper._rootWidget._processInput)
TTkHelper._rootWidget._input.inputEvent.disconnect(self._processInput)
# TTkInput.inputEvent.connect(TTkHelper._rootWidget._processInput)
TTkInput.inputEvent.disconnect(self._processInput)
widget = TTkTomInspector._findWidget(mevt,TTkHelper._rootWidget.rootLayout())
TTkLog.debug(f"{widget=}")
if widget:
@ -223,8 +223,8 @@ class TTkTomInspector(TTkContainer):
@pyTTkSlot()
def _btnPickCb(self):
# TTkHelper._rootWidget.setEnabled(True)
# TTkHelper._rootWidget._input.inputEvent.disconnect(TTkHelper._rootWidget._processInput)
TTkHelper._rootWidget._input.inputEvent.connect(self._processInput)
# TTkInput.inputEvent.disconnect(TTkHelper._rootWidget._processInput)
TTkInput.inputEvent.connect(self._processInput)
@pyTTkSlot()
def _refresh(self, widget=None):

8
demo/showcase/formwidgets02.py

@ -35,10 +35,10 @@ def demoFormWidgets(root=None):
win_form1_grid_layout = ttk.TTkGridLayout(columnMinWidth=1)
frame = ttk.TTkFrame(parent=root, layout=win_form1_grid_layout, border=0)
win_form1_grid_layout.addWidget(_b1 := ttk.TTkButton(text='Button 1'),0,0)
win_form1_grid_layout.addWidget(_b2 := ttk.TTkButton(text='Button 2', border=True),1,0)
win_form1_grid_layout.addWidget(_b3 := ttk.TTkButton(text='Checkable 1', checkable=True, maxHeight=3),0,2)
win_form1_grid_layout.addWidget(_b4 := ttk.TTkButton(text='Checkable 2', checkable=True, border=True, maxHeight=3),1,2)
win_form1_grid_layout.addWidget(_b1 := ttk.TTkButton(text='Button 1', border=True, maxHeight=3),0,0)
win_form1_grid_layout.addWidget(_b2 := ttk.TTkButton(text='Button 2'),1,0)
win_form1_grid_layout.addWidget(_b3 := ttk.TTkButton(text='Checkable 1', checkable=True, border=True),0,2)
win_form1_grid_layout.addWidget(_b4 := ttk.TTkButton(text='Checkable 2', checkable=True),1,2)
win_form1_grid_layout.addWidget(_en_dis_cb := ttk.TTkCheckbox(text=" en/dis", checked=True, maxWidth=11),1,3)
_en_dis_cb.clicked.connect(_b1.setEnabled)

2
docs/source/info/features/index.rst

@ -3,6 +3,8 @@
Features
========
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/96d2a1f0-721b-4988-b4cf-63e11fa31610
Main features
-------------

22
docs/source/info/features/widgets.rst

@ -19,8 +19,13 @@ Base Widgets
* Radio Button :class:`~TermTk.TTkWidgets.radiobutton.TTkRadiobutton`
* Scrollbar :class:`~TermTk.TTkWidgets.scrollbar.TTkScrollBar`
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/22f507ce-d4c9-4910-8019-29362b3a71f7
* List :class:`~TermTk.TTkWidgets.list_.TTkList`
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/9c8e257e-90b0-4de6-a4dc-f7126ac73785
* Menu :class:`~TermTk.TTkWidgets.menu.TTkMenu`
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/b024ae12-57d8-4e69-8b3f-71623fae4ce7
* Tab :class:`~TermTk.TTkWidgets.tabwidget.TTkTabWidget`
@ -31,7 +36,7 @@ Specialised Widgets
* TextEdit :class:`~TermTk.TTkWidgets.texedit.TTkTextEdit`
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/3f4f7306-fb6c-4892-8960-3d42780a34de
* KodeTab :class:`~TermTk.TTkWidgets.kodetb.TTkKodeTab`
* KodeTab :class:`~TermTk.TTkWidgets.kodetab.TTkKodeTab`
* Terminal TBD
@ -40,20 +45,23 @@ Specialised Widgets
Pickers
-------
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/35de8317-1ee6-4dad-9c46-320d0692c393
* Text Picker
* Text Picker :class:`~TermTk.TTkWidgets.TTkPickers.textpicker.TTkTextPicker`
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/0388f4a0-1a93-4d57-9a77-c7e43422fedb
* File Picker
* File Picker :class:`~TermTk.TTkWidgets.TTkPickers.filepicker.TTkFileButtonPicker`
.. image:: https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/9a61baf3-f151-49a6-bde0-ace02eb9008e
* Color Picker
* Color Picker :class:`~TermTk.TTkWidgets.TTkPickers.colorpicker.TTkColorButtonPicker`
* Message Box :class:`~TermTk.TTkWidgets.TTkPickers.messagebox.TTkMessageBox`
.. _widgets-layout:
Layout
------
* Frame
* Resizable Frame
* Frame :class:`~TermTk.TTkWidgets.frame.TTkFrame`
* Resizable Frame :class:`~TermTk.TTkWidgets.resizableframe.TTkResizableFrame`
* Window :class:`~TermTk.TTkWidgets.window.TTkWindow`
* Splitter
* Splitter :class:`~TermTk.TTkWidgets.splitter.TTkSplitter`
* Scroll Area :class::`~TermTk.TTkWidgets.scrollarea.TTkScrollArea`

2
docs/source/info/installing.rst

@ -10,7 +10,7 @@ Installation
pyTermTk_ is a self contained library,
it does not require extra libraries to be used
and can be installed through :ref:`install-pypi`
or just :ref:`copying the TermTk Folder<install-copy>` in the root folder of your project.
or just :ref:`copying the TermTk folder<install-copy>` in the root folder of your project.

4
ttkDesigner/app/superobj/superlayoutgrid.py

@ -68,12 +68,12 @@ class _SuperExpandButton(ttk.TTkButton):
return True
def show(self):
ttk.TTkHelper._rootWidget._input.inputEvent.connect(self._processInput)
ttk.TTkInput.inputEvent.connect(self._processInput)
return super().show()
def hide(self):
self.superExpandButtonHidden.emit()
ttk.TTkHelper._rootWidget._input.inputEvent.disconnect(self._processInput)
ttk.TTkInput.inputEvent.disconnect(self._processInput)
return super().hide()
def paintEvent(self, canvas):

6
ttkDesigner/app/treeinspector.py

@ -72,8 +72,8 @@ class TreeInspector(ttk.TTkGridLayout):
# ttk.TTkLog.debug(f"{kevt} {mevt}")
# if mevt.evt == TTkK.Press:
# # TTkHelper._rootWidget.setEnabled(True)
# # TTkHelper._rootWidget._input.inputEvent.connect(TTkHelper._rootWidget._processInput)
# ttk.TTkHelper._rootWidget._input.inputEvent.disconnect(self._processInput)
# # TTkInput.inputEvent.connect(TTkHelper._rootWidget._processInput)
# ttk.TTkInput.inputEvent.disconnect(self._processInput)
# thing = TTkTomInspector._findWidget(mevt,ttk.TTkHelper._rootWidget.rootLayout())
# ttk.TTkLog.debug(f"{thing=}")
# if thing:
@ -85,7 +85,7 @@ class TreeInspector(ttk.TTkGridLayout):
@ttk.pyTTkSlot()
def _btnPickCb(self):
# ttk.TTkHelper._rootWidget._input.inputEvent.connect(self._processInput)
# ttk.TTkInput.inputEvent.connect(self._processInput)
pass
@ttk.pyTTkSlot()

Loading…
Cancel
Save