FXText widget and localization

View: New views
5 Messages — Rating Filter:   Alert me  

FXText widget and localization

by angico-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, list.

Does anybody know about using accented letters in FXText? Any tutorial?
Any hint?

Thanks in advance,

--
angico
------
home page: www.angico.org
Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
------
contatos:
email: angico@...
skype: angico00
------

_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: FXText widget and localization

by Philippe Lang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

fxruby-users-bounces@... wrote:
> Hi, list.
>
> Does anybody know about using accented letters in FXText? Any
> tutorial? Any hint?
>
> Thanks in advance,

What about adding

--------------------------------
# UTF 8 support
ENV["OUTPUT_CHARSET"]="UTF-8"
$KCODE = 'UTF8'
require 'jcode'
--------------------------------

... At the top of your program?

Philippe
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: FXText widget and localization

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 3, 2008, at 8:11 PM, angico wrote:

> Does anybody know about using accented letters in FXText? Any  
> tutorial?
> Any hint?

Just pass in UTF-8 encoded strings. Here's a quick little introduction:

        http://www.fxruby.org/doc/unicode.html

Hope this helps,

Lyle

---
"FXRuby: Create Lean and Mean GUIs with Ruby"
Now available from the Pragmatic Bookshelf!
http://www.pragprog.com/titles/fxruby





_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Parent Message unknown Re: FXText widget and localization

by angico-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, guys.

Thank you for your hints, but it didn't solve my problem. Maybe I
haven't been much clear.

The problem is that I have an FXText widget in which I may edit some
text. It already displays accented portuguese letters nicely. But when I
try to type any accented letters in it, it behaves like the keys with
the accents were just ignored. For example, when type the key for the
tilde followed by an A, I expect to see the letter "Ã" in FXText, but
all I got is a normal "A".

Does FXText have any support for solving this problem?

Thank you,

--
angico
------
home page: www.angico.org
Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
------
contatos:
email: angico@...
skype: angico00
------

_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: FXText widget and localization

by angico-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, guys.

Just wandering about the issue, I run xev and I got this sequence of
events used to generate an "e acute":


KeyPress event, serial 30, synthetic NO, window 0x5c00001,
    root 0x64, subw 0x0, time 31559119, (725,599), root:(730,648),
    state 0x0, keycode 34 (keysym 0xfe51, dead_acute), same_screen YES,
    XLookupString gives 1 bytes: (b4) "�"
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: True

KeyRelease event, serial 30, synthetic NO, window 0x5c00001,
    root 0x64, subw 0x0, time 31559224, (725,599), root:(730,648),
    state 0x0, keycode 34 (keysym 0xfe51, dead_acute), same_screen YES,
    XLookupString gives 1 bytes: (b4) "�"
    XFilterEvent returns: False

KeyPress event, serial 30, synthetic NO, window 0x5c00001,
    root 0x64, subw 0x0, time 31567005, (725,599), root:(730,648),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XmbLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: True

KeyPress event, serial 30, synthetic NO, window 0x5c00001,
    root 0x64, subw 0x0, time 31567005, (725,599), root:(730,648),
    state 0x0, keycode 0 (keysym 0xe9, eacute), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 1 bytes: (e9) "
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x5c00001,
    root 0x64, subw 0x0, time 31567069, (725,599), root:(730,648),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: False


Handling the SEL_KEYPRESS message from FXText I can see both the *keysym
0xfe51* and then the *keysym 0x65*, but while other programs combine
these keysyms to display a correct e acute, my FXRuby program does not.

I guess it should be a ruby issue, but I'm not sure, cause I'm really
new to this wonderful world of Ruby and FXRuby (actually I've just
finished translating Lyle's "FXRuby - create lean and mean guis with
Ruby" to the brazilian edition of the book, and that's how I got into
it).

Well, if you could send me any hints on the subject, I'd really
appreciate.

Many thanks,

--
angico
------
home page: www.angico.org
Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
------
contatos:
email: angico@...
skype: angico00
------

_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users