- 論壇徽章:
- 0
|
- #ifndef EGG_COMPILATION
- #ifndef _
- #define _(x) dgettext (GETTEXT_PACKAGE, x)
- #define N_(x) x
- #endif
- #else
- #define _(x) x
- #define N_(x) x
- #endif
- ....
- g_object_class_install_property (gobject_class,
- PROP_ORIENTATION,
- g_param_spec_enum ("orientation",
- _("Orientation"),
- _("The orientation of the tray."),
- GTK_TYPE_ORIENTATION,
- GTK_ORIENTATION_HORIZONTAL,
- G_PARAM_READABLE));
復(fù)制代碼
是上面的#ifndef EGG_COMPILATION這個宏的影響
當(dāng)你沒用定義EGG_COMPILATION時(shí),下劃線_會被定義成一個宏
_("Orientation"),
就是dgettext (GETTEXT_PACKAGE, "Orientation")
而GETTEXT_PACKAGE他不知道到哪里去找
實(shí)際上GETTEXT_PACKAGE在config.h里面被定義為
#define GETTEXT_PACKAGE "gnome-notification-area-demo"
只不過是一個字符串的宏而已.表示應(yīng)用程序的名字,你用你的程序的名字替換不就行了.
用別人的源代碼,總不至于一點(diǎn)也不需要修改吧.
[ 本帖最后由 renstone921 于 2005-12-29 17:51 編輯 ] |
|