Internationality



znm wrote:

  Hi,
      I read an  example of from GTK v1.2 Tutorial .
  It illustrates the menu factory. it works well.
  but when I change "File" to   "文件", a chinese
  word , things will go wrong, why?

  ******************************************
              static GtkItemFactoryEntry menu_items[] = {
                    { "/文件",            NULL,           NULL,
  0,      "<Branch>" },
                    { "/File/_New",     "<control>N",   print_hello,
0,
       "<RadioItem>" },
                      ..................
                  }

  ********************************************

  /* example-start menu itemfactory.c */

  #include <gtk/gtk.h>
  #include <strings.h>

  /* Obligatory basic callback */
  static void print_hello( GtkWidget *w,
                          gpointer   data )
  {
       g_message ("Hello, World!\n");
  }

  /* This is the GtkItemFactoryEntry structure used to generate new
menus.

     Item 1: The menu path. The letter after the underscore indicates an

             accelerator key once the menu is open.
     Item 2: The accelerator key for the entry
     Item 3: The callback function.
     Item 4: The callback action.  This changes the parameters with
             which the function is called.  The default is 0.
     Item 5: The item type, used to define what kind of an item it is.
             Here are the possible values:

             NULL               -> "<Item>"
             ""                 -> "<Item>"
             "<Title>"          -> create a title item
             "<Item>"           -> create a simple item
             "<CheckItem>"      -> create a check item
             "<ToggleItem>"     -> create a toggle item
             "<RadioItem>"      -> create a radio item
             <path>             -> path of a radio item to link against
             "<Separator>"      -> create a separator
             "<Branch>"         -> create an item to hold sub items
  (optional)
             "<LastBranch>"     -> create a right justified branch
  */

  static GtkItemFactoryEntry menu_items[] = {
    { "/文件",            NULL,           NULL,          0,
  "<Branch>" },
    { "/File/_New",     "<control>N",   print_hello,   0,
  "<RadioItem>" },
    { "/File/_Open",    "<control>O",   print_hello,   0,      "" },
    { "/File/_Save",    "<control>S",   print_hello,   0,
  "<ToggleItem>"},
    { "/File/Save _As", NULL,           NULL,          0,
  "<CheckItem>" },
    { "/File/sep1",     NULL,           NULL,          0,
  "<Separator>"}






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]