[Ruby-gnome2][Bug] segmentation fault with ComboBox and spanish characters

D

David Espada

Hi all.

I have a little problem when setting a list of options in a ComboBox
with spanish characters. When I type and complete with Alt+Tab,
program goes inestable, crashing after a moment or making impossible
to type more.

When executing from console, I get critical messages about Bonobo and
UTF-8 characters, like:

** (dequebarrio:1770): WARNING **: Invalid UTF8 string passed
to pango_layout_set_text()

I use Ruby 1.8.1 and Ruby-gnome2 0.8.1-8 in Debian Sid. Has any of
you same problem? Is it a question solved in 0.9 version?

Thanks a lot for your excellent work.

David

P.D. Sorry for not using mailing list, but I have problems sending
messages to ruby-gnome2-devel-en.
 
M

Masao Mutoh

Hi,

Hi all.

I have a little problem when setting a list of options in a ComboBox
with spanish characters. When I type and complete with Alt+Tab,
program goes inestable, crashing after a moment or making impossible
to type more.
When executing from console, I get critical messages about Bonobo and
UTF-8 characters, like:

** (dequebarrio:1770): WARNING **: Invalid UTF8 string passed
to pango_layout_set_text()

I use Ruby 1.8.1 and Ruby-gnome2 0.8.1-8 in Debian Sid. Has any of
you same problem? Is it a question solved in 0.9 version?

What charset do you use ?
All strings you pass to GTK+ functions must be in UTF-8.

See http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_i18n
P.D. Sorry for not using mailing list, but I have problems sending
messages to ruby-gnome2-devel-en.

Don't mind ;).
 
D

David Espada

M

Masao Mutoh

Hi,

UTF-8

I pass data received from a database with UTF-8 coding. It works
normally on other widgets without problems.


Problem seems only to raise when I try using autocomplete with
Alt+Tab

Autocomplete ? Is it Gtk::Combo?

Hmm. I don't know Gtk::Combo has autocomplete feature.
Is it about other Widget?

Could you send a sample(small one, please;->)?
 
D

David Espada

El miércoles 03 de marzo, Masao Mutoh escribió:
Autocomplete ? Is it Gtk::Combo?

Yes :)
Hmm. I don't know Gtk::Combo has autocomplete feature.
Is it about other Widget?

Try yourself with a number of assigned values (set_popdown_strings)
and Alt+Tab ;)
Could you send a sample(small one, please;->)?

Well. In this example, you can select perfectly a value in combo with
mouse, but if you type until a special spanish character and next use
Alt+Tab combination in order to auto-complete word, widget run
unstable and it is difficult to select a value until you type
backspace repeatedly.

Code:
--------------------------------------------------------------
#!/usr/bin/ruby

require 'glib2'
require 'gtk2'

Gtk::init

ventana = Gtk::Window.new
ventana.set_title("Problemas con carácteres latinos")
ventana.signal_connect('delete_event') {exit}


vbox = Gtk::VBox::new(true, 10)

boton = Gtk::Button.new('_cerrar', true)
boton.signal_connect('clicked') do Gtk::main_quit end

entra = Gtk::Entry.new()
entra.set_text("This widget works perfectly: áéíóúñññ")

combo = Gtk::Combo.new()
combo.set_popdown_strings(['árbol', 'película', 'edredón'])
combo.set_use_arrows(false)
combo.set_value_in_list(true, true)

vbox.pack_start(entra, true, true, 0)
vbox.pack_start(combo, true, true, 0)
vbox.pack_start(boton, true, true, 0)

ventana.add(vbox)

ventana.show_all

Gtk.main
--------------------------------------------------------

Special characters are in UTF-8. If you have any problem to probe,
I'll send you file.

Thanks.

David
 
M

Masao Mutoh

--Multipart=_Fri__5_Mar_2004_03_37_14_+0900_Lk4NEqDcNTuuY0oz
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi,

Yes :)


Try yourself with a number of assigned values (set_popdown_strings)
and Alt+Tab ;)


Well. In this example, you can select perfectly a value in combo with
mouse, but if you type until a special spanish character and next use
Alt+Tab combination in order to auto-complete word, widget run
unstable and it is difficult to select a value until you type
backspace repeatedly.

GTK+ C version gets same result.
It seems a bug of GTK+. Try attached file.

gcc -o test `pkg-config gtk+-2.0 --libs --cflags` test.c

--
:% Masao Mutoh<[email protected]>


--Multipart=_Fri__5_Mar_2004_03_37_14_+0900_Lk4NEqDcNTuuY0oz
Content-Type: application/octet-stream;
name="test.c"
Content-Disposition: attachment;
filename="test.c"
Content-Transfer-Encoding: base64

I2luY2x1ZGUgPGd0ay9ndGsuaD4KI2luY2x1ZGUgPGxvY2FsZS5oPgoKaW50IG1haW4oaW50IGFy
Z2MsIGNoYXIqKiBhcmd2KXsgIAogIEd0a1dpZGdldCAqd2luZG93LCAqY29tYm87CiAgR0xpc3Qq
IGdsaXN0ID0gTlVMTDsKCiAgc2V0bG9jYWxlKExDX0FMTCwgIiIpOwogIGdsaXN0ID0gZ19saXN0
X2FwcGVuZChnbGlzdCwgIsOhcmJvbCIpOwogIGdsaXN0ID0gZ19saXN0X2FwcGVuZChnbGlzdCwg
InBlbMOtY3VsYSIpOwogIGdsaXN0ID0gZ19saXN0X2FwcGVuZChnbGlzdCwgImVkcmVkw7NuIik7
CgogIGd0a19pbml0KCZhcmdjLCAmYXJndik7CgogIGNvbWJvID0gZ3RrX2NvbWJvX25ldygpOwoK
ICBndGtfY29tYm9fc2V0X3BvcGRvd25fc3RyaW5ncyhHVEtfQ09NQk8oY29tYm8pLCBnbGlzdCk7
CgogIHdpbmRvdyA9IGd0a193aW5kb3dfbmV3KEdUS19XSU5ET1dfVE9QTEVWRUwpOwogIGd0a19j
b250YWluZXJfYWRkKEdUS19DT05UQUlORVIgKHdpbmRvdyksIEdUS19XSURHRVQoY29tYm8pKTsK
ICBndGtfd2lkZ2V0X3Nob3dfYWxsKHdpbmRvdyk7CgogIGd0a19tYWluKCk7CiAgcmV0dXJuIDA7
Cn0KCg==

--Multipart=_Fri__5_Mar_2004_03_37_14_+0900_Lk4NEqDcNTuuY0oz--
 
D

David Espada

El jueves 04 de marzo, Masao Mutoh escribió:
GTK+ C version gets same result.
It seems a bug of GTK+. Try attached file.

Same problem. I suspected it ;)

It seems that problem has not been reported to Gtk bugzilla nor Debian
bug database. I'll write a report.

Thanks, Masao.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top