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

2019-04-23 13:23发布

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.

标签: c gtk
2条回答
趁早两清
2楼-- · 2019-04-23 13:43

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);
查看更多
该账号已被封号
3楼-- · 2019-04-23 14:00
gtk_widget_set_size_request(mainWindow, 400, 300);
gtk_window_set_resizable (GTK_WINDOW(mainWindow), FALSE);

this must solve the pblm

查看更多
登录 后发表回答