Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a fixed windows size for a GTK+ app in C?

Tags:

c

gtk

How do I set a fixed window size for a GTK+ app? I have:

gtk_window_set_default_size(GTK_WINDOW(mainWindow), 400, 300);
gtk_window_set_policy (GTK_WINDOW(mainWindow), FALSE, FALSE, FALSE);

but the window gets very small. There are no widgets yet.

like image 459
Robin Theunis Avatar asked Feb 02 '23 22:02

Robin Theunis


1 Answers

Use gtk_window_set_resizable function for this purpose

gtk_window_set_default_size(GTK_WINDOW(mainWindow), 400, 300);
gtk_window_set_resizable (GTK_WINDOW(mainWindow), FALSE);
like image 54
DReJ Avatar answered Feb 06 '23 15:02

DReJ