369 questions
0
votes
1
answer
206
views
How properly pass to gtk4 arguments value?
I am trying pass argv value to label of buttons, but it's working unpredictable way
in the following program, use gtk_init(); for argv and argc, but incrementing working wrong way, address doesn't ...
1
vote
1
answer
260
views
How do I obtain a refernce to widgets in Relm4 Component?
I'm building an app using the Relm4 SimpleComponent / Component macro. It works great. But I don't understand how can I refer to the generated GTK widgets later?
My understanding is that the ...
3
votes
3
answers
271
views
how to get the state of a grouped gtk.CheckButton using Action
I'm trying to get the state of a gtk.CheckButton using Action since gtk docs says:
When the code must keep track of the state of a group of radio buttons, it is recommended to keep track of such ...
0
votes
1
answer
529
views
Connect handler to insert-text signal in GTK4
I'm trying to display something each time the user inserts something in an Entry widget. For instance, I have the following callback:
void entry_text_inserted (GtkEditable* self, gchar* text, gint ...
0
votes
0
answers
62
views
Gtk::ComboBoxText select item with mouse on dropdown macOS Ventura 13.2.1 Gtkmm4
I have added a simple ComboBoxText widget to my programm, but I am unable to select any of the drop-down options with my mouse by clicking on the drop-down. I can however use my keyboard arrows and ...
1
vote
1
answer
2k
views
How to create a TreeView-like UI using ColumnView in GTK4?
Google says use ColumnView, because TreeView is deprecated. But how to create a UI like this with ColumnView of GTK4? Gnome Files seems to be able to do that, but I am not sure if they are using ...
1
vote
1
answer
135
views
GTK4 ScrolledWindow renders content unreadable
I am learning GTK4 and Python. While playing round with the Gtk.StackSidebar class, I came across this strange behavior that I cannot seem to figure out.
I want my sidebar on the left, and my content ...
0
votes
1
answer
125
views
Render on click on the GLArea (Glium backend)
I want to perform a render on click event on the GLArea. The problem is that when I call the drawing method from the event handler, the "canvas" does not change.
There is the my_draw_func() ...
2
votes
1
answer
171
views
Button.set_hexpand(false) doesn't stop button from expanding
I am building a GUI Application using GTK4.8.3. I want two ScrolledWindows where one (containing a ListBox) can expand horizontally and the other (containing a Button) cannot. More precisely, I want ...
0
votes
1
answer
227
views
how can I get underlined text using gtk4 css in C?
This is the relevant part of the code:
btn1 = gtk_button_new_with_label("one");
gtk_grid_attach (GTK_GRID (grid_ptr), btn1, 0, 1, 1, 1);
gtk_widget_set_name ( btn1, "btn1");
...
6
votes
1
answer
2k
views
How to use eventcontroller in gtk4
I would like to add onclick event handling to a GtkBox widget. I see that only GtkButton has clicked signal, so I feel like the only option is to attach a GtkEventController to my widget.
As per the ...
1
vote
0
answers
21
views
error: G_TEST_SUBPROCESS_DEFAULT undeclared when building gtkmm-4.0
I was trying to install gtkmm-4.0 and since my distro only ships gtkmm-3.0 I decided to build myself.
Installed all the dependencies from the official gtkmm installation website and gave it a go.
...
0
votes
1
answer
34
views
What is the pie chart in Nautilus when copying for a widget
I am developing a Python program with a GTK4 GUI and would like to use the pie chart which is also displayed in Nautilus when copying files etc.
Can anyone tell me if this is a standard GUI element ...
0
votes
1
answer
100
views
Textview and some buttons in column GTK
I'm trying to create a layout with an text view and in the 2nd column 4 buttons aligned vertically. I tried reading documentation but the window isn't rendered or button stay aligned horizontally.
<...
0
votes
0
answers
87
views
1) gtk/gtk.h: No such file or directory
I am facing an issue in gtk 4 with MSYS2 and c language in VS-code, it shows an error of : gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
int main (int argc, char **argv)
{
...
4
votes
1
answer
2k
views
On wayland, why is my default Gtk display an X11Display?
I'm learning GTK4 and working with wayland (hyprland) on linux.
When I try to retrieve the default display, my python code returns an X11Display.
I figured out that the GDK_BACKEND environment ...
1
vote
0
answers
432
views
How to get GTK4 video playback using gtk_media_file_new_for_input_stream?
I'm trying to write a GTK4 app using python with an embedded media player to use for streaming.
Here's what I have now:
def async_run(func, *args):
thread = Thread(target=func, args=args)
...
1
vote
1
answer
311
views
GTK Button constrain proportions
I have a bunch of GTK buttons in a GTK Flowbox, and am using the CSS border-radius property to make them round and background-image for the background. Unfortunately, they then appear as ovals, as in ...
0
votes
2
answers
329
views
GTK how to increase Grid cell width and height
The following code creates a grid of cat icons, using the cat.jpg file below.
static void make_toggles(GtkWidget * window) {
GtkWidget *stop_grid, vpaned;
int i;
stop_grid = gtk_grid_new();...
0
votes
0
answers
293
views
How to use GtkPopoverMenuBar in GTK4?
Currently, I'm trying to use GtkPopoverMenuBar widget in a GTK4 app in C, based on the tutorial listed here: https://toshiocp.github.io/Gtk4-tutorial/sec17.html
Here's the current code I have:
#...
0
votes
1
answer
124
views
Why Vala Compiler Throws Errors When Using Question Mark (?) Operator?
I tried to build G4Music (https://gitlab.gnome.org/neithern/g4music) following its instructions but I got many syntax errors.
As you can see GTK-4.0 is marked as not found. However I have installed ...
1
vote
0
answers
111
views
Upcasting a widget
In a Rust GTK4 application, an event handler needs to send a message to its root, which is a subclass of ApplicationWindow. I can get the root in the handler by "button.property("root")....
0
votes
1
answer
349
views
How to draw_area with cairo
i am trying to 'update' lgi (lua gtk binding) examples, which are for gtk3
purpose is to draw geocentric view of solar system, in 2d, for start
app has top row for input, below are
2 x 2 panned widget ...
0
votes
1
answer
72
views
In GTK4 template, how can the limits be set for a spin button?
Simple questionL in a program using GTK4, how can I set the limits for a spin button in the template file? The doc does not list a property or attribute that seems related. There is a method set_range(...
2
votes
1
answer
729
views
Get children from ListBox (gtk4)
When I was using gtk3 I was able to access a ListBox's children this way:
let list_box = ListBox::new();
let label = Label::new(Some("Label 1"));
list_box.append(&label);
for row in ...