Docs for release 3.10.2, 1.2.2.... Post-release fix for table scrolling
This commit is contained in:
parent
c2fb118e5e
commit
fcd23f1a6e
|
@ -3985,6 +3985,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
element.TooltipObject = ToolTip(element.TKScale, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element.TKScale, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
# ------------------------- TABLE element ------------------------- #
|
# ------------------------- TABLE element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_TABLE:
|
elif element_type == ELEM_TYPE_TABLE:
|
||||||
|
frame = tk.Frame(tk_row_frame)
|
||||||
|
|
||||||
height = element.NumRows
|
height = element.NumRows
|
||||||
if element.Justification == 'left':
|
if element.Justification == 'left':
|
||||||
anchor = tk.W
|
anchor = tk.W
|
||||||
|
@ -4012,7 +4014,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.DisplayRowNumbers: # if display row number, tack on the numbers to front of columns
|
if element.DisplayRowNumbers: # if display row number, tack on the numbers to front of columns
|
||||||
displaycolumns = ['Row',] + displaycolumns
|
displaycolumns = ['Row',] + displaycolumns
|
||||||
column_headings = ['Row',] + element.ColumnHeadings
|
column_headings = ['Row',] + element.ColumnHeadings
|
||||||
element.TKTreeview = ttk.Treeview(tk_row_frame, columns=column_headings,
|
element.TKTreeview = ttk.Treeview(frame, columns=column_headings,
|
||||||
displaycolumns=displaycolumns, show='headings', height=height, selectmode=element.SelectMode)
|
displaycolumns=displaycolumns, show='headings', height=height, selectmode=element.SelectMode)
|
||||||
treeview = element.TKTreeview
|
treeview = element.TKTreeview
|
||||||
if element.DisplayRowNumbers:
|
if element.DisplayRowNumbers:
|
||||||
|
@ -4043,12 +4045,15 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
# scrollable_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both')
|
# scrollable_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both')
|
||||||
treeview.bind("<<TreeviewSelect>>", element.treeview_selected)
|
treeview.bind("<<TreeviewSelect>>", element.treeview_selected)
|
||||||
|
|
||||||
scrollbar = tk.Scrollbar(tk_row_frame)
|
|
||||||
|
|
||||||
|
scrollbar = tk.Scrollbar(frame)
|
||||||
scrollbar.pack(side=tk.RIGHT, fill='y')
|
scrollbar.pack(side=tk.RIGHT, fill='y')
|
||||||
scrollbar.config(command=treeview.yview)
|
scrollbar.config(command=treeview.yview)
|
||||||
|
|
||||||
treeview.configure(yscrollcommand=scrollbar.set)
|
treeview.configure(yscrollcommand=scrollbar.set)
|
||||||
element.TKTreeview.pack(side=tk.LEFT,expand=True, padx=0, pady=0, fill='both')
|
element.TKTreeview.pack(side=tk.LEFT,expand=True, padx=0, pady=0, fill='both')
|
||||||
|
frame.pack(side=tk.LEFT,expand=True, padx=0, pady=0, fill='both')
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
# ------------------------- Tree element ------------------------- #
|
# ------------------------- Tree element ------------------------- #
|
||||||
|
|
|
@ -1401,10 +1401,10 @@ class Image(Element):
|
||||||
if filename is not None:
|
if filename is not None:
|
||||||
image = tk.PhotoImage(file=filename)
|
image = tk.PhotoImage(file=filename)
|
||||||
elif data is not None:
|
elif data is not None:
|
||||||
if type(data) is bytes:
|
# if type(data) is bytes:
|
||||||
image = tk.PhotoImage(data=data)
|
image = tk.PhotoImage(data=data)
|
||||||
else:
|
# else:
|
||||||
image = data
|
# image = data
|
||||||
else: return
|
else: return
|
||||||
width, height = image.width(), image.height()
|
width, height = image.width(), image.height()
|
||||||
self.tktext_label.configure(image=image, width=width, height=height)
|
self.tktext_label.configure(image=image, width=width, height=height)
|
||||||
|
@ -2319,14 +2319,16 @@ class Table(Element):
|
||||||
|
|
||||||
def Update(self, values=None):
|
def Update(self, values=None):
|
||||||
if values is not None:
|
if values is not None:
|
||||||
self.TKTreeview.delete(*self.TKTreeview.get_children())
|
children = self.TKTreeview.get_children()
|
||||||
for i, value in enumerate(self.Values):
|
for i in children:
|
||||||
|
self.TKTreeview.detach(i)
|
||||||
|
self.TKTreeview.delete(i)
|
||||||
|
children = self.TKTreeview.get_children()
|
||||||
|
# self.TKTreeview.delete(*self.TKTreeview.get_children())
|
||||||
|
for i, value in enumerate(values):
|
||||||
if self.DisplayRowNumbers:
|
if self.DisplayRowNumbers:
|
||||||
value = [i] + value
|
value = [i] + value
|
||||||
id = self.TKTreeview.insert('', 'end', text=value, values=value, tag=i % 2)
|
id = self.TKTreeview.insert('', 'end', text=i, iid=i+1, values=value, tag=i % 2)
|
||||||
if i == 4:
|
|
||||||
break
|
|
||||||
|
|
||||||
if self.AlternatingRowColor is not None:
|
if self.AlternatingRowColor is not None:
|
||||||
self.TKTreeview.tag_configure(1, background=self.AlternatingRowColor)
|
self.TKTreeview.tag_configure(1, background=self.AlternatingRowColor)
|
||||||
self.Values = values
|
self.Values = values
|
||||||
|
@ -2334,15 +2336,7 @@ class Table(Element):
|
||||||
|
|
||||||
def treeview_selected(self, event):
|
def treeview_selected(self, event):
|
||||||
selections = self.TKTreeview.selection()
|
selections = self.TKTreeview.selection()
|
||||||
self.SelectedRows = [int(x[1:], 16)-1 for x in selections]
|
self.SelectedRows = [int(x)-1 for x in selections]
|
||||||
# ttk.Treeview.selection
|
|
||||||
# print(select)
|
|
||||||
# self.TKTreeview.TreeSelection.get_selected_rows()
|
|
||||||
#
|
|
||||||
# iid = self.TKTreeview.focus()
|
|
||||||
# # item = self.Values[iid]
|
|
||||||
# print('Selected item iid: %s' % iid)
|
|
||||||
# #self.process_directory(iid, path)
|
|
||||||
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
@ -2672,6 +2666,10 @@ class Window(object):
|
||||||
self.TimerCancelled = False
|
self.TimerCancelled = False
|
||||||
self.TKAfterID = self.TKroot.after(timeout, self._TimeoutAlarmCallback)
|
self.TKAfterID = self.TKroot.after(timeout, self._TimeoutAlarmCallback)
|
||||||
self.TKroot.mainloop()
|
self.TKroot.mainloop()
|
||||||
|
try:
|
||||||
|
self.TKroot.after_cancel(self.TKAfterID)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self.TimerCancelled = True
|
self.TimerCancelled = True
|
||||||
if self.RootNeedsDestroying:
|
if self.RootNeedsDestroying:
|
||||||
self.TKroot.destroy()
|
self.TKroot.destroy()
|
||||||
|
@ -3437,7 +3435,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
col_frame = tk.Frame(tk_row_frame)
|
col_frame = tk.Frame(tk_row_frame)
|
||||||
PackFormIntoFrame(element, col_frame, toplevel_form)
|
PackFormIntoFrame(element, col_frame, toplevel_form)
|
||||||
|
|
||||||
col_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1])
|
col_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both')
|
||||||
if element.BackgroundColor != COLOR_SYSTEM_DEFAULT and element.BackgroundColor is not None:
|
if element.BackgroundColor != COLOR_SYSTEM_DEFAULT and element.BackgroundColor is not None:
|
||||||
col_frame.configure(background=element.BackgroundColor, highlightbackground=element.BackgroundColor, highlightcolor=element.BackgroundColor)
|
col_frame.configure(background=element.BackgroundColor, highlightbackground=element.BackgroundColor, highlightcolor=element.BackgroundColor)
|
||||||
# ------------------------- TEXT element ------------------------- #
|
# ------------------------- TEXT element ------------------------- #
|
||||||
|
@ -4047,7 +4045,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
for i, value in enumerate(element.Values):
|
for i, value in enumerate(element.Values):
|
||||||
if element.DisplayRowNumbers:
|
if element.DisplayRowNumbers:
|
||||||
value = [i] + value
|
value = [i] + value
|
||||||
id = treeview.insert('', 'end', text=value, values=value, tag=i%2)
|
id = treeview.insert('', 'end', text=value, iid=i+1, values=value, tag=i%2)
|
||||||
if element.AlternatingRowColor is not None:
|
if element.AlternatingRowColor is not None:
|
||||||
treeview.tag_configure(1, background=element.AlternatingRowColor)
|
treeview.tag_configure(1, background=element.AlternatingRowColor)
|
||||||
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT:
|
if element.BackgroundColor is not None and element.BackgroundColor != COLOR_SYSTEM_DEFAULT:
|
||||||
|
@ -4057,6 +4055,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
# scrollable_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both')
|
# scrollable_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both')
|
||||||
treeview.bind("<<TreeviewSelect>>", element.treeview_selected)
|
treeview.bind("<<TreeviewSelect>>", element.treeview_selected)
|
||||||
|
|
||||||
|
scrollbar = tk.Scrollbar(tk_row_frame)
|
||||||
|
scrollbar.pack(side=tk.RIGHT, fill='y')
|
||||||
|
scrollbar.config(command=treeview.yview)
|
||||||
|
|
||||||
|
treeview.configure(yscrollcommand=scrollbar.set)
|
||||||
element.TKTreeview.pack(side=tk.LEFT,expand=True, padx=0, pady=0, fill='both')
|
element.TKTreeview.pack(side=tk.LEFT,expand=True, padx=0, pady=0, fill='both')
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
## Now supports both Python 2.7 & 3
|
## Now supports both Python 2.7 & 3
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.10.1-red.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.10.2-red.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.2.1-blue.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.2.2-blue.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
||||||
|
|
||||||
|
@ -3638,6 +3638,11 @@ It's official. There is a 2.7 version of PySimpleGUI!
|
||||||
* Window.Minimize will minimize to taskbar
|
* Window.Minimize will minimize to taskbar
|
||||||
* Button background color can be set to system default (i.e. not changed)
|
* Button background color can be set to system default (i.e. not changed)
|
||||||
|
|
||||||
|
### 3.10.2 & 1.2.2
|
||||||
|
Emergency patch release... going out same day as previous release
|
||||||
|
* The timeout timer for the new Read with timer wasn't being properly shut down
|
||||||
|
* The Image.Update method appears to not have been written correctly. It didn't handle base64 images like the other elements that deal with images (buttons)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Upcoming
|
### Upcoming
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
## Now supports both Python 2.7 & 3
|
## Now supports both Python 2.7 & 3
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.10.1-red.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.10.2-red.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.2.1-blue.svg?longCache=true&style=for-the-badge)
|
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.2.2-blue.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
||||||
|
|
||||||
|
@ -3638,6 +3638,11 @@ It's official. There is a 2.7 version of PySimpleGUI!
|
||||||
* Window.Minimize will minimize to taskbar
|
* Window.Minimize will minimize to taskbar
|
||||||
* Button background color can be set to system default (i.e. not changed)
|
* Button background color can be set to system default (i.e. not changed)
|
||||||
|
|
||||||
|
### 3.10.2 & 1.2.2
|
||||||
|
Emergency patch release... going out same day as previous release
|
||||||
|
* The timeout timer for the new Read with timer wasn't being properly shut down
|
||||||
|
* The Image.Update method appears to not have been written correctly. It didn't handle base64 images like the other elements that deal with images (buttons)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Upcoming
|
### Upcoming
|
||||||
|
|
Loading…
Reference in New Issue