Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] accents in french

From: luc:spirlet:skynet:be at: 11-Dec-2004 12:31

Rebol, superlanguage! The persons of french speech as me have a problem with the gui. Here the code I must write to get =EA in place of ^e. (code tested with linux mandrake 9.0 rebol latest version) REBOL[] key-event: func [face event] [ if event/type = 'key [ if find f1/text to-char 94 [ if event/key = #"e" [str: replace f1/text to-char 94 "=EA"] unview win f1/text: str focus f1 view win ] ] event ] insert-event-func :key-event win: layout [ size 600x600 backcolor linen h1 "Title" text 580 {Type a few words} across f1: area 400x30 with [ color: 240.240.240 font: [name: font-fixed] ] button "Close" [quit] ] focus f1 view win If you try this code, all is perfect except the flash due to the recreation of the window. I use area in place of field because the characters "=E9" "=E8" "=E0" etc.. are ok with the object area. My keyboard is a belgian keyboard. In this solution, I must capture the return key if the user has finished to enter his words. I've tried several solutions with unfocus but this is the better I know for this moment. It's not really ennoying. But if you know better, I will be very glad to hear from you. There is perhaps a solution with the keymap option in the prefs.r file. But how to build this keymap? I've not finded anything on this subject. I know Rebol since a few weeks. It's really wonderful and powerful. I've picked a part of here above to Carl. The key-event function. Luc Spirlet