I’m trying to create custom button class which inherits from AdwSplitButton:
class SplitButton(Adw.SplitButton):
def __init__(self):
super().__init__()
self.props.label = 'Open'
self.props.tooltip_text = 'Open file'
And i’m getting this error:
/usr/lib/python3.10/site-packages/gi/types.py:217: Warning: cannot derive '__main__+SplitButton' from final parent type 'AdwSplitButton'
_gi.type_register(cls, namespace.get('__gtype_name__'))
Traceback (most recent call last):
File "/home/vlad/Documents/Neutrino/main.py", line 86, in <module>
class SplitButton(Adw.SplitButton):
File "/usr/lib/python3.10/site-packages/gi/types.py", line 226, in __init__
super(GObjectMeta, cls).__init__(name, bases, dict_)
File "/usr/lib/python3.10/site-packages/gi/types.py", line 205, in __init__
cls._type_register(cls.__dict__)
File "/usr/lib/python3.10/site-packages/gi/types.py", line 217, in _type_register
_gi.type_register(cls, namespace.get('__gtype_name__'))
RuntimeError: could not create new GType: __main__+SplitButton (subclass of AdwSplitButton)
I get this with AdwHeaderBar too, but not with GtkHeaderBar or GtkButton.
What am I doing wrong?