370 questions
Advice
0
votes
0
replies
29
views
Is there any way to use theme colors in a Gtk4 DrawingArea?
In Gtk4, I want to plot something into a DrawingArea, and want the colors to depend on the theme. Since StyleContext is now deprecated from Gtk 4.10, how could this be achieved?
Gtk docs simply say &...
0
votes
0
answers
37
views
GTK4 with gtksourceview5 in C: How do i change the style of the current highlighted line?
I tried using the GTK inspector to try and find the correct css node for but to no avail
I tried every selector i could think of like
.GtkSourceView.sourceview.view text .current-line
or even ...
-1
votes
1
answer
58
views
CL-CFFI-GTK: Is there a way to avoid FLOATING-POINT-INVALID-OPERATION?
About three years ago I tried to follow the GTK3 tutorial for Common Lisp. I had different problems then, but many of the examples worked without any complains.
Now I took the time to reconsider it, ...
1
vote
1
answer
104
views
GTK4 App in Rust: How to add application icon (gresource)?
I have started developing a small app in Rust using GTK4 bindings on Linux Mint.
I have created the following resources.gresource.xml in the project directory:
<?xml version="1.0" ...
4
votes
1
answer
36
views
AdwViewSwitcherBar(Python) shows just page1. A simple working example?
I don't get any errors.
There is just page 1 visible without the switcher...
Tried on 2 different machines running Fedora.
Already checked api.pygobject.gnome.org and asked the stupid ai.
Can someone ...
0
votes
0
answers
54
views
When can I reliably query the preferred size of a GTK4 Entry upon
I have the following PyGObject code as an MWE:
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk, GLib
class FontSizeApp(Gtk.Application):
def __init__(...
0
votes
0
answers
50
views
Linter Errors When Overriding Container's orientation Methods in Python GTK4
Problem Statement
I'm subclassing Gtk4 container widgets so I can add functionality to various property changes. For this question I'll use set_orientation from Gtk.Box and the Gtk.Orientable ...
1
vote
1
answer
52
views
GTK4 Run-time errors setting label text in a callback
I have a simple GTK4 C program that displays a dropdown with 3 choices and a label. The callback for the dropdown notify::selected-item event passes the label as the 2nd argument.
The callback is ...
0
votes
1
answer
32
views
Custom symbolic icons in gtk4 not rendering in appimage
When I make an appimage of my simple gtk4 application and run it on certain distros like fedora the svg icons don't render properly. It looks like this: https://i.imgur.com/3cKKkjx.png
The basic code ...
0
votes
0
answers
17
views
gtk4-rs dispose_template dispose doesn't dispose non-bound widgets
Dispose tempalte disposes only bound widgets. Is there a way to dispose all children graph?
Here are the details.
Object implementation:
#[derived_properties]
impl ObjectImpl for MyWidget {
...
0
votes
0
answers
43
views
GTK4 Grid - remove spacing between rows
I have created GTK Grid using gtk_grid_new and set both column and row spacing to 0 (gtk_grid_set_column_spacing and gtk_grid_set_row_spacing), however for some reason I still get 1px spacing between ...
2
votes
1
answer
91
views
Catch mouse enter and leave signals from AppplicationWindow in GTK4 Python
I'm creating a Gtk4 app in python 3 and I want to trigger a state change when the user mouses over the ApplicationWindow but I'm banging my head against a wall trying to figure out what signal string ...
0
votes
1
answer
54
views
How do I pass through the click on a GtkEditableLabel to the GtkColumnView row containing it?
I have a Gtk.ColumnView where cells are represented by Gtk.EditableLabels. Keyboard navigation works fine, clicking in the cells to edit them works fine, tab navigation
works fine.
However, clicking ...
1
vote
0
answers
45
views
Not seeing webview within webkitgtk-6.0 when embedded with gtk box?
Whenever I use a GtkBox to hold a WebKitWebView, it does not display on screen. However when directly appending the WebKitWebView as the child of the window, it does.
This works:
GtkWidget *...
1
vote
1
answer
96
views
:hover style is applied to button's label instead of button in gtk4 css
I have a css file like this in a gtk4 application. I am expecting the GtkButton to change its color when the mouse hovered over it.
headerbar button {
border-radius: 20px;
border-style: none;
...
1
vote
0
answers
95
views
How do you apply transformations to an arbitrary GTK widget which will not trigger layout recomputations?
Since GTK's CSS implementation doesn't support transform: property for arbitrary widgets, you have to do it other ways. E.g., you can apply a GskTransform to a widget, but unfortunately it only works ...
0
votes
0
answers
66
views
How to keep gtk4 app open without monitor
When I turn off monitor (by power button), my gtk4 app gets closed with no output and return code 0. From what I've read, it might be some interaction between wayland and gtk4, but I've found no fix ...
0
votes
0
answers
95
views
I am getting a blank black window when I run the rust app
I am using gtk4 for building a gui application. However I am facing issue upon running a sample code for testing.
use gtk4 as gtk;
use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow, ...
1
vote
0
answers
108
views
How to listen for many dbus signals
I'm trying to keep number of connected Bluetooth devices by listening for dbus changes.
I can get list of known devices by contacting ObjectManager of Bluez daemon, and keep it in sync by listening ...
0
votes
1
answer
52
views
Unable to create header unit for gtkmm4
Trying to create gtkmm 4 header unit using g++ 15 with:
g++ -std=c++23 -fmodules -fsearch-include-path -fmodule-header gtkmm.h `pkg-config --cflags gtkmm-4.0`
I get the following error:
/usr/...
0
votes
1
answer
146
views
Adwaitia preferences dialog that pops over the application window, rather than poping up within it
I have a GTK4 Adwaita application built with GJS. I'm trying to add a PreferencesDialog that pops up over the ApplicationWindow but blocks interaction with the window, similar to a lot of other ...
0
votes
1
answer
44
views
How to pass a Sender from gtkApplication to gtkWindow?
I am passing the sender of on async channel to a modal window so that the modal window can send messages to the parent window:
...
let (tx, rx): (Sender<ApplicationMessage>, Receiver<...
0
votes
0
answers
63
views
How to use template callback in Rust + GTK4?
I have the following ui for gtk4 and rust:
main_window.ui
....
<template class="MainWindow" parent="GtkApplicationWindow">
<property name="default-width&...
-3
votes
1
answer
111
views
How to show a modal window in gtk4 and Rust?
I have gone through the examples for gtk4 and I am trying to show a 2nd window modally.
I am showing the main window as a composite template and would like to show a dialog that is also a composite ...
1
vote
0
answers
41
views
GTK4 - listen to a custom widget events
Consider a CustomWidget, which contains 3 buttons. This widget is a final class, and its buttons are private.
How is it possible to a widget that holds CustomWidget listen to buttons clicked signal?
...
0
votes
0
answers
39
views
How to Justify (Fill) the Last Line of a Gtk.TextView in GTK4?
I am working on a GTK4 application using Python, and I am trying to justify (fill) the text in a Gtk.TextView. While the text is justified properly for most lines, the last line of the text block is ...
1
vote
1
answer
51
views
dropdown paramspec use
I want to implement a choice with a DropDown, clicking on the DropDown to execute a connect_closure, reading doc I guess the choice is in the paramspec, but I am unable to retrieve the choice in the ...
0
votes
0
answers
36
views
GTK4 application high CPU usage
I'm writing a GTK4 application, and it consumes very high CPU load. Digging in a bit, it turned out that I have enormously high amount of this system call (strace snippet):
recvmsg(14, {msg_namelen=0},...
0
votes
0
answers
51
views
No call to "_finalize" function in GtkTreeListModel
I create an test_object which contains a function _finalize.
G_DECLARE_FINAL_TYPE(TestObject, test_object, TEST, OBJECT, GObject)
....
void test_object_finalize(GObject* object)
{
GObjectClass *...
0
votes
1
answer
114
views
How to create menus in GTK 4 with pygi?
I've googled about this quite a bit. I've put a number of examples of what I tried https://stromberg.dnsalias.org/svn/gtk-4-menu/trunk - I'm going to quote the closest one immediately below in case ...
0
votes
0
answers
64
views
GTKMM 4.18, Gtk::ColumnView headers, manipulate headers, text not bold until hover over, CSS styling behaves differently
To style the headers in a Gtk::ColumnView I had been using CSS to make the headers a fixed width font so that I could crudely centre them. I had also set the font style to bold. I have recently ...
0
votes
0
answers
49
views
How is simple Gtk 4.0 PopoverMenubar created using python3 as example?
Gtk documentation on migrating to Gtk4 mentions that
Tabular menus were rarely used and complicated the menu code, so they have not been brought over to GtkPopoverMenu. If you need complex layout in ...
1
vote
1
answer
69
views
Properly finalizing a GTK4 file filter
(Using GTK 4.8 on Debian)
I created a file filter for specific image suffixes:
GtkFileFilter *file_filter = gtk_file_filter_new ();
gtk_file_filter_add_suffix (file_filter, "png");
...
1
vote
0
answers
70
views
How to drag & drop (move) GtkWindow using GtkGestureLongPress?
I am trying to move GtkWindow via GtkGestureLongPress. I want to implement it in VTE base terminal app. My script is given below. The problem is -
I ran the ping(ping 127.0.0.1) command in the ...
0
votes
0
answers
98
views
Golang: GTK builder does not work with Libadwaita widgets
It seems to be working if only GTK4 widgets are used. If i add libadwaita widgets though the thing builds fine but crashes during runtime. Libadwaita bindings work fine when used without Gtk.Builder
...
1
vote
1
answer
84
views
How to remove selected item from GtkColumnview by clicking Gtkbutton?
I am trying to remove the selected item from a column view. I found this demo script from this site, which was explained by another user for the sort function. It has 2 columns, I want, when I click ...
0
votes
0
answers
84
views
how to implement choose file dialog like windows api GetOpenFileName using gtk4?
I'm going to wrap a function same as windows api: GetOpenFileName using gtk3. However, at some cases, calling gtk_init results in crash.
#include "gtkdlghelper.h"
#include <gtk/gtk.h>
...
0
votes
0
answers
56
views
Touch scrolling causes persistent text field cursor and segmentation fault in entry widgets
I have a sample GTK4 application where a list of entries is arranged vertically in a scrolled window. When I test the application using a mouse by continuously scrolling the window, the app does not ...
1
vote
1
answer
72
views
Why doesn't the child window pop up on top of the parent window?
I am trying to create a preferences window for my app. I want the child-window (preferences) to open above the parent-window (main-window) and in the middle of the parent-window.
But the problem is, ...
1
vote
1
answer
71
views
Why is GtkPopover autohide not working because of this child widget?
I want to use GtkText widget inside GtkPopover. But the problem is, when I try to copy text from GtkText widget by right clicking (via GtkText default context menu); then GtkPopover autohide stops ...
0
votes
2
answers
102
views
How to change the font size of a GtkText widget by applying PangoAttribute?
I am trying to change the font size of a GtkText widget by applying PangoAttribute and changing PangoAttrList. I am also using a GtkSpinButton to update the font size. But the problem is, when i click ...
1
vote
1
answer
63
views
How to add GtkLabel With exit Icon/button on GtkStackSwitcher page?
I am using GtkStackSwitcher and GtkStack widget in gtk4, trying to add window close icon/button and label together in GtkStackSwitcher (page). I tried the demo script below. It is adding the page with ...
0
votes
1
answer
90
views
Why is the document-edit-symbolic icon missing in GTK4 / libadwaita when using Adw.EntryRow?
I'm working with GTK4 and libadwaita, and I'm trying to use an icon with the Adw.EntryRow widget. However, I noticed that the document-edit-symbolic icon seems to be missing.
Here's a simplified code ...
0
votes
1
answer
510
views
getting an error related to virtual:world while compiling a gtk application
I'm learning GTK, and I'm trying to get its hello world example program compile on my ubuntu 24.04 system, but I got this following message:
> gcc $(pkg-config --cflags gtk4) -o hello-world-gtk ...
0
votes
0
answers
70
views
Having issue centering child in gtk4
I'm trying to develop a widget in gtk4 as follows:
let container = Box::new(Orientation::Horizontal, 0);
let workspace_num = Label::new(Some("11"));
let workspace_num_box = gtk4::Box::new(...
2
votes
1
answer
107
views
Test widget GtkColumnView with language C et gtk4.10
based on this exemple
example-columnview-with-strings-gtk4-c
I test this new widget with my data
below a mwe code in order to select part with error
I have an error when I implement 7 callcak "...
1
vote
1
answer
201
views
how to migrate gtk3 to gtk4 gtk_dialog_run
since Gtk 4.10 it's a little difficult to implement an gtk dialog
the only source found is reddit with just an little bug
void
gtk_alert_dialog_set_buttons (
GtkAlertDialog* self,
const char* const* ...
1
vote
2
answers
307
views
How to rotate a widget in Gtk4
I have a Gtk.Label in an app I am working on migrating from Gtk3 to Gtk4. In Gtk3, Label had a set_angle method that allowed rotating a label about its center.
That was removed in Gtk4, but there isn'...
1
vote
0
answers
100
views
How to enable "Input methods" in text view gtk 4.0
I have a special input method installed on my Linux laptop, Chewing from Fcitx 5 for Chinese traditional. But when I type something inside the GtkTextView, only English alphabets appears.
I found ...
1
vote
0
answers
67
views
How can I print webpage to pdf using webkitgtk
I am using webitgtk6
#include <webkit/webkit.h>
Here are printing result functions
static void print_finished(WebKitPrintOperation *operation, gpointer user_data)
{
g_print("Done\n&...