How to simulate a Tab key in C ( gtk4 ) ?

I am developping a C application with glade for my embeded device. The ui consists of 3 gtkboxes in a gtkstack.
At each gtkbox there are a few buttons and gtkentries.
The problem is the device hasnot a tab key , nor a mouse. I am going to use a “+” key in replace of the tab key.
Should I attach the EventControllerKey to the gtk_application_window or the three gtkboxes ?
Which properties are needed for the widget(s) ? Is the following code snippet correct ?

GtkEventController * controller = gtk_event_controller_key_new();
gtk_widget_add_controller ( gtk_application_window , controller );
g_signal_connect(
G_OBJECT(controller),
“key-pressed”,
G_CALLBACK( key_pressed_cb ),
gtk_application_window
);
g_signal_connect(
G_OBJECT(controller),
“key-released”,
G_CALLBACK( key_released_cb ),
gtk_application_window
);

One more question : my glade is 3.38.2 , does it mean that it doesnot support gtk4 ? What is the replacement if I want to use gtk4 ?

Glade (whichever version) does not support GTK4, no.

Cambalache is written by the (former) Glade maintainer. You can also write UI definition files by hand, using composite widget templates.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.