gtk_label and internationalisation question




Hi,

I notice that gtk_label has followed gtk_entry in moving to wide chars
internally. While this sounds like a great idea in theory, I'm having
trouble working out how to get actual multibyte text into the label
under the new scheme. Before I could simply do something like...

  /* create Japanese style */
  jstyle = gtk_style_new();
  jfont = gdk_fontset_load("-*-fixed-medium-r-*--16-*-jisx0208.1983-0");
  gdk_font_unref(jstyle->font);
  jstyle->font = jfont;

  /* Insert Kana "A" */
  gtk_label_set_text (GTK_LABEL(search_entry_mode_label),"\x24\x22");
  gtk_widget_set_style (search_entry_mode_label, jstyle);


And then later in a callback change between that and:

  estyle = gtk_style_new();
  efont = gdk_font_load ("-*-times-medium-r-*-*-16-*-*-*-*-*-*-*");
  gdk_font_unref(estyle->font);
  estyle->font = efont; 

  gtk_label_set_text (GTK_LABEL (search_entry_mode_label),"A");
  gtk_widget_set_style (search_entry_mode_label,estyle);


(the label is in a button which changes between Ascii-A and Kana-A when
pressed)

But, that now doesn't work. The kana "A" is drawn (shown by toggling)
but the width (initially 0) and position (offset to the right) are
wrong somehow...

How can I get the desired effect with the new scheme?

(similar things with the Entry widget - before I could push Japanese
into it 'by hand', now I can't even get it to show any Japanese at
all... I need both to be able to switch between Japanese and English
display while running)


Cheers,
-Matt.

"The results of this intrusion into your life will be used 'responsibly'
in ways you cannot even begin to imagine. Of course, the innocent have
nothing to fear from the rapidly expanding data industry."
 - Radiohead, Airbag/How Am I Driving?



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