Combobox in TTkTable #536
Replies: 6 comments 7 replies
|
unfortunately the table does not supports widgets the same way the tree does (you cannot place a widget in the table), but you can create a custom data type which will open a combobox when edited (doubleclick or space when selected) |
|
Is it something like this you are looking for? Screen.Recording.2025-12-04.at.00.00.46.movI made a demo but I need to refine it and add few more use cases, |
|
Finally I added support for lists and booleans in #546 Screen.Recording.2025-12-14.at.13.21.28.002.movjust pull the latest with: pip install --upgrade git+https://github.com/ceccopierangiolieugenio/pyTermTk.git#subdirectory=libs/pyTermTkand run test.ui.032.table.15.list.item.py python tests/t.ui/test.ui.032.table.15.list.item.py(purtroppo un trasloco e una restrutturazione allungano i tempi1) |
|
The easiest thing right now is to use a list ('yes','no'), unfortunately it is not possible to subclass the boolean, it would have been very handy. But I can check if I can extend it with enum, so you can define an Enum and have an option for it, that would be interesting. |
|
Added enum support here #548 You can define a custom enum and use it in the table: class MyEnum(Enum):
Foo=auto()
Bar=auto()
Baz=auto()
def __str__(self):
return self.name
class MyEnumYesNo(Enum):
Yes=True
No=False
def __str__(self):
return self.name
def __bool__(self):
return self.value |
|
you can have a look at this example: |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
can you suggest me the best wayt to use a combobox in certain column cells (or single cells) of a table?
Thx in advance
Luca
All reactions