Reproduce GtkButton css Style in a Custom Widget

Hi,

Now, after this gtk blog tutorial, the window populates like this :
Capture d’écran du 2023-02-28 14-44-33
In a GtkGrid, two custom widgets and one button.

After trials with propertys and methods (in GtkWidget, GtkButton, GtkAccessible), window gets this :
Capture d’écran du 2023-02-28 14-43-03
Frame is out with
Gtk.Button.set_has_frame(False)

So, to obtain same stuff than a button, It will be necessary to add frame in the custom widget.
Hope, that nothing wrong.

Now, nothing found about the :hover: css.
Capture d’écran du 2023-02-28 14-43-15

I don’t know what is this highlight when the mousse pointer hovers the button.

And I would know the best way (1 or 2 ?) to obtain this same button highlight style with this custom widgets.

  1. Css like image and text-button.
  2. Methods and property from a Gtk Class

Thanks for your attention,
Thanks too for the example.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.