Search code examples
pythonkivykivy-language

Kivy use multiple classes


I'm creating a GUI for my rubik's cube solver.

My code:

<SelectableRecycleBoxLayout@RecycleBoxLayout+FocusBehavior+LayoutSelectionBehavior>:

<ListViewer>:
    viewclass: 'SelectableLabel'
    SelectableRecycleBoxLayout:
        default_size: None, 30
        default_size_hint: 1, None
        size_hint_y: None
        height: self.minimum_height
        orientation: 'vertical'
        multiselect: False
        touch_multiselect: True

Somewhere in my GUI i have a RecyclableView (ListViewer). In the ListViewer I use "SelectableRecycleBoxLayout" which inherits from RecycleBoxLayout, FocusBehavior and LayoutSelectionBehavior. But I only use SelectableRecycleBoxLayout once.

Is there a way to remove "SelectableRecycleBoxLayout" and use the 3 classes all at once.

like:

<ListViewer>:
    viewclass: 'SelectableLabel'
    RecycleBoxLayout+FocusBehavior+LayoutSelectionBehavior:
        default_size: None, 30
        default_size_hint: 1, None
        size_hint_y: None
        height: self.minimum_height
        orientation: 'vertical'
        multiselect: False
        touch_multiselect: True

Solution

  • Not inline, no. Of course, you could define the SelectableRecycleBoxLayout class in Python, but I don't think that's what you're asking.