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

GDK Reference Manual

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

  General

  Name

  General -- library initialization and miscellaneous functions.

  Synopsis


#include <gdk/gdk.h>
voidgdk_init(gint *argc,gchar ***argv);
gbooleangdk_init_check(gint *argc,gchar ***argv);
voidgdk_exit(gint error_code);
gchar*gdk_set_locale(void);
voidgdk_set_sm_client_id(const gchar *sm_client_id);
gchar*gdk_get_display (void);
voidgdk_flush (void);
gintgdk_screen_width(void);
gintgdk_screen_height (void);
gintgdk_screen_width_mm (void);
gintgdk_screen_height_mm(void);
gintgdk_pointer_grab(GdkWindow *window,gint owner_events,
GdkEventMask event_mask,GdkWindow *confine_to,
GdkCursor *cursor,guint32 time);
voidgdk_pointer_ungrab(guint32 time);
gintgdk_pointer_is_grabbed(void);
gintgdk_keyboard_grab (GdkWindow *window,
gint owner_events,guint32 time);
voidgdk_keyboard_ungrab (guint32 time);
voidgdk_key_repeat_disable(void);
voidgdk_key_repeat_restore(void);
voidgdk_beep(void);
gintgdk_get_use_xshm(void);
voidgdk_set_use_xshm(gint use_xshm);
voidgdk_error_trap_push (void);
gintgdk_error_trap_pop(void);

  Description

  This section describes the GDK initialization functions and miscellaneous utility functions.

  Details


gdk_init ()
voidgdk_init(gint *argc,gchar ***argv); 

  Initializes the GDK library and connects to the X server. If initialization fails, a warning message is output and the application terminates with a call to exit(1).

  Any arguments used by GDK are removed from the array and argc and argv are updated accordingly.

  GTK+ initializes GDK in gtk_init() and so this function is not usually needed by GTK+ applications.

  argc : the number of command line arguments.

  argv : the array of command line arguments.


gdk_init_check ()
gbooleangdk_init_check(gint *argc,gchar ***argv); 

  Initializes the GDK library and connects to the X server, returning TRUE on success.

  Any arguments used by GDK are removed from the array and argc and argv are updated accordingly.

  GTK+ initializes GDK in gtk_init() and so this function is not usually needed by GTK+ applications.

  argc : the number of command line arguments.

  argv : the array of command line arguments.

  Returns : TRUE if initialization succeeded.


gdk_exit ()
voidgdk_exit(gint error_code); 

  Exits the application using the exit() system call.

  This routine is provided mainly for backwards compatability, since it used to perform tasks necessary to exit the application cleanly. Those tasks are now performed in a function which is automatically called on exit (via the use of g_atexit()).

  error_code : the error code to pass to the exit() call.


gdk_set_locale ()
gchar*gdk_set_locale(void); 

  Initializes the support for internationalization by calling the setlocale() system call. This function is called by gtk_set_locale() and so GTK+ applications should use that instead.

  The locale to use is determined by the LANG environment variable, so to run an application in a certain locale you can do something like this:


export LANG="fr"
... run application ... 

  If the locale is not supported by X then it is reset to the standard "C" locale.

  Returns : the resulting locale.


gdk_set_sm_client_id ()
voidgdk_set_sm_client_id(const gchar *sm_client_id); 

  Sets the SM_CLIENT_ID property on the application's leader window so that the window manager can save the application's state using the X11R6 ICCCM session management protocol.

  The leader window is automatically created by GDK and never shown. It's only use is for session management. The WM_CLIENT_LEADER property is automatically set on all X windows created by the application to point to the leader window.

  See the X Session Management Library documentation for more information on session management and the Inter-Client Communication Conventions Manual (ICCCM) for information on the WM_CLIENT_LEADER property. (Both documents are part of the X Windows distribution.)

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



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

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