Questions tagged [gtk4]
194 questions
0
votes
0 answers
How to handle window resizes in GTK4?
I am trying to build a virtualized grid container to display 100k+ files in PyGTK 4 on Fedora 35. I succeeded in creating the layout and scrolling support which works beautifully.
In order to support resizing of my application window, I need to…

faubulous
- 1
- 2
0
votes
1 answer
Change style of GtkLabel inside header bar
I am trying to add a GtkLabel to the right of a GtkHeaderBar then change the font weight but I cannot manage to do it.
I have my XML like this:

alexmro
- 563
- 4
- 16
0
votes
1 answer
Method g_input_stream_read_all() is blocked
I'm learning a GTK Library. Now, i'm trying use a GSocketClient. I'm connecting to a telnet-server to read some data. This code
...
GInputStream* istream = g_io_stream_get_input_stream(G_IO_STREAM(scon));
GOutputStream* ostream =…
0
votes
0 answers
How to create GTK+4 Application on mac OS 11?
So, I installed gtk+4 with homebrew. I created .C file and wrote:
// Include gtk
#include
static void on_activate (GtkApplication *app) {
// Create a new window
GtkWidget *window = gtk_application_window_new (app);
// Create a new…

Anton
- 19
- 4
0
votes
1 answer
How to add two buttons to this GTK4 form?
this code show me on xubuntu 21.04 form with size (400px width + 400px height) and with ONE button.
How can I add to this code two buttons?
#include
static void activate(GtkApplication *app, void *user_data) {
GtkWidget *window =…

aleks_yolp
- 17
- 3
0
votes
1 answer
GTK4 Problem setting image from pixbuf with a GtkDropTarget
I am testing a gtk4 widget which is GtkDropTarget. I plan on setting an image which is dragged to the window as the image of the window itself. But errors come up as soon as I drag an image file. To be clear, this is the code in vala:
int main…
0
votes
1 answer
How can i load a GTK4 demo example? (File browser specifically)
To get in context, i am making a GUI application that based on a input command through a GtkEntry like ls it would pop up a window with the respective files in that directory. So the GTK4 demo has an example of a File Browser that will suite…

panchis
- 103
- 1
- 4
0
votes
1 answer
Creating a a grid of uniform, square buttons in gtk4
As the title says, I want to create a grid of uniform, square buttons in gtk4, with no (or very little) spacing in between the cells. It seems like this should be quite simple but I've been really struggling to achieve this in gtk.
Here's a picture…

cherba
- 1
0
votes
1 answer
segmentation fault when trying to set a button's label inside a lambda function
I've been trying to learn gtkmm4, but I've run into a strange runtime error
My Code:
#include
#include
class MyWindow : public Gtk::Window
{
public:
MyWindow();
};
MyWindow::MyWindow()
{
set_title("Basic…

NintendoZaedus
- 653
- 3
- 8
- 22
-1
votes
1 answer
Can we use libvte terminal widget on gtk4 window?
I want to use libvte on this gtk4 window. But facing issue during compile, demo script given below. Can anyone tell me whether libvte-2.91 is supported with gtk4? I'm on Ubuntu 22.04LTS
$ gcc -Wall $(pkg-config --cflags gtk4 vte-2.91) gtk4App.c -o…
user16819948
-2
votes
1 answer
GTK4. C language. VS code
I want to connect gtk4, VS Code sees ther, but displays
code.c:3:10: fatal error: gtk/gtk.h: No such file or directory
3 | #include
| ^~~~~~~~~~~
compilation terminated.
tasks.json:
{
"version": "2.0.0",
…

Henry
- 1
- 2
-2
votes
1 answer
Access to GTK4 Widgets in C Using Gnome Builder
I'm fairly new to coding for Linux, and haven't done a lot of GUI programming. I've run into problems using Gnome Builder and programmatic access to UI widgets.
How the heck to you access a widget (built in a UI file and instantiated by widget…

GlennP
- 9
- 4
-2
votes
2 answers
Why sources codes c++ in linux compile and does not start?
Source codes c++ gtkmm3 gtk4 linux:
#include
#include
#include
int main(int argc, char *argv[])
{
auto app =
Gtk::Application::create(argc, argv,
"org.gtkmm.examples.base");
Gtk::Window window;
…

aleks_yolp
- 17
- 3