ruby entry widget does not display properly 
Author Message
 ruby entry widget does not display properly

In win2k ruby does not seem to be able to display properly Tk entry widget
entered
in Unicode.
I know already that ruby script written in utf-8 will display without any
difficulties thanks to the command line option rubyw -Ku script.rbw but
when one enters Unicode through the global IME in Japanese for example into
an Tk entry widget one gets an ugly cursor obstructing most of the display
and nothing else except a series of strings ?????

When the equivalent is done under Tcl/Tk, the Japanese characters are
displayed
beautifully without any ugly showing up of the cursor!
Any pointer is most welcome since I am new to ruby.
Many thanks
Jean-Pierre Berard

------------- Tcl/Tk script

entry .e  -width 40 -font "Times 16 normal"
pack  .e

------------- ruby script

require "tk"

TkEntry.new {
insertwidth 40
font 'Times 16 normal'
pack

Quote:
}

Tk.mainloop


Tue, 22 Feb 2005 17:56:59 GMT  
 ruby entry widget does not display properly

Quote:

> In win2k ruby does not seem to be able to display properly Tk entry widget
> entered
> in Unicode.
> I know already that ruby script written in utf-8 will display without any
> difficulties thanks to the command line option rubyw -Ku script.rbw but
> when one enters Unicode through the global IME in Japanese for example into
> an Tk entry widget one gets an ugly cursor obstructing most of the display
> and nothing else except a series of strings ?????

> When the equivalent is done under Tcl/Tk, the Japanese characters are
> displayed
> beautifully without any ugly showing up of the cursor!
> Any pointer is most welcome since I am new to ruby.

> TkEntry.new {
> insertwidth 40

This is part of the problem. Instead of 'insertwidth', use 'width', just
as you would in Tk. The config options almost always have the same names
in Ruby/Tk as in Tcl/Tk ... it's just the syntax that's different.

Quote:
> font 'Times 16 normal'

Does your Times font include Japanese characters? I suppose it must,
since it worked with Tcl/Tk. But if you're not sure, try using a
different font that you know includes Japanese characters.

--
Matt Gushee
Englewood, Colorado, USA

http://www.havenrock.com/



Tue, 22 Feb 2005 18:28:54 GMT  
 ruby entry widget does not display properly


Quote:

>> In win2k ruby does not seem to be able to display properly Tk entry
>> widget entered
>> in Unicode.
>> I know already that ruby script written in utf-8 will display without
>> any difficulties thanks to the command line option rubyw -Ku
>> script.rbw but when one enters Unicode through the global IME in
>> Japanese for example into an Tk entry widget one gets an ugly cursor
>> obstructing most of the display and nothing else except a series of
>> strings ?????

>> When the equivalent is done under Tcl/Tk, the Japanese characters are
>> displayed
>> beautifully without any ugly showing up of the cursor!
>> Any pointer is most welcome since I am new to ruby.

>> TkEntry.new {
>> insertwidth 40

> This is part of the problem. Instead of 'insertwidth', use 'width',
> just as you would in Tk. The config options almost always have the
> same names in Ruby/Tk as in Tcl/Tk ... it's just the syntax that's
> different.

>> font 'Times 16 normal'

> Does your Times font include Japanese characters? I suppose it must,
> since it worked with Tcl/Tk. But if you're not sure, try using a
> different font that you know includes Japanese characters.

It is reassuring to know that the transcription of tk scripts into ruby
will be just a matter of syntax!
The failing of the Japanese characters to display must to a degree also
be a matter of syntax since ruby can display utf-8 without a further a
do even without invoking the font command.
It is the input, which must need somehow a reset from its default.

The script with the word "Japanese" written in utf-8 displays without
any font support but when one writes in Japanese into the entry widget
one gets only ????

# ruby -Ku script.rb

require "tk"

root = TkRoot.new() { title "Packing Example" }
entry = TkEntry.new(root).pack("side"=>"top", "fill"=>"x")
# entry.insert(0, "Entry on the top")
entry.insert(0, "?-???a?")

Tk.mainloop



Thu, 24 Feb 2005 22:47:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. entry is not properly updated when textvariable is changed

2. Greek characters not displaying properly on Linux

3. wxPython: Popped-up widget not refreshed properly on Windows

4. Displaying value in entry widget

5. textvariable display error in entry widget?

6. Question - Display Format in Tk Entry Widget?

7. Display format in Tk Entry widget

8. displaying file selection in entry widget

9. How to set display off in a Tk entry widget

10. using entry widget inside tixGrid widget (or list widget)

11. entry widget does not show trailing tab

12. entry widget in container window not working

 

 
Powered by phpBB® Forum Software