Questions tagged [gtk4]

194 questions
0
votes
0 answers

Theme parser error: Expected a valid color

I want to change the color of the "checkmark" icon to blue, but the color does not change. Instead, I get following error: (main.py:23000): Gtk-WARNING **: 15:13:17.402: Theme parser error: style.css:25:58-59: Expected a valid color. My CSS code…
Phoeniqz
  • 23
  • 4
0
votes
1 answer

How to get enter events on widgets in GTK (Rust)

In a Rust GTK application I'm trying to get an enter event on a custom Grid widget and it isn't registering. Using the same handler definition on a Button does get the enter events so I know the setup is basically right. I've looked online. Old…
russell
  • 660
  • 1
  • 10
  • 18
0
votes
1 answer

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 group - 1 x vertical layout, inside are 2 x…
aum hren
  • 13
  • 6
0
votes
1 answer

Triggering code after the window has been shown

I'm using gtk-rs. I want to trigger some code after the window has been shown (has displayed on the screen): window.connect_show(clone!(@weak window => move |_| { let command = format!("sleep 0.1; wmctrl -r \"CSS\" -e 1,640,100,680,768"); …
alexchenco
  • 53,565
  • 76
  • 241
  • 413
0
votes
1 answer

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() so I can do it programaticly, but I'm sure…
russell
  • 660
  • 1
  • 10
  • 18
0
votes
0 answers

In Gtk4 (And libadwaita), how can I exit the Gtk4 loop (Like gtk_main_quit() would)?

I am writing a library that makes use of Gtk4 and libadwaita to show dialogs. While it does work just fine, it will only show one dialog and then hang at a loop without showing anything else. In contrast, when using Gtk3 for the same job, this…
AggelosT
  • 108
  • 1
  • 9
0
votes
0 answers

GTK4 under rust, trying to find which mouse pointer and whether there are modifer keys pressed

I'm writing a gtk4 application in rust, and I'd like to get the mouse key that was clicked and any modifier keys at the time. My GestureClick handler has .buttons(0) to accept input from all buttons, but the event object does not seem to have any…
russell
  • 660
  • 1
  • 10
  • 18
0
votes
0 answers

How to fill gtk4::DropDown with a custom struct typed gio::ListStore?

I want to fill gtk4::DropDown with a custom struct or with basic data types (i32, String, etc.). In Vala language, I did this by defining a class which inherited Object: public class ListItemIdName : Object { public string id {get; set;} …
eminfedar
  • 558
  • 3
  • 16
0
votes
0 answers

How do you get the value of a GTK4 scale in gtk-rs

I am new to GTK and Rust and I am wondering how to get the value of a GTK Scale as the things I have tried have not worked. I was expecting the scale_var.get_value() function in the GTK Docs to work, but I simply get an error saying the function…
lar0ld42
  • 1
  • 3
0
votes
1 answer

What is the gtk-rs design pattern for changing the widgets on a page?

I am using gtk-rs to build a small application and I am struggling with the concept of changing the widgets displayed on a page. So far I have been working through this guide but I have not found the information I am looking for. An example would be…
John554
  • 145
  • 1
  • 7
0
votes
1 answer

How to compile GTK4 application on MacOS without console opening during the launch?

I am compiling my GTK4 application on MacOS using clang or gcc-12 compiler using: clang (or gcc-12) `pkg-config --cflags gtk4` ./src/main.c `pkg-config --libs gtk4` -o ./bin/iViewGtk Unfortunately, when I run the application, it opens the main…
0
votes
1 answer

Why does gtk3 call the ClosureNotify function in the example code, but gkt4 doesn't?

When this example program #include static void draw_func( GtkDrawingArea* drawing_area, cairo_t *cr, #ifdef GTK3 #else int width, int height, #endif gpointer user_data ) { printf("draw!\n"); } struct Ctx { char *text; …
Donald
  • 19
  • 3
0
votes
0 answers

vcpkg installed gtk-4 VS debugger failed with read access violation

I successfully installed gtk:x86-windows 4.6.8 by vcpkg. Then, I created a console application in Visual Studio 2022 on Windows 11 and added additional include directories as…
Ayka
  • 11
  • 1
  • 2
0
votes
0 answers

How do I add an "add" button that adds another row to a GTK ListStore?

fn build_table_view() -> (TreeView, ListStore) { let list_store = ListStore::new(&[glib::Type::STRING].repeat(4)); list_store.n_columns(); let tree_view = TreeView::builder() .hexpand(true) .vexpand(true) …
0
votes
1 answer

The easiest way of drawing an array of pixels in GTK 4.0 in C

I'm trying to find an example of showing an image in GTK 4.0 from an existing memory buffer, where the image is stored in the form of an array of floats of size width x height x 3. I understand I need to use GtkImage, but I don't know how to pass…
Andrew Slabko
  • 690
  • 8
  • 15