From 699306d88ae7ff05ef2ccc82c263bfae44362949 Mon Sep 17 00:00:00 2001
From: Eugenio Parodi
Date: Tue, 16 Mar 2021 18:50:53 +0000
Subject: [PATCH] Doc Updated
---
TTkAbstract/abstractscrollarea.html | 1 -
TTkAbstract/abstractscrollview.html | 1 -
TTkCore/canvas.html | 243 +++++++++++-
TTkCore/cfg.html | 25 +-
TTkCore/color.html | 4 +-
TTkCore/constant.html | 67 +++-
TTkCore/filebuffer.html | 592 ++++++++++++++++++++++++++++
TTkCore/helper.html | 27 +-
TTkCore/index.html | 5 +
TTkCore/ttk.html | 58 ++-
TTkTestWidgets/logviewer.html | 1 -
TTkTestWidgets/testwidget.html | 1 -
TTkTestWidgets/testwidgetsizes.html | 1 -
TTkWidgets/button.html | 1 -
TTkWidgets/checkbox.html | 48 ++-
TTkWidgets/combobox.html | 1 -
TTkWidgets/frame.html | 1 -
TTkWidgets/graph.html | 1 -
TTkWidgets/label.html | 1 -
TTkWidgets/lineedit.html | 97 ++++-
TTkWidgets/list.html | 1 -
TTkWidgets/listwidget.html | 1 -
TTkWidgets/radiobutton.html | 1 -
TTkWidgets/resizableframe.html | 1 -
TTkWidgets/scrollarea.html | 1 -
TTkWidgets/scrollbar.html | 1 -
TTkWidgets/spacer.html | 1 -
TTkWidgets/splitter.html | 45 ++-
TTkWidgets/table.html | 1 -
TTkWidgets/tableview.html | 1 -
TTkWidgets/tabwidget.html | 1 -
TTkWidgets/texedit.html | 1 -
TTkWidgets/tree.html | 1 -
TTkWidgets/treeview.html | 1 -
TTkWidgets/treewidget.html | 7 +-
TTkWidgets/widget.html | 80 +---
TTkWidgets/window.html | 1 -
libbpytop/colors.html | 7 +-
libbpytop/input.html | 2 +-
39 files changed, 1169 insertions(+), 162 deletions(-)
create mode 100644 TTkCore/filebuffer.html
diff --git a/TTkAbstract/abstractscrollarea.html b/TTkAbstract/abstractscrollarea.html
index cfde17be..32310424 100644
--- a/TTkAbstract/abstractscrollarea.html
+++ b/TTkAbstract/abstractscrollarea.html
@@ -411,7 +411,6 @@ class TTkAbstractScrollArea(TTkWidget):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkAbstract/abstractscrollview.html b/TTkAbstract/abstractscrollview.html
index 344296a3..475d7e14 100644
--- a/TTkAbstract/abstractscrollview.html
+++ b/TTkAbstract/abstractscrollview.html
@@ -375,7 +375,6 @@ def viewMoveTo(self, x, y):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkCore/canvas.html b/TTkCore/canvas.html
index db502222..d46fb1e3 100644
--- a/TTkCore/canvas.html
+++ b/TTkCore/canvas.html
@@ -55,10 +55,9 @@ import math
import TermTk.libbpytop as lbt
from TermTk.TTkCore.constant import TTkK
from TermTk.TTkCore.log import TTkLog
-from TermTk.TTkCore.cfg import *
-from TermTk.TTkCore.color import *
-from TermTk.TTkCore.helper import *
-from TermTk.TTkGui.theme import *
+from TermTk.TTkCore.cfg import TTkCfg, TTkGlbl
+from TermTk.TTkCore.color import TTkColor
+from TermTk.TTkCore.helper import TTkHelper
class TTkCanvas:
'''
@@ -77,10 +76,17 @@ class TTkCanvas:
in w = the width of the new canvas
in h = the height of the new canvas
'''
- __slots__ = ('_widget', '_width', '_height', '_newWidth', '_newHeight','_theme', '_data', '_colors', '_visible')
+ __slots__ = (
+ '_widget',
+ '_width', '_height', '_newWidth', '_newHeight',
+ '_theme',
+ '_data', '_colors',
+ '_bufferedData', '_bufferedColors',
+ '_visible', '_doubleBuffer')
def __init__(self, *args, **kwargs):
self._widget = kwargs.get('widget', None)
self._visible = True
+ self._doubleBuffer = False
self._width = 0
self._height = 0
self._data = [[0]]
@@ -93,6 +99,10 @@ class TTkCanvas:
def getWidget(self): return self._widget
+ def enableDoubleBuffer(self):
+ self._doubleBuffer = True
+ self._bufferedData, self._bufferedColors = self.copy()
+
def updateSize(self):
if not self._visible: return
w,h = self._newWidth, self._newHeight
@@ -103,8 +113,14 @@ class TTkCanvas:
for i in range(0,h):
self._data[i] = [' ']*w
self._colors[i] = [TTkColor.RST]*w
- self._width = w
+ if self._doubleBuffer:
+ self._bufferedData = [[]]*h
+ self._bufferedColors = [[]]*h
+ for i in range(0,h):
+ self._bufferedData[i] = ['']*w
+ self._bufferedColors[i] = [TTkColor.RST]*w
self._height = h
+ self._width = w
def resize(self, w, h):
self._newWidth = w
@@ -119,6 +135,18 @@ class TTkCanvas:
self._data[iy][ix] = ' '
self._colors[iy][ix] = TTkColor.RST
+ def copy(self):
+ w,h = self._width, self._height
+ retData = [[]]*h
+ retColors = [[]]*h
+ for iy in range(h):
+ retData[iy] = [' ']*w
+ retColors[iy] = [TTkColor.RST]*w
+ for ix in range(w):
+ retData[iy][ix] = self._data[iy][ix]
+ retColors[iy][ix] = self._colors[iy][ix]
+ return retData, retColors
+
def hide(self):
self._visible = False
@@ -209,6 +237,8 @@ class TTkCanvas:
elif alignment == TTkK.JUSTIFY:
# TODO: Text Justification
text = text + " "*pad
+ else:
+ text=text[:width]
arr = list(text)
for i in range(0, len(arr)):
@@ -532,7 +562,40 @@ class TTkCanvas:
ansi += color-lastcolor
lastcolor = color
ansi+=ch
- lbt.Term.push(ansi)
+ lbt.Term.push(ansi)
+
+ def pushToTerminalBuffered(self, x, y, w, h):
+ # TTkLog.debug("pushToTerminal")
+ oldData, oldColors = self._bufferedData, self._bufferedColors
+ lastcolor = TTkColor.RST
+ empty = True
+ ansi = ""
+ for y in range(0, self._height):
+ for x in range(0, self._width):
+ if self._data[y][x] == oldData[y][x] and \
+ self._colors[y][x] == oldColors[y][x]:
+ if not empty:
+ lbt.Term.push(ansi)
+ empty=True
+ continue
+ ch = self._data[y][x]
+ color = self._colors[y][x]
+ if empty:
+ ansi = color+lbt.Mv.t(y+1,x+1)
+ #lastcolor = color
+ empty = False
+ if color != lastcolor:
+ ansi += color-lastcolor
+ lastcolor = color
+ ansi+=ch
+ if not empty:
+ lbt.Term.push(ansi)
+ empty=True
+ # Reset the color at the end
+ lbt.Term.push(TTkColor.RST)
+ # Switch the buffer
+ self._bufferedData, self._bufferedColors = self._data, self._colors
+ self._data, self._colors = oldData, oldColors
@@ -584,10 +647,17 @@ h = the height of the new canvas
in w = the width of the new canvas
in h = the height of the new canvas
'''
- __slots__ = ('_widget', '_width', '_height', '_newWidth', '_newHeight','_theme', '_data', '_colors', '_visible')
+ __slots__ = (
+ '_widget',
+ '_width', '_height', '_newWidth', '_newHeight',
+ '_theme',
+ '_data', '_colors',
+ '_bufferedData', '_bufferedColors',
+ '_visible', '_doubleBuffer')
def __init__(self, *args, **kwargs):
self._widget = kwargs.get('widget', None)
self._visible = True
+ self._doubleBuffer = False
self._width = 0
self._height = 0
self._data = [[0]]
@@ -600,6 +670,10 @@ h = the height of the new canvas
def getWidget(self): return self._widget
+ def enableDoubleBuffer(self):
+ self._doubleBuffer = True
+ self._bufferedData, self._bufferedColors = self.copy()
+
def updateSize(self):
if not self._visible: return
w,h = self._newWidth, self._newHeight
@@ -610,8 +684,14 @@ h = the height of the new canvas
for i in range(0,h):
self._data[i] = [' ']*w
self._colors[i] = [TTkColor.RST]*w
- self._width = w
+ if self._doubleBuffer:
+ self._bufferedData = [[]]*h
+ self._bufferedColors = [[]]*h
+ for i in range(0,h):
+ self._bufferedData[i] = ['']*w
+ self._bufferedColors[i] = [TTkColor.RST]*w
self._height = h
+ self._width = w
def resize(self, w, h):
self._newWidth = w
@@ -626,6 +706,18 @@ h = the height of the new canvas
self._data[iy][ix] = ' '
self._colors[iy][ix] = TTkColor.RST
+ def copy(self):
+ w,h = self._width, self._height
+ retData = [[]]*h
+ retColors = [[]]*h
+ for iy in range(h):
+ retData[iy] = [' ']*w
+ retColors[iy] = [TTkColor.RST]*w
+ for ix in range(w):
+ retData[iy][ix] = self._data[iy][ix]
+ retColors[iy][ix] = self._colors[iy][ix]
+ return retData, retColors
+
def hide(self):
self._visible = False
@@ -716,6 +808,8 @@ h = the height of the new canvas
elif alignment == TTkK.JUSTIFY:
# TODO: Text Justification
text = text + " "*pad
+ else:
+ text=text[:width]
arr = list(text)
for i in range(0, len(arr)):
@@ -1039,7 +1133,40 @@ h = the height of the new canvas
ansi += color-lastcolor
lastcolor = color
ansi+=ch
- lbt.Term.push(ansi)
+ lbt.Term.push(ansi)
+
+ def pushToTerminalBuffered(self, x, y, w, h):
+ # TTkLog.debug("pushToTerminal")
+ oldData, oldColors = self._bufferedData, self._bufferedColors
+ lastcolor = TTkColor.RST
+ empty = True
+ ansi = ""
+ for y in range(0, self._height):
+ for x in range(0, self._width):
+ if self._data[y][x] == oldData[y][x] and \
+ self._colors[y][x] == oldColors[y][x]:
+ if not empty:
+ lbt.Term.push(ansi)
+ empty=True
+ continue
+ ch = self._data[y][x]
+ color = self._colors[y][x]
+ if empty:
+ ansi = color+lbt.Mv.t(y+1,x+1)
+ #lastcolor = color
+ empty = False
+ if color != lastcolor:
+ ansi += color-lastcolor
+ lastcolor = color
+ ansi+=ch
+ if not empty:
+ lbt.Term.push(ansi)
+ empty=True
+ # Reset the color at the end
+ lbt.Term.push(TTkColor.RST)
+ # Switch the buffer
+ self._bufferedData, self._bufferedColors = self._data, self._colors
+ self._data, self._colors = oldData, oldColors
Methods
@@ -1062,6 +1189,28 @@ h = the height of the new canvas
self._colors[iy][ix] = TTkColor.RST
+
+def copy(self)
+
+-
+
+
+
+Expand source code
+
+def copy(self):
+ w,h = self._width, self._height
+ retData = [[]]*h
+ retColors = [[]]*h
+ for iy in range(h):
+ retData[iy] = [' ']*w
+ retColors[iy] = [TTkColor.RST]*w
+ for ix in range(w):
+ retData[iy][ix] = self._data[iy][ix]
+ retColors[iy][ix] = self._colors[iy][ix]
+ return retData, retColors
+
+
def drawBox(self, pos, size, color=<TermTk.TTkCore.color._TTkColor object>, grid=0)
@@ -1493,6 +1642,8 @@ h = the height of the new canvas
elif alignment == TTkK.JUSTIFY:
# TODO: Text Justification
text = text + " "*pad
+ else:
+ text=text[:width]
arr = list(text)
for i in range(0, len(arr)):
@@ -1519,6 +1670,20 @@ h = the height of the new canvas
self._set(y+i, x, ln[1], color)
+
+def enableDoubleBuffer(self)
+
+-
+
+
+
+Expand source code
+
+def enableDoubleBuffer(self):
+ self._doubleBuffer = True
+ self._bufferedData, self._bufferedColors = self.copy()
+
+
def execPaint(self, winw, winh)
@@ -1628,6 +1793,49 @@ h = the height of the new canvas
lbt.Term.push(ansi)
+
+def pushToTerminalBuffered(self, x, y, w, h)
+
+-
+
+
+
+Expand source code
+
+def pushToTerminalBuffered(self, x, y, w, h):
+ # TTkLog.debug("pushToTerminal")
+ oldData, oldColors = self._bufferedData, self._bufferedColors
+ lastcolor = TTkColor.RST
+ empty = True
+ ansi = ""
+ for y in range(0, self._height):
+ for x in range(0, self._width):
+ if self._data[y][x] == oldData[y][x] and \
+ self._colors[y][x] == oldColors[y][x]:
+ if not empty:
+ lbt.Term.push(ansi)
+ empty=True
+ continue
+ ch = self._data[y][x]
+ color = self._colors[y][x]
+ if empty:
+ ansi = color+lbt.Mv.t(y+1,x+1)
+ #lastcolor = color
+ empty = False
+ if color != lastcolor:
+ ansi += color-lastcolor
+ lastcolor = color
+ ansi+=ch
+ if not empty:
+ lbt.Term.push(ansi)
+ empty=True
+ # Reset the color at the end
+ lbt.Term.push(TTkColor.RST)
+ # Switch the buffer
+ self._bufferedData, self._bufferedColors = self._data, self._colors
+ self._data, self._colors = oldData, oldColors
+
+
def resize(self, w, h)
@@ -1674,8 +1882,14 @@ h = the height of the new canvas
for i in range(0,h):
self._data[i] = [' ']*w
self._colors[i] = [TTkColor.RST]*w
- self._width = w
- self._height = h
+ if self._doubleBuffer:
+ self._bufferedData = [[]]*h
+ self._bufferedColors = [[]]*h
+ for i in range(0,h):
+ self._bufferedData[i] = ['']*w
+ self._bufferedColors[i] = [TTkColor.RST]*w
+ self._height = h
+ self._width = w
@@ -1698,8 +1912,9 @@ h = the height of the new canvas
class TTkLineEdit(TTkWidget):
- __slots__ = ('_text', '_cursorPos', '_offset', '_replace', '_inputType')
+ __slots__ = (
+ '_text', '_cursorPos', '_offset', '_replace', '_inputType',
+ # Signals
+ 'returnPressed', 'textChanged', 'textEdited' )
def __init__(self, *args, **kwargs):
+ # Signals
+ self.returnPressed = pyTTkSignal()
+ self.textChanged = pyTTkSignal(str)
+ self.textEdited = pyTTkSignal(str)
TTkWidget.__init__(self, *args, **kwargs)
self._name = kwargs.get('name' , 'TTkLineEdit' )
self._inputType = kwargs.get('inputType' , TTkK.Input_Text )
@@ -263,6 +289,14 @@ class TTkLineEdit(TTkWidget):
self.setMinimumSize(10,1)
self.setFocusPolicy(TTkK.ClickFocus + TTkK.TabFocus)
+ def setText(self, text):
+ if text != self._text:
+ self.textChanged.emit(text)
+ self._text = text
+
+ def text(self):
+ return self._text
+
def _pushCursor(self):
TTkHelper.moveCursor(self,self._cursorPos-self._offset,0)
if self._replace:
@@ -325,6 +359,9 @@ class TTkLineEdit(TTkWidget):
elif self._cursorPos - self._offset < 0:
self._offset = self._cursorPos
self._pushCursor()
+
+ if evt.key == TTkK.Key_Enter:
+ self.returnPressed.emit()
else:
if self._inputType & TTkK.Input_Number and \
not evt.key.isdigit():
@@ -337,12 +374,13 @@ class TTkLineEdit(TTkWidget):
post = text[self._cursorPos:]
text = pre + evt.key + post
- self._text = text
+ self.setText(text)
self._cursorPos += 1
# Scroll to the right if reached the edge
if self._cursorPos - self._offset > w:
self._offset += 1
self._pushCursor()
+ self.textEdited.emit(self._text)
def focusInEvent(self):
self._pushCursor()
@@ -357,6 +395,21 @@ class TTkLineEdit(TTkWidget):
TMouseEvents
TKeyEvents
+Instance variables
+
+var returnPressed
+-
+
Return an attribute of instance, which is of type owner.
+
+var textChanged
+-
+
Return an attribute of instance, which is of type owner.
+
+var textEdited
+-
+
Return an attribute of instance, which is of type owner.
+
+
Methods
@@ -386,6 +439,34 @@ class TTkLineEdit(TTkWidget):
self.update()
+
+def setText(self, text)
+
+
+
+
+
+Expand source code
+
+def setText(self, text):
+ if text != self._text:
+ self.textChanged.emit(text)
+ self._text = text
+
+
+
+def text(self)
+
+
+
+
+
+Expand source code
+
+def text(self):
+ return self._text
+
+
Inherited members
@@ -408,7 +489,6 @@ class TTkLineEdit(TTkWidget):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
@@ -437,9 +517,14 @@ class TTkLineEdit(TTkWidget):
diff --git a/TTkWidgets/list.html b/TTkWidgets/list.html
index c5111309..434c8027 100644
--- a/TTkWidgets/list.html
+++ b/TTkWidgets/list.html
@@ -255,7 +255,6 @@ class TTkList(TTkAbstractScrollArea):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/listwidget.html b/TTkWidgets/listwidget.html
index da990116..6c92ce6b 100644
--- a/TTkWidgets/listwidget.html
+++ b/TTkWidgets/listwidget.html
@@ -429,7 +429,6 @@ class TTkListWidget(TTkAbstractScrollView):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/radiobutton.html b/TTkWidgets/radiobutton.html
index 4f567b77..6d8d3918 100644
--- a/TTkWidgets/radiobutton.html
+++ b/TTkWidgets/radiobutton.html
@@ -246,7 +246,6 @@ class TTkRadioButton(TTkWidget):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/resizableframe.html b/TTkWidgets/resizableframe.html
index 126e4556..38e5f381 100644
--- a/TTkWidgets/resizableframe.html
+++ b/TTkWidgets/resizableframe.html
@@ -287,7 +287,6 @@ class TTkResizableFrame(TTkFrame):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/scrollarea.html b/TTkWidgets/scrollarea.html
index fec09d98..effc3077 100644
--- a/TTkWidgets/scrollarea.html
+++ b/TTkWidgets/scrollarea.html
@@ -202,7 +202,6 @@ class TTkScrollArea(TTkAbstractScrollArea):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/scrollbar.html b/TTkWidgets/scrollbar.html
index 731f83c0..1f9c8401 100644
--- a/TTkWidgets/scrollbar.html
+++ b/TTkWidgets/scrollbar.html
@@ -825,7 +825,6 @@ def setValue(self, v):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/spacer.html b/TTkWidgets/spacer.html
index de0fbdbf..d050d3d6 100644
--- a/TTkWidgets/spacer.html
+++ b/TTkWidgets/spacer.html
@@ -170,7 +170,6 @@ class TTkSpacer(TTkWidget):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/splitter.html b/TTkWidgets/splitter.html
index 2ad46720..fcb4bf5a 100644
--- a/TTkWidgets/splitter.html
+++ b/TTkWidgets/splitter.html
@@ -57,11 +57,16 @@ from TermTk.TTkWidgets.widget import *
from TermTk.TTkWidgets.frame import *
class TTkSplitter(TTkFrame):
- __slots__ = ('_splitterInitialized', '_orientation','_separators', '_separatorSelected', '_mouseDelta')
+ __slots__ = (
+ '_splitterInitialized', '_orientation',
+ '_separators', '_separatorsRef', '_sizeRef',
+ '_separatorSelected', '_mouseDelta')
def __init__(self, *args, **kwargs):
self._splitterInitialized = False
# self._splitterInitialized = True
self._separators = []
+ self._separatorsRef = []
+ self._sizeRef = 0
self._separatorSelected = None
self._orientation = TTkK.HORIZONTAL
TTkFrame.__init__(self, *args, **kwargs)
@@ -86,6 +91,8 @@ class TTkSplitter(TTkFrame):
newSep = -1
self._separators.append(newSep)
self._updateGeometries()
+ self._separatorsRef = self._separators
+ self._sizeRef = fullSize
def _minMaxSizeBefore(self, index):
if self._separatorSelected is None:
@@ -111,6 +118,7 @@ class TTkSplitter(TTkFrame):
return minsize, maxsize
def _updateGeometries(self):
+ if not self.isVisible(): return
_,_,w,h = self.geometry()
sep = self._separators
x,y=0,0
@@ -168,7 +176,19 @@ class TTkSplitter(TTkFrame):
for i in range(selected, len(sep)):
_processGeometry(i, True)
+ if self._separatorSelected is not None or self._sizeRef==0:
+ self._separatorsRef = self._separators
+ self._sizeRef = size
+
def resizeEvent(self, w, h):
+ # Adjust separators to the new size;
+ self._separatorSelected = None
+ if self._sizeRef > 0:
+ if self._orientation == TTkK.HORIZONTAL:
+ diff = w/self._sizeRef
+ else:
+ diff = h/self._sizeRef
+ self._separators = [int(i*diff) for i in self._separatorsRef]
self._updateGeometries()
def paintEvent(self):
@@ -343,11 +363,16 @@ class TTkSplitter(TTkFrame):
Expand source code
class TTkSplitter(TTkFrame):
- __slots__ = ('_splitterInitialized', '_orientation','_separators', '_separatorSelected', '_mouseDelta')
+ __slots__ = (
+ '_splitterInitialized', '_orientation',
+ '_separators', '_separatorsRef', '_sizeRef',
+ '_separatorSelected', '_mouseDelta')
def __init__(self, *args, **kwargs):
self._splitterInitialized = False
# self._splitterInitialized = True
self._separators = []
+ self._separatorsRef = []
+ self._sizeRef = 0
self._separatorSelected = None
self._orientation = TTkK.HORIZONTAL
TTkFrame.__init__(self, *args, **kwargs)
@@ -372,6 +397,8 @@ class TTkSplitter(TTkFrame):
newSep = -1
self._separators.append(newSep)
self._updateGeometries()
+ self._separatorsRef = self._separators
+ self._sizeRef = fullSize
def _minMaxSizeBefore(self, index):
if self._separatorSelected is None:
@@ -397,6 +424,7 @@ class TTkSplitter(TTkFrame):
return minsize, maxsize
def _updateGeometries(self):
+ if not self.isVisible(): return
_,_,w,h = self.geometry()
sep = self._separators
x,y=0,0
@@ -454,7 +482,19 @@ class TTkSplitter(TTkFrame):
for i in range(selected, len(sep)):
_processGeometry(i, True)
+ if self._separatorSelected is not None or self._sizeRef==0:
+ self._separatorsRef = self._separators
+ self._sizeRef = size
+
def resizeEvent(self, w, h):
+ # Adjust separators to the new size;
+ self._separatorSelected = None
+ if self._sizeRef > 0:
+ if self._orientation == TTkK.HORIZONTAL:
+ diff = w/self._sizeRef
+ else:
+ diff = h/self._sizeRef
+ self._separators = [int(i*diff) for i in self._separatorsRef]
self._updateGeometries()
def paintEvent(self):
@@ -683,7 +723,6 @@ class TTkSplitter(TTkFrame):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/table.html b/TTkWidgets/table.html
index 7f89680c..40fe5e9b 100644
--- a/TTkWidgets/table.html
+++ b/TTkWidgets/table.html
@@ -289,7 +289,6 @@ class TTkTable(TTkAbstractScrollArea):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/tableview.html b/TTkWidgets/tableview.html
index 9ae1a002..1f19cc1e 100644
--- a/TTkWidgets/tableview.html
+++ b/TTkWidgets/tableview.html
@@ -763,7 +763,6 @@ def viewMoveTo(self, x, y):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/tabwidget.html b/TTkWidgets/tabwidget.html
index f7460ea7..00e35bfd 100644
--- a/TTkWidgets/tabwidget.html
+++ b/TTkWidgets/tabwidget.html
@@ -482,7 +482,6 @@ class TTkTabWidget(TTkFrame):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/texedit.html b/TTkWidgets/texedit.html
index 7e87cddb..85c55010 100644
--- a/TTkWidgets/texedit.html
+++ b/TTkWidgets/texedit.html
@@ -266,7 +266,6 @@ def setText(self, text):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/tree.html b/TTkWidgets/tree.html
index cddf3488..6920a56a 100644
--- a/TTkWidgets/tree.html
+++ b/TTkWidgets/tree.html
@@ -323,7 +323,6 @@ class TTkTree(TTkAbstractScrollArea):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/treeview.html b/TTkWidgets/treeview.html
index be03ecae..7ba84e33 100644
--- a/TTkWidgets/treeview.html
+++ b/TTkWidgets/treeview.html
@@ -181,7 +181,6 @@ class TTkTreeView(TTkTableView):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/treewidget.html b/TTkWidgets/treewidget.html
index e5af7030..4e2462da 100644
--- a/TTkWidgets/treewidget.html
+++ b/TTkWidgets/treewidget.html
@@ -101,7 +101,7 @@ class _TTkDisplayedTreeItem(TTkWidget):
def paintEvent(self):
if self._isLeaf:
- self._canvas.drawText(pos=(self._depth, 0), text="⏺")
+ self._canvas.drawText(pos=(self._depth, 0), text="•")
self._canvas.drawText(pos=(self._depth+2, 0), text=self._text)
@@ -158,7 +158,7 @@ class TTkTreeWidget(TTkTableView):
if item.parent() is None:
self._topLevelItems.addChild(item)
displayedItems = item.data().copy()
- displayTreeItem = _TTkDisplayedTreeItem(text=displayedItems[0], id=0, depth=depth, treeWidgetItem=item)
+ displayTreeItem = _TTkDisplayedTreeItem(text=displayedItems[0], id=0, depth=depth, treeWidgetItem=item)
displayTreeItem._clicked.connect(self._controlClicked)
displayedItems[0] = displayTreeItem
if index == -1:
@@ -306,7 +306,7 @@ class TTkTreeWidget(TTkTableView):
if item.parent() is None:
self._topLevelItems.addChild(item)
displayedItems = item.data().copy()
- displayTreeItem = _TTkDisplayedTreeItem(text=displayedItems[0], id=0, depth=depth, treeWidgetItem=item)
+ displayTreeItem = _TTkDisplayedTreeItem(text=displayedItems[0], id=0, depth=depth, treeWidgetItem=item)
displayTreeItem._clicked.connect(self._controlClicked)
displayedItems[0] = displayTreeItem
if index == -1:
@@ -383,7 +383,6 @@ class TTkTreeWidget(TTkTableView):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/TTkWidgets/widget.html b/TTkWidgets/widget.html
index 4729d966..9e3df447 100644
--- a/TTkWidgets/widget.html
+++ b/TTkWidgets/widget.html
@@ -214,7 +214,7 @@ class TTkWidget(TMouseEvents,TKeyEvents):
for child in item.zSortedItems:
ix, iy, iw, ih = item.geometry()
# child outside the bound
- if ix+iw < lx and ix > lx+lw and iy+ih < ly and y > ly+lh: continue
+ if ix+iw < lx and ix > lx+lw and iy+ih < ly and iy > ly+lh: continue
# Reduce the bound to the minimum visible
bx = max(ix,lx)
by = max(iy,ly)
@@ -226,15 +226,6 @@ class TTkWidget(TMouseEvents,TKeyEvents):
''' .. caution:: Don't touch this! '''
TTkWidget._paintChildCanvas(self._canvas, self.rootLayout(), self.rootLayout().geometry())
- def paintNotifyParent(self):
- ''' .. caution:: Don't touch this! '''
- parent = self._parent
- while parent is not None:
- parent._canvas.clean()
- parent.paintEvent()
- parent.paintChildCanvas()
- parent = parent._parent
-
def moveEvent(self, x: int, y: int):
''' Event Callback triggered after a successful move'''
pass
@@ -508,15 +499,6 @@ class TTkWidget(TMouseEvents,TKeyEvents):
self._minw = minw
self.update(updateLayout=True, updateParent=True)
- #@staticmethod
- #def _showHandle(layout):
- # for i in range(layout.count()):
- # item = layout.itemAt(i)
- # if isinstance(item, CuWidgetItem) and not item.isEmpty():
- # item.widget().show()
- # elif isinstance(item, CuLayout):
- # CuWidget._showHandle(item)
-
@staticmethod
def _propagateShowToLayout(layout):
''' .. caution:: Don't touch this! '''
@@ -541,15 +523,6 @@ class TTkWidget(TMouseEvents,TKeyEvents):
self._canvas.show()
self._propagateShow()
- #@staticmethod
- #def _hideHandle(layout):
- # for i in range(layout.count()):
- # item = layout.itemAt(i)
- # if isinstance(item, CuWidgetItem) and not item.isEmpty():
- # item.widget().hide()
- # elif isinstance(item, CuLayout):
- # CuWidget._hideHandle(item)
-
@pyTTkSlot()
def hide(self):
if not self._visible: return
@@ -860,7 +833,7 @@ class TTkWidget(TMouseEvents,TKeyEvents):
for child in item.zSortedItems:
ix, iy, iw, ih = item.geometry()
# child outside the bound
- if ix+iw < lx and ix > lx+lw and iy+ih < ly and y > ly+lh: continue
+ if ix+iw < lx and ix > lx+lw and iy+ih < ly and iy > ly+lh: continue
# Reduce the bound to the minimum visible
bx = max(ix,lx)
by = max(iy,ly)
@@ -872,15 +845,6 @@ class TTkWidget(TMouseEvents,TKeyEvents):
''' .. caution:: Don't touch this! '''
TTkWidget._paintChildCanvas(self._canvas, self.rootLayout(), self.rootLayout().geometry())
- def paintNotifyParent(self):
- ''' .. caution:: Don't touch this! '''
- parent = self._parent
- while parent is not None:
- parent._canvas.clean()
- parent.paintEvent()
- parent.paintChildCanvas()
- parent = parent._parent
-
def moveEvent(self, x: int, y: int):
''' Event Callback triggered after a successful move'''
pass
@@ -1154,15 +1118,6 @@ class TTkWidget(TMouseEvents,TKeyEvents):
self._minw = minw
self.update(updateLayout=True, updateParent=True)
- #@staticmethod
- #def _showHandle(layout):
- # for i in range(layout.count()):
- # item = layout.itemAt(i)
- # if isinstance(item, CuWidgetItem) and not item.isEmpty():
- # item.widget().show()
- # elif isinstance(item, CuLayout):
- # CuWidget._showHandle(item)
-
@staticmethod
def _propagateShowToLayout(layout):
''' .. caution:: Don't touch this! '''
@@ -1187,15 +1142,6 @@ class TTkWidget(TMouseEvents,TKeyEvents):
self._canvas.show()
self._propagateShow()
- #@staticmethod
- #def _hideHandle(layout):
- # for i in range(layout.count()):
- # item = layout.itemAt(i)
- # if isinstance(item, CuWidgetItem) and not item.isEmpty():
- # item.widget().hide()
- # elif isinstance(item, CuLayout):
- # CuWidget._hideHandle(item)
-
@pyTTkSlot()
def hide(self):
if not self._visible: return
@@ -1802,27 +1748,6 @@ ths need to be overridden in the widget.
pass
-
-def paintNotifyParent(self)
-
-
-
-
Caution: Don't touch this!
-
-
-
-Expand source code
-
-def paintNotifyParent(self):
- ''' .. caution:: Don't touch this! '''
- parent = self._parent
- while parent is not None:
- parent._canvas.clean()
- parent.paintEvent()
- parent.paintChildCanvas()
- parent = parent._parent
-
-
def parentWidget(self)
@@ -2327,7 +2252,6 @@ def show(self):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
parentWidget
pos
raiseWidget
diff --git a/TTkWidgets/window.html b/TTkWidgets/window.html
index ef278382..dc32400c 100644
--- a/TTkWidgets/window.html
+++ b/TTkWidgets/window.html
@@ -305,7 +305,6 @@ class TTkWindow(TTkResizableFrame):
moveEvent
paintChildCanvas
paintEvent
-paintNotifyParent
removeWidget
resize
resizeEvent
diff --git a/libbpytop/colors.html b/libbpytop/colors.html
index 8a0bb706..9dc65761 100644
--- a/libbpytop/colors.html
+++ b/libbpytop/colors.html
@@ -57,6 +57,7 @@ except Exception as e:
from TermTk.libbpytop.term import Term
from TermTk.TTkCore.constant import TTkK
from TermTk.TTkCore.cfg import TTkCfg
+from TermTk.TTkCore.log import TTkLog
# Ansi Escape Codes:
@@ -99,7 +100,7 @@ class Color:
else:
color = f'{Color.truecolor_to_256(rgb=(int(hexa[1:3], base=16), int(hexa[3:5], base=16), int(hexa[5:7], base=16)), depth=depth)}'
except ValueError as e:
- ttk.TTkLog.error(f'{e}')
+ TTkLog.error(f'{e}')
else:
if TTkCfg.color_depth is TTkK.DEP_24:
@@ -185,7 +186,7 @@ class Color:
else:
color = f'{Color.truecolor_to_256(rgb=(int(hexa[1:3], base=16), int(hexa[3:5], base=16), int(hexa[5:7], base=16)), depth=depth)}'
except ValueError as e:
- ttk.TTkLog.error(f'{e}')
+ TTkLog.error(f'{e}')
else:
if TTkCfg.color_depth is TTkK.DEP_24:
@@ -260,7 +261,7 @@ def escape_color(hexa: str = "", r: int = 0, g: int = 0, b: int = 0, dep
else:
color = f'{Color.truecolor_to_256(rgb=(int(hexa[1:3], base=16), int(hexa[3:5], base=16), int(hexa[5:7], base=16)), depth=depth)}'
except ValueError as e:
- ttk.TTkLog.error(f'{e}')
+ TTkLog.error(f'{e}')
else:
if TTkCfg.color_depth is TTkK.DEP_24:
diff --git a/libbpytop/input.html b/libbpytop/input.html
index 4533d972..d9e886d4 100644
--- a/libbpytop/input.html
+++ b/libbpytop/input.html
@@ -50,7 +50,7 @@ from select import select
from time import time, sleep, strftime, localtime
from typing import TextIO, List, Set, Dict, Tuple, Optional, Union, Any, Callable, ContextManager, Iterable, Type, NamedTuple
-try: import fcntl, termios, tty, pwd
+try: import fcntl, termios, tty
except Exception as e:
print(f'ERROR: {e}')
exit(1)