Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->系统管理 ->正文

GDK Reference Manual

来源:Linux-cn.com 作者:Webmaster 时间:2007-05-05 点击: [收藏] [投稿]

  time : a timestamp from a GdkEvent, or GDK_CURRENT_TIME if no timestamp is available.


gdk_pointer_is_grabbed ()
gintgdk_pointer_is_grabbed(void); 

  Returns TRUE if the pointer is currently grabbed by this application.

  Note that the return value is not completely reliable since the X server may automatically ungrab the pointer, without informing the application, if the grab window becomes unviewable. It also does not take passive pointer grabs into account.

  Returns : TRUE if the pointer is currently grabbed by this application. Though this value is not always correct.


gdk_keyboard_grab ()
gintgdk_keyboard_grab (GdkWindow *window,gint owner_events,guint32 time); 

  Grabs the keyboard so that all events are passed to this application until the keyboard is ungrabbed with gdk_keyboard_ungrab(). This overrides any previous keyboard grab by this client.

  window : the GdkWindow which will own the grab (the grab window).

  owner_events : if FALSE then all keyboard events are reported with respect to window. If TRUE then keyboard events for this application are reported as normal, but keyboard events outside this application are reported with respect to window. Both key press and key release events are always reported, independant of the event mask set by the application.

  time : a timestamp from a GdkEvent, or GDK_CURRENT_TIME if no timestamp is available.

  Returns : 0 if the grab was successful.


gdk_keyboard_ungrab ()
voidgdk_keyboard_ungrab (guint32 time); 

  Ungrabs the keyboard, if it is grabbed by this application.

  time : a timestamp from a GdkEvent, or GDK_CURRENT_TIME if no timestamp is available.


gdk_key_repeat_disable ()
voidgdk_key_repeat_disable(void); 

  Disables the keyboard auto-repeat mode. This should be used with care as it may affect other applications.


gdk_key_repeat_restore ()
voidgdk_key_repeat_restore(void); 

  Restores the keyboard auto-repeat mode to its state when the application was started.


gdk_beep ()
voidgdk_beep(void); 

  Emits a short beep.


gdk_get_use_xshm ()
gintgdk_get_use_xshm(void); 

  Returns TRUE if GDK will attempt to use the MIT-SHM shared memory extension.

  The shared memory extension is used for GdkImage, and consequently for GdkRGB. It enables much faster drawing by communicating with the X server through SYSV shared memory calls. However, it can only be used if the X client and server are on the same machine and the server supports it.

  Returns : TRUE if use of the MIT shared memory extension will be attempted.


gdk_set_use_xshm ()
voidgdk_set_use_xshm(gint use_xshm); 

  Sets whether the use of the MIT shared memory extension should be attempted. This function is mainly for internal use. It is only safe for an application to set this to FALSE, since if it is set to TRUE and the server does not support the extension it may cause warning messages to be output.

  use_xshm : TRUE if use of the MIT shared memory extension should be attempted.


gdk_error_trap_push ()
voidgdk_error_trap_push (void); 

  This function allows X errors to be trapped instead of the normal behavior of exiting the application. It should only be used if it is not possible to avoid the X error in any other way.

  Example 1. Trapping an X error.


gdk_error_trap_push();
/* ... Call the X function which may cause an error here ... */
/* Flush the X queue to catch errors now. */
gdk_flush();
if (gdk_error_trap_pop())
{
/* ... Handle the error here ... */
} 
gdk_error_trap_pop ()
gintgdk_error_trap_pop(void); 

  Removes the X error trap installed with gdk_error_trap_push().

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:GTK v1.2 Tutorial(英文)   下一篇:Java入门(12) 事件与错误处理

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号