Gtk window title setting

How to customize gtk window title bar. I need to add custom buttons and an image in the title bar.alt text

+3
source share
2 answers

You can not. The title bar is displayed by the window manager, not GTK. You can tell the window manager to set the title with window.set_title(), and you can set an icon that may or may not be displayed by the window manager using window.set_icon(), window.set_icon_name()or window.set_icon_from_file(). What about that.

+2
source

Here is a working solution:

#include <gtk/gtk.h>

int main(int argc, char *argv[]) {
    GtkWidget *window;
    gtk_init(&argc, &argv);
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(window), "UV with Y variable");
    gtk_widget_show_all(window);
    gtk_main();
    return 0;
}
0
source

Source: https://habr.com/ru/post/1774941/


All Articles