Hi, all.
I'm developing an application using FXRuby and need to enter text that
has accented letters in it (portuguese texts).
But the controls doesn't show the accented letters as I type them - just
the corresponding letter without the accent.
I've captured SEL_KEYPRESS for a FXText control and I can see that it
"sees" as I type in the key with the accent, and then the key for the
letter I want to have accented.
Here's an excerpt of the output of the captured event (the relevant
statement here is puts data.text << " (" << data.code.to_s << ")"):
(65505)
< (60)
p (112)
(65505)
> (62)
(65505)
I (73)
s (115)
t (116)
o (111)
(32)
(65105)
e (101)
(32)
c (99)
e (101)
r (114)
t (116)
o (111)
(65505)
< (60)
/ (47)
p (112)
(65505)
> (62)
-------------------
I know that (65105) is the code for the left shift. (65105) would be the
code for the acute accent, which followed by the letter e (101) should
give me an "e acute" (é), but the control shows just the simple "e".
Does anybody have a hint on this?
TIA,
--
angico
------
home page: www.angico.org
Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
on 18.08.2008 17:25
on 18.08.2008 23:48
-------- Original-Nachricht -------- > Datum: Tue, 19 Aug 2008 00:21:51 +0900 > Von: angico <angico@angico.org> > An: ruby-talk@ruby-lang.org > Betreff: accented letters > letter I want to have accented. > I (73) > t (116) > I know that (65105) is the code for the left shift. (65105) would be the > home page: www.angico.org > Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I > ------ > contatos: > email: angico@angico.org > skype: angico00 > ------ > Dear Angico, you'll need to convert your text to utf-8 encoding using Iconv. Have a look at this (somewhat randomly copied from a Wikipedia article about the Brazilian sociologist Gilberto Freyre) and the FXRuby tutorial: require "rubygems" require "iconv" require 'fox16' include Fox theApp = FXApp.new text = Iconv.iconv("utf-8","iso-8859-1","Interpretação do Brasil") p text theMainWindow = FXMainWindow.new(theApp, text[0]) text2="O Brasil do futuro não vai ser o que os velhos historiadores disserem e os de hoje repetem. Vai ser o que Gilberto Freyre disser. Freyre é um dos gênios de palheta mais rica e iluminante que estas terras antárticas ainda produziram." message = Iconv.iconv("utf-8","iso-8859-1",text2) theButton = FXButton.new(theMainWindow, message[0]) theButton.connect(SEL_COMMAND) do |sender, selector, data| exit end theApp.create theMainWindow.show theApp.run Best regards, Axel
on 19.08.2008 00:02
Hi, Axel. Thank you for the hints, but I think I didn't express myself clearly. Actually, when the text is presented on the FXText control (coming from a database), the control shows the accented letters pretty well. The problem is when I try to insert new text. The application seems to ignore the keystrokes relative to the accents, accepting just the following keystroke, which is the actual letter. I've already post this on the FXRuby users list, but they think it's a Ruby matter. I hope somebody could help me with this. Cheers, Em Ter, 2008-08-19 Ã s 06:44 +0900, Axel Etzold escreveu: > > message = Iconv.iconv("utf-8","iso-8859-1",text2) > > Best regards, > > Axel > -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
on 19.08.2008 00:26
-------- Original-Nachricht -------- > Datum: Tue, 19 Aug 2008 06:58:30 +0900 > Von: angico <angico@angico.org> > An: ruby-talk@ruby-lang.org > Betreff: Re: accented letters > Hi, Axel. > > Thank you for the hints, but I think I didn't express myself clearly. > > Actually, when the text is presented on the FXText control (coming from > a database), the control shows the accented letters pretty well. > > The problem is when I try to insert new text. The application seems to > ignore the keystrokes relative to the accents, accepting just the > following keystroke, which is the actual letter. Dear Angico, sorry, I misunderstood. You mean that you want to interact dynamically with FXRuby in some way, like ask the user some question and have the user's answer displayed ? It seems that depending on what OS you use, you can define a connection key (on the system, not in Ruby or FXRuby) so that accent+key are drawn together ... see here for Ubuntu: http://ubuntuforums.org/archive/index.php/t-779463.html To me ( I am not Brazilian or Portuguese) , the problem you are experiencing is somewhat surprising, as for instance in French or German, there are special keys that allow you to enter the whole letter in one go ... but the French don't have the tilde letters ~a and ~o .... maybe general Portuguese language programming forums can help you if the connection-key hint doesn't work ... I'd nevertheless like to know if it does. Best regards, Axel
on 19.08.2008 01:49
Em Ter, 2008-08-19 às 07:22 +0900, Axel Etzold escreveu: > To me ( I am not Brazilian or Portuguese) , the problem you are experiencing is somewhat surprising, as for instance in French or German, there are special keys that allow you to enter the whole letter in one go ... but the French don't have the tilde letters ~a and ~o .... > maybe general Portuguese language programming forums can help you if the connection-key hint doesn't work ... > I'd nevertheless like to know if it does. > > Best regards, > > Axel Hi, Axel. I use Ubuntu Linux 8.04. All the applications I have installed on my system work fine (OpenOffice.org does, JEdit does, Eclipse does, Evolution does, etc.) The only one that refuses to "understand" the key combinations is exactly this one I'm working on: An FXRuby application. Also, as I already stated, the application can display the text correctly. It just can't make the combination. So, I guess the problem is with Ruby. The brazilian ABNT2 keyboard has only one special key: ç. The remaining accented letters must be typed as a combination of a dead key (the accent) followed by the actual letter key, as in ~a, which gives an ã. But FXRuby's controls still don't accept or understand them. Regards, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
on 19.08.2008 11:26
-------- Original-Nachricht -------- > Datum: Tue, 19 Aug 2008 08:42:55 +0900 > Von: angico <angico@angico.org> > An: ruby-talk@ruby-lang.org > Betreff: Re: accented letters > > not in Ruby or FXRuby) so that accent+key are drawn together ... see > > I'd nevertheless like to know if it does. > > > skype: angico00 > ------ > Dear Angico, dear all, I have switched my keyboard layout to Brazilian and I can confirm your FXRuby accent entering troubles. However, I am not sure whether the missing touch is in the Ruby camp rather than in FXRuby's. When I tried some alternative GUI toolkit : http://code.whytheluckystiff.net/shoes/wiki/DownloadShoes (If you get an error missing -lruby, see here: http://code.whytheluckystiff.net/list/shoes/2008/06/28/2998-re-error-make-returns-usr-bin-ld-cannot-find-lruby.html) I could enter Brazilian accents in the reminder application in the sample directory of shoes. This is due to the fact that shoes uses the pango library (http://www.pango.org/) for internationalization. Now, on their page, they talk about integration with the GTK2 GUI toolkit, which, of course, isn't the same as FOX, on which FXRuby builds. As I am not an expert about the intricacies of using pango (or some equivalent) with Fox/FXRuby, I am just CC'ing this message to the fxruby list. Best regards, Axel
on 19.08.2008 13:27
Em Ter, 2008-08-19 Ã s 18:22 +0900, Axel Etzold escreveu: > I could enter Brazilian accents in the reminder application in the sample directory of shoes. > Axel > > > Thank you very much, Axel. It was very kind of you. I hope somebody at FXRuby could help me with this. Regards, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
on 19.08.2008 17:54
On Mon, Aug 18, 2008 at 4:58 PM, angico <angico@angico.org> wrote: > Actually, when the text is presented on the FXText control (coming from > a database), the control shows the accented letters pretty well. > > The problem is when I try to insert new text. The application seems to > ignore the keystrokes relative to the accents, accepting just the > following keystroke, which is the actual letter. > > I've already post this on the FXRuby users list, but they think it's a > Ruby matter. I checked the FXRuby mailing list archives, and found where you posted this question on the FXRuby list (around the beginning of last month). I'm sorry you didn't get any helpful responses, but I don't see that anyone suggested that it was "a Ruby matter". It is most likely a FOX-related issue, and has something to do with how FOX translates (or doesn't translate) those keypresses before sending out the SEL_KEYPRESS and SEL_KEYRELEASE messages. FXRuby doesn't do any manipulation of those results; it just passes through whatever the FOX library generates. You might have better luck asking on the FOX mailing list.
on 19.08.2008 21:25
Em Qua, 2008-08-20 Ã s 00:50 +0900, Lyle Johnson escreveu: > whatever the FOX library generates. You might have better luck asking > on the FOX mailing list. > Hi, Lyle. Well, it was actually myself, who thought it was a Ruby matter. So, where can I find that FOX mailing list? Thank you, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I
on 19.08.2008 22:02
On Tue, Aug 19, 2008 at 2:21 PM, angico <angico@angico.org> wrote: > So, where can I find that FOX mailing list? Here's the information: http://www.fox-toolkit.org/home.html#MAILINGLIST Hope this helps, Lyle
on 20.08.2008 01:13
Em Qua, 2008-08-20 Ã s 04:57 +0900, Lyle Johnson escreveu: > Here's the information: > > http://www.fox-toolkit.org/home.html#MAILINGLIST > > Hope this helps, > > Lyle > Thanks, Lyle. -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I