|
发表于 2006-2-23 13:39:03
|
显示全部楼层
这是别人的一个隐藏鼠标的函数,此函数的参数要求为GdkWindow,
我怎样才能由现有的主窗口(GtkWindow)转换得到相应的
GdkWindow呢?
void
gdk_window_set_invisible_cursor (GdkWindow *window)
{
GdkBitmap *empty_bitmap;
GdkCursor *cursor;
GdkColor useless;
char invisible_cursor_bits[] = { 0x0 };
useless.red = useless.green = useless.blue = 0;
useless.pixel = 0;
empty_bitmap = gdk_bitmap_create_from_data (window,
invisible_cursor_bits,
1, 1);
cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
empty_bitmap,
&useless,
&useless, 0, 0);
gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor);
g_object_unref (G_OBJECT (empty_bitmap));
} |
|