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

GDK Reference Manual

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

  sm_client_id : the client id assigned by the session manager when the connection was opened, or NULL to remove the property.


gdk_get_display ()
gchar*gdk_get_display (void); 

  Gets the name of the display, which usually comes from the DISPLAY environment variable or the --display command line option.

  Returns : the name of the display.


gdk_flush ()
voidgdk_flush (void); 

  Flushes the X output buffer and waits until all requests have been processed by the server. This is rarely needed by applications. It's main use is for trapping X errors with gdk_error_trap_push() and gdk_error_trap_pop().


gdk_screen_width ()
gintgdk_screen_width(void); 

  Returns the width of the screen in pixels.

  Returns : the width of the screen in pixels.


gdk_screen_height ()
gintgdk_screen_height (void); 

  Returns the height of the screen in pixels.

  Returns : the height of the screen in pixels.


gdk_screen_width_mm ()
gintgdk_screen_width_mm (void); 

  Returns the width of the screen in millimeters. Note that on many X servers this value will not be correct.

  Returns : the width of the screen in millimeters, though it is not always correct.


gdk_screen_height_mm ()
gintgdk_screen_height_mm(void); 

  Returns the height of the screen in millimeters. Note that on many X servers this value will not be correct.

  Returns : the height of the screen in millimeters, though it is not always correct.


gdk_pointer_grab ()
gintgdk_pointer_grab(GdkWindow *window, gint owner_events,
GdkEventMask event_mask, GdkWindow *confine_to,GdkCursor *cursor, 
guint32 time); 

  Grabs the pointer (usually a mouse) so that all events are passed to this application until the pointer is ungrabbed with gdk_pointer_ungrab(), or the grab window becomes unviewable. This overrides any previous pointer grab by this client.

  Pointer grabs are used for operations which need complete control over mouse events, even if the mouse leaves the application. For example in GTK+ it is used for Drag and Drop, for dragging the handle in the GtkHPaned and GtkVPaned widgets, and for resizing columns in GtkCList widgets.

  Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with owner_events set to TRUE.

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

  owner_events : if FALSE then all pointer events are reported with respect to window and are only reported if selected by event_mask. If TRUE then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to window and only if selected by event_mask. In either mode, unreported events are discarded.

  event_mask : specifies the event mask, which is used in accordance with owner_events.

  confine_to : If non-NULL, the pointer will be confined to this window during the grab. If the pointer is outside confine_to, it will automatically be moved to the closest edge of confine_to and enter and leave events will be generated as necessary.

  cursor : the cursor to display while the grab is active. If this is NULL then the normal cursors are used for window and its descendants, and the cursor for window is used for all other windows.

  time : the timestamp of the event which led to this pointer grab. This usually comes from a GdkEventButton struct, though GDK_CURRENT_TIME can be used if the time isn't known.

  Returns : 0 if the grab was successful.


gdk_pointer_ungrab ()
voidgdk_pointer_ungrab(guint32 time); 

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

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



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

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