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

GDK Reference Manual

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

gdk_keyval_name ()
gchar*gdk_keyval_name (guint keyval); 

  Converts a key value into a symbolic name. The names are the same as those in the <gdk/gdkkeysyms.h> header file but without the leading "GDK_".

  keyval : a key value.

  Returns : a string containing the name of the key, or NULL if keyval is not a valid key. The string should not be modified.


gdk_keyval_from_name ()
guint gdk_keyval_from_name(const gchar *keyval_name); 

  Converts a key name to a key value.

  keyval_name : a key name.

  Returns : the corresponding key value, or GDK_VoidSymbol if the key name is not a valid key.


gdk_keyval_is_upper ()
gbooleangdk_keyval_is_upper (guint keyval); 

  Returns TRUE if the given key value is in upper case.

  keyval : a key value.

  Returns : TRUE if keyval is in upper case, or if keyval is not subject to case conversion.


gdk_keyval_is_lower ()
gbooleangdk_keyval_is_lower (guint keyval); 

  Returns TRUE if the given key value is in lower case.

  keyval : a key value.

  Returns : TRUE if keyval is in lower case, or if keyval is not subject to case conversion.


gdk_keyval_to_upper ()
guint gdk_keyval_to_upper (guint keyval); 

  Converts a key value to upper case, if applicable.

  keyval : a key value.

  Returns : the upper case form of keyval, or keyval itself if it is already in upper case or it is not subject to case conversion.


gdk_keyval_to_lower ()
guint gdk_keyval_to_lower (guint keyval); 

  Converts a key value to lower case, if applicable.

  keyval : a key value.

  Returns : the lower case form of keyval, or keyval itself if it is already in lower case or it is not subject to case conversion.

Input Methods

Name

  Input Methods -- support for internationalized text input.

Synopsis


#include <gdk/gdk.h>
enumGdkIMStyle;
gintgdk_im_ready(void);
GdkIMStylegdk_im_decide_style (GdkIMStyle supported_style);
GdkIMStylegdk_im_set_best_style (GdkIMStyle best_allowed_style);
voidgdk_im_begin(GdkIC *ic,GdkWindow *window);
voidgdk_im_end(void); 

Description

  Input Methods provide a way for complex character sets to be used in GTK+. Languages such as Chinese, Japanese, and Korean (often abbreviated to CJK) use a large number of ideographs, making it impossible to support all characters with a simple keyboard. Instead, text is usually pre-edited using a phonetic alphabet and then composed to form the ideographs.

  GTK+ makes use of the input method mechanism provided by the X Windows platform. When a GTK+ application is started, it opens a connection to the input method appropriate for the current locale (if any).

  Widgets which handle textual input, such as GtkEntry, need to do a number of things to support internationalized text input:

  When the widget is realized:

  Check if an input method is being used with gdk_im_ready(). If it is, create a new Input Context using gdk_ic_new(). Find out which events the Input Context needs to receive with gdk_ic_get_events(), and make sure that the widget's window receives these events using gdk_window_set_events().

  When the widget's size, state or cursor position changes:

  Update the appropriate Input Context attributes using gdk_ic_set_attr().

  When the keyboard focus enters or leaves the widget:

  Call gdk_im_begin() or gdk_im_end() to start or finish editing the text.

  When the widget receives a key_press event:

  The string and length fields of the GdkEventKey struct should be used to insert the composed text into the widget.

  When the widget is unrealized:

  Destroy the Input Context.

  See the XLib reference manual for more detailed information on input methods, and the GtkEntry and GtkText widgets for some example code.

Details

  enum GdkIMStyle



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



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

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章