Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixing listctrl (+ TextEditMixin) editor with height -1 in GTK #849
It's not possible to edit a listctrl cell value, because the editor has height -1. It's possible to see this error in the ListCtrl_edit from wxPython Demo. In the shell it shows this warning message:
What I'm doing here to fix this error is calculating a text height (using self.editor.GetTextExtent('M')) and using this height values and editor height.
I'm not sure that this is the right fix. The -1 was probably intended to indicate "don't change this value" or perhaps "use the default height", however since it is using the
The problem with using the text extent here is that it will only give you the height of the 'M' and won't include any internal margins or borders that the textctrl may be using.
If one of the flags above is not helpful then using
Hi @RobinD42 ,
I've tested with all options you suggested me. I tested using ListCtrl_edit from demo.py. All of them makes GTK show this warning:
Is there a way of get the internal borders and margins to add them to the GetTextExtent('M')?