Questions tagged [gtk4]

194 questions
0
votes
0 answers

Detect that user presses spacebar GTK4

I am using gtk4-rs to make a GUI app for a music player. I would like to hit spacebar to play/pause songs, so I wanted to detect that a user hit spacebar in the app I tried using EventControllerKey to detect the keypress, e.g. something like…
Colin D
  • 2,822
  • 1
  • 31
  • 38
0
votes
1 answer

GTK4 Vala - show FileChooserDialog

I am playing around with Vala and GTK4. FileChooserDialog is not working for me using Gtk; int main (string[] argv) { // Create a new application var app = new Gtk.Application ("com.example.GtkApplication", …
user1608721
  • 136
  • 1
  • 9
0
votes
0 answers

CLion/pkg-config doesn't recognize GTK4

I'm learning GTK4 and I managed to build an executable from CLion in the past, but it seems that since the last SW update (2022.2.3) it can't find the GTK4 package, and I'm getting this output: ====================[ Build | c_gtk_sandbox | Debug…
meniadin
  • 63
  • 4
0
votes
1 answer

gtk_tree_selection_get_selected_rows method returns list with NULL paths if multiple rows selected

I'm trying to implement function which deletes selected rows in GtkTreeView widget, when button is clicked. The function looks like this: static void delete_selected_rows(GtkButton *activated, GtkTreeView *tree_view) { GtkTreeSelection…
Fedor S
  • 11
  • 2
0
votes
1 answer

error: field ‘parent_instance’ has incomplete type GtkLabel parent_instance;

Problem: I want to make a Gtk.Label child but it seems I cannot make a child of that type. I checked here to find a possible fix, but I cannot get my head around it. What should I do in my case to fix that problem. I basically only want a button…
Vysp3r
  • 37
  • 4
0
votes
0 answers

How to draw using Vulkan on gtk4 widget?

Is there an example of how to run vulkan commands on a gtk4 widget? There are some explanations that it can be done by using Gtk OpenGL widget and then to draw on GL Texture. However, I am not sure how to do it.
kkemic
  • 59
  • 3
0
votes
0 answers

GTK4 Menubar not showing

I'm trying to create a basic menubar. I've tried some sample code found on the internet and nothing seems to work. It all compiles but the menuBar simply doesn't appear when I run the program. The following two pieces of code only produce a blank…
0
votes
1 answer

How to pass 2 or more GTK widget to callback function

I have seen people pass a widget like this static void on_button_click(GtkWidget *button, gpointer data) { gtk_label_set_label(GTK_LABEL(data), "Hello, World!"); } ... g_signal_connect(button, "clicked", G_CALLBACK(on_button_click),…
relimS
  • 3
  • 2
0
votes
2 answers

How do I use GTK4's ColumnView to replace TreeView in Python?

I'm converting a Python (3.10) application from GTK3 to GTK4, and I would like to move away from TreeView/CellRenderer usage, and try to use ColumnView instead. I've read the documentation on GTK4's new list widgets, read their blog post about…
wooly81
  • 15
  • 3
0
votes
1 answer

gtk4 python TreeView values don't show up

I try to create a TreeView in GTK4 using python. I managed to create columns which show up correctly - the generated rows also show up but they show no values as if there was no CellRenderer specified... import gi gi.require_version('Gtk',…
jarinox
  • 45
  • 7
0
votes
1 answer

adding css to gtk4 application

I have a ui definition file as follows: ... and css as follows: #view_header { font: 1.2em bold } Since the class attribute is already used to define the ObjectClass, how do I define a "css…
ferd tomale
  • 845
  • 7
  • 20
0
votes
1 answer

GTK Dialog constructor cannot be used to create instances of a subclass MessageDialog WTF

When I run the following code: dialog = Gtk.MessageDialog.new( None, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, f'Do you really want to {action}…
mijorus
  • 111
  • 1
  • 7
0
votes
1 answer

How do I make my application follow the system theme?

I'm following the standard tutorial for gtk4. A simple hello world application. I compile the program with the given compiler options and run the program. For some reason, the application looks like a gtk3 light-themed application, instead of a gtk4…
0
votes
1 answer

gtk4/rust failed assertion when removing EditableLabel from ListView

In the following gtk4 code, I'm trying to remove an EditableLabel from display by deleting the cooresponding StringObject . This is supposed to happen after editing is complete as specified by the connect_editing_notify callback. If I run the…
Dave Compton
  • 1,421
  • 1
  • 11
  • 18
0
votes
1 answer

Can't run shell command in VTE GTK4 Fake Terminal

I made a small sample code in gtk4 + vte to run a fake terminal with a button in the bottom to run a simple command when the button is clicked. main.c #include #include #define WINDOW_HEIGHT 400 #define WINDOW_WIDTH…