I have a couple of treeviews
tkinter widgets. For style purposes i need to prevent a manual resizing of the treeview
columns width without totally disableing column resize.
Using a possible solution provided here: How to disable manual resizing of Tkinter's Treeview column? i am catching single click events on separators
between the columns and stop the event there. For this purpose every treeview
binds a handling function.
Example:
self.tree.bind('<Button-1>', lambda event: handle_treeview_single_click(self.tree, event))
def handle_treeview_single_click(tree, event):
if tree.identify_region(event.x, event.y) == 'separator':
return 'break'
Running the code produce the following error:
File "C:\Program Files (x86)\Python27\ArcGIS10.2\lib\lib-tk\ttk.py", line 1277, in identify
return self.tk.call(self._w, "identify", component, x, y)
TclError: bad component "region": must be row or column
this doesn't change regardless the object i click on (Header, cell or separator). For example the relating parameter look like this:
tree = Treeview: .42424440.47830640.47831440.47831800.47831840
x = 464
y = 14
Not sure what im missing here, even more since im fairly new to python.