8,551 questions
0
votes
1
answer
135
views
How to move widgets in GtkGrid?
I'm currently writing some Gtk with gtk-rs. I'm trying to move widgets in a grid by removing and attaching it, but as I re-attaching the child, it doesn't move at all in UI, although the position ...
0
votes
0
answers
34
views
How to use Gtk.Grid in ags with jsx?
I'm fresh new to ags. I have read about the Gnim documents and figured out the JSX usage. So basically nested jsx tags in a parent tag is like pass children as the prop children of the parent, that's ...
2
votes
1
answer
78
views
How to I resolve undefined reference errors when compiling my application?
here's the issue:
I'm compiling my application in an Ubuntu Docker container; I've compiled in a similar environment before, and can compile on my local machine.
When I compile within the container, ...
Advice
0
votes
1
replies
73
views
Installing GTK4 on Winlibs MinGW-w64 GCC
I have installed on Windows 11 Winlibs MinGW-w64 for the GCC compiler to write C programs. I have the following version:
GCC 15.2.0 (with POSIX threads) + MinGW-w64 14.0.0 (UCRT) - release 7
The ...
0
votes
1
answer
182
views
How to load and display a pdf fiile using gtk and evince
The following mwe fails with message:
file type PDF document is not supported
// gcc pdf_mwe.c -o pdf_mwe `pkg-config --cflags --libs gtk+-3.0 evince-view-3.0 evince-document-3.0`
#include <gtk/...
0
votes
0
answers
25
views
use geany.exe -g to create a gtk tags file does not contain structure
I use a geany 1.37 on Windows to generate the tags file of the gtk3 library
set CFLAGS=-ID:/BuildTools/gtk+-bundle_3.6.4-20130513_win32/include/gtk+-3.0 -ID:/BuildTools/gtk+-bundle_3.6.4-...
3
votes
1
answer
81
views
Forcing widget to the bottom of a vertical box
I'm doing a small Python / Gtk4 program. The layout is relatively simple : there is a upper zone with inputs and a "add" button, then a ColumnView that displays the added items, and finally ...
1
vote
1
answer
81
views
Warning and visual glitch on a simple ColumnView
I'm doing a small Python / Gtk4 program. The layout is relatively simple : there is a upper zone with inputs and a "add" button, then a ColumnView that displays the added items, and finally ...
0
votes
1
answer
39
views
Installing PyGObject + GTK3 with gvsbuild
I'm trying to install PyGObject and GTK3 using gvsbuild by following the steps outlined here:
https://github.com/wingtk/gvsbuild
I've managed to build/install GTK3 with gvsbuild but when I run the ...
0
votes
0
answers
31
views
How to ensure correct widget receives clicks in GTK Broadway
I've built an app in GTK. It runs as expected on multiple machines.
However, when I run it via Broadway (https://docs.gtk.org/gtk4/broadway.html) there's a strange phenomenon:
When you click a ...
2
votes
0
answers
87
views
Undo doesn't emit `notified_changed` signal in a GTK/Python application
I am trying to develop a PyGObject application but experiencing a strange behavior. I’ve created a demo for you to reproduce it. This is the code:
import gi
gi.require_version("Gtk", "4....
4
votes
1
answer
115
views
How does one use GTK Constraints/ConstraintTarget with gtkmm?
Specifically, I am trying to constrain a label to have a width no greater than a (class derived of a) scale. Both are placed within a (class derived of a) grid.
TLDR: How do I pass the widgets as ...
1
vote
2
answers
102
views
Sample simple GTK 3.0 GUI code that compiled fine last week now has numerous header compile errors even on re-installation of the GTX 3.0 libraries
Following the instructions below, last week I was able to compile and run a basic Hello, but this morning I cannot even get the simplest application below to compile:
g++ reallysimple.cpp -o gtk_app '...
3
votes
1
answer
127
views
How GTK draws widgets on title bar?
In GTK based applications it becomes common to put some custom widgets directly inside a window's title bar. How GTK manages to do that behind the scenes? I'm especially interested in its XWindow/X11 ...
4
votes
1
answer
105
views
Problems justifying text in GTK
System: Linux, Language: C, Toolkit: GTK
I am working to create an emulator for an embedded machine's display. The display is a smart 800x400 pixel RGB display.
The machine sends commands to control ...
Advice
0
votes
1
replies
105
views
GTK3 GtkSearchEntry placeholder text CSS selector
What is the GtkSearchEntry placeholder text CSS selector? I know it exists and is undocumented. Been reading the GTK3 source for 2 days now but I can't make heads or tails from it.
I'm styling an ...
0
votes
0
answers
68
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__(...
1
vote
0
answers
54
views
how to manage the lifecycle of a gdk.Pixbuf?
I am dipping my feet into gtk/gdk and golang. I have wirtten a Program creating an image per second by providing a new pixmap to the Image widget via
var theImage *gtk.Image
var nextFrame *gdk.Pixbuf
....
1
vote
1
answer
54
views
Are GTK2 default translations accessible from Python
When using GTK2 with Python, there are some things like 'gtk-yes', 'gtk-open' which help in getting e.g. button names translated to the according user language.
What I am searching for are more of ...
0
votes
0
answers
65
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 ...
0
votes
0
answers
28
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
1
answer
91
views
How to Create a File Tree in GTK-RS/Relm4?
I've been struggling with this for a while, and I've almost got it- but not quite. This is what I have so far:
pub fn load_folder_view(state: &mut State) {
let path = state.current_folder_path....
0
votes
0
answers
64
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 ...
1
vote
1
answer
118
views
How can I remove the border on a GTK tooltip?
I am trying to precisely control the content of a GTK tooltip, but whatever I do, there is always a border remaining.
My real content is much more advanced, but the problem is 100% reproduced with ...
0
votes
1
answer
60
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 ...
0
votes
0
answers
76
views
CMake with vcpkg: find_package(GTK4 REQUIRED CONFIG) fails — GTK4Config.cmake not found
I’m trying to build a simple GTK4 demo project with CMake and vcpkg. I'm on the macOS 15.6.1
vcpkg.json
{
"name": "gtk-demo",
"version": "1.0.0",
"...
0
votes
1
answer
112
views
Package an application using Flatpak that uses `zenity --file-selection` (or the GTK file selection dialog)
I have an application that uses zenity --file-selection to allow the user to select a file using a GUI.
This works very nicely until I package my application using Flatpak, as unfortunatly the ...
0
votes
0
answers
89
views
GTK Attempting To Catch Key Press in Eventbox, Lacking Understanding
I'm trying to modify the popular waybar program (which can be found here). Waybar is a highly customizable status bar that organizes various visual elements into "modules", which can respond ...
0
votes
1
answer
92
views
How to fix Gtk.FileChooserDialogue height and resizing issues?
I am experiencing a strange phenomenon with the Gtk.FileChooserDialogue widget (Gtk3).
I can't get it to appear at the correct height. Output state height is 500px but its height is definitely much ...
1
vote
1
answer
177
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
109
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
91
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
56
views
How to refresh host mountings in flatpack environment?
I'm working on Flatpak Python app, that needs to also interact with some host filesystem elements. While the application is running, another process, running outside of flatpak environment creates new ...
0
votes
0
answers
108
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
1
answer
46
views
GtkTreeStore Subclass, Error When Reloading Plugin
I am working on a plugin written in C using Gtk for a Linux application. I only get errors when attempting to reload the plugin.
So here are the step:
Load plugin - no error
Unload plugin - no error
...
0
votes
0
answers
154
views
Should I build my cross-platform GUI app with static GTK or shared GTK? What are the trade-offs?
I'm building a cross-platform C application with a GTK-based GUI that performs cryptographic functions (like AES encryption/decryption using OpenSSL). I'm developing primarily on Windows using CLion ...
1
vote
0
answers
448
views
cannot update glib2.0 with either apt or source code
I have seen this question, but the problem is a little bit different. I was compiling GTK4 app with the following cmake and got the error
cmake_minimum_required(VERSION 3.0)
project(TestGTK LANGUAGES ...
0
votes
1
answer
185
views
How to install libraries in Code::Blocks on Linux
I recently started using code::blocks on Linux (Linux Mint). I've been trying to install GTK and its dependencies for C++.
I started by downloading each of the dependencies as a .tar.xz file, and then ...
2
votes
1
answer
70
views
Access priv->children in GtkNotebook for debugging (GtkNotebookPrivate)
I am currently debugging an issue where gtk_notebook_remove_page(GTK_NOTEBOOK(nbook), page); is crashing the program.
Looking into the implementation of the function gtk_notebook_remove_page, I have ...
2
votes
1
answer
82
views
Passing more than one variable into G_CALLBACK callback function when signal is triggered
I want to pass additional arguments into a function when using G_CALLBACK, for example this is a simple line of code that will trigger callback_function when the popup button is clicked:
GtkWidget *...
0
votes
1
answer
302
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
65
views
Gedit plugin not showing custom context menu items with Python
I'm developing a Gedit plugin in Python using Gtk. The plugin is supposed to add "🔮 Generate" and "📝 Summarize" items to the right-click context menu in the editor. However, the ...
1
vote
0
answers
62
views
Gtkmm Drag-and-Drop: Value Check Fail in Drop Phase
I am attempting to implement drag-and-drop following the example from the Gtkmm book here:
https://gnome.pages.gitlab.gnome.org/gtkmm-documentation/sec-dnd-example.html
In the DragSource's prepare ...
0
votes
1
answer
65
views
Gtkmm: Drag-n-Drop DropTarget with Bytes Type
I am trying to implement drag-n-drop with Gtkmm4. Inside DragSource's prepare signal callback I return a ContentProvider:
// ...
char* buffer;
gsize length;
file->load_contents(buffer, length);
...
1
vote
2
answers
95
views
How do I read floating point numbers from file when using gtkmm? [closed]
I'm trying to write a gtkmm frontend for a project; it's my first time working with GUI. It seems that reading floating point numbers from files is problematic: I either only get to read the integer ...
0
votes
0
answers
50
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 ...
0
votes
0
answers
39
views
How do I make a GTK (gtkmm) widget look like another?
I am using gtkmm 4 and need to make a subclass of ToggleButton look just like a tab of a Notebook. I have found out that most themes use the selector notebook > header > tabs > tab for those, ...
1
vote
0
answers
66
views
Encountering Segmentation Fault with Gtk Offscreen Window and WebKit2
I would like to retrieve the snapshot of a webview in an application in Linux, and there should be no extra window popping up. Therefore, I decided to use Webkit2 and Gtk Offscreen Window to achieve ...
0
votes
1
answer
172
views
Need to handle gsettings schema in flatpak-builder
I have a Java project that uses Java-GI Gtk/Adw bindings. It uses a maven plugin to generate a .desktop, metainfo.xml and .yml manifest. Then I run flatpak-builder:
flatpak-builder --force-clean --...
1
vote
0
answers
91
views
How do I compile a program with the gtk library?
I installed the gtk library using MSYS2 MINGW64. Gtk files appeared in the folder C:\msys64\mingw64\bin , also added to the PATH "C:\msys64\mingw64\bin ". After that, I created the file &...