[Howto] solve “slow starting GTK applications”
problem: GTK applications need 25 seconds to start (info: 25s is the D-bus timeout) solution: uninstall the package xdg-dbus-proxy [edit 2023-09-10] uninstall the package xdg-desktop-portal-gnome
problem: GTK applications need 25 seconds to start (info: 25s is the D-bus timeout) solution: uninstall the package xdg-dbus-proxy [edit 2023-09-10] uninstall the package xdg-desktop-portal-gnome
minimal working example, which creates a GTK-window and displays the first page of the given pdf-file.(compile with command: gcc example.c -o example `pkg-config –cflags –libs gtk+-3.0 poppler poppler-glib`) versions: GTK+ 3.24.23-2 and poppler-20.09.0-2
minimal working example, which creates a GTK-drawing-area and draws ‘Test.’ inside.(compile with command: gcc example.c -o example `pkg-config –cflags –libs gtk+-3.0`) versions: GTK+ 3.24.23-2 and cairo 1.16.0-4
situation:images are binary coded. If you try to interpret/decode them as UTF-8, they can contain UTF-8 invalid characters (e.g. 0xFF) problem:if your database uses the UTF-8 encoding, you can’t save this invalid bytes in this database. (“invalid byte sequence warning”) … Continued
hold-down ‘CTRL+SHIFT+u’, then input the UTF-8 character-code and then press enter.
It is a working example for a button, which changes its color while mouse-over. gtk-version: 3.24.12-1 note: the css-property “background-image: none” is sometimes mandatory, because the default theme prevents displaying the css-defined background-color. The workaround is to set the … Continued
it’s very simple, because you must only define a “sort-column-id” for the column (GTK Version 3.24.5-1) # define sort-column-id for a specific columngtk_tree_view_column_set_sort_column_id(GTK_TREE_VIEW_COLUMN(firstcolumn), 0) This function enables a “clickable column-header” and sorting (default: switches with every click between ascending/descending sortorder) … Continued
problem: every time, when the model-data inside the GTK_TREE_VIEW is changed/updated, the whole view will be recalculated (e.g. auto-sizing of row height and column width). This behaviour can lead to massive cpu load and time consumption, because the recalculation will … Continued
GTK+ 3 example: open filechooser-dialog with 2 buttons, select file, click open, print filename to console, clear filename-memory, close filechooser-dialog GtkWidget *fc_dialog;GtkFileChooser *fc;char *filename;fc_dialog = gtk_file_chooser_dialog_new(“Title”, NULL, GTK_FILE_CHOOSER_ACTION_OPEN, “Abort”, GTK_RESPONSE_CANCEL, “Open”, GTK_RESPONSE_ACCEPT, NULL);gtk_widget_show(fc_dialog);if (gtk_dialog_run(GTK_DIALOG(fc_dialog)) == GTK_RESPONSE_ACCEPT){ fc = GTK_FILE_CHOOSER(fc_dialog); filename … Continued
#!/bin/bash gcc main.c -o main -I/usr/include/gtk-3.0/ \ -I/usr/include/glib-2.0/ \ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ \ -I/usr/include/pango-1.0/ \ -I/usr/include/cairo/ \ -I/usr/include/gdk-pixbuf-2.0/ \ -I/usr/include/atk-1.0/ \ \ -L/usr/lib/x86_64-linux-gnu \ \ -lgtk-3 \ -lgobject-2.0