gtk_window_set_gravity问题
#include <gtk/gtk.h>int main(int argc, const char *argv[])
{
GtkWidget *window;
gtk_init(&argc,&argv);
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window),"hello world");
gtk_window_set_gravity(GTK_WINDOW(window),GDK_GRAVITY_SOUTH);
//为什么这句话不起效果,永远都在左上角
gtk_window_move(GTK_WINDOW(window),300,200);
gtk_widget_show(window);
gtk_main();
return 0;
}
~ 你所指的左上角是什么意思? Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.
回 electricface 的帖子
electricface:Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown. (2012-03-04 12:48) images/back.gifgtk_window_move (GTK_WINDOW(window),4000,4000);
将窗体显示到右下角,像360的弹窗。 我也试过,不知问题所在,希望有解决方法的话贴上来,不过窗口位置也可以用这个函数gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_MOUSE);
页:
[1]