Is it possible to remove or change button borders for Gtk4 buttons?
The buttons have borders as shown here:
My intention is to create a list of Buttons in a vertical box that are clickable for their clicked signal. Based on the doc for a Button I don't see a way to actually remove the borders.
This is the current structure of the Button.
class MyButton(Gtk.Button):
def __init__(self):
super().__init__()
label = Gtk.Label()
label.set_label("Hello")
self.set_hexpand(True)
self.set_child(label)
I have tried using the set_property method from Gobject.Object that Button inherited from. Using the method with margin worked fine (As in no excpetions being raised), but using border or border-with would raise a TypeError telling that the object doesn't have the property border or border-width.
...
self.set_property("border-width", 0)
# TypeError: object of type `__main__+MyButton' does not have property `border-width'
I have found solutions on SO, but they are extremely outdated and for much older versions of Gtk, so they didn't provide any help on the subject.
Is Gtk just not suitable for this? Is there any other alternative approaches?
