How to add an image to a button with GTK4?

Viewed 414
2 Answers

gtk_button_set_child (GTK_BUTTON (button), image); where button and image are GtkButton and GtkImage , respectivly .

Gtk.Box box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 5);
box.prepend(new Image.from_icon_name("media-playback-start"));
box.append(new Gtk.Label("Play"));
button.child = box;
Related