GTK and Unicode

Linux specific forum
WishMaster
Enthusiast
Enthusiast
Posts: 277
Joined: Fri Jun 17, 2005 7:13 pm
Location: Franconia
Contact:

GTK and Unicode

Post by WishMaster »

Yes, always Unicode :wink:

This works as expected if you disable unicode support but with unicode it only outputs "H".
gtk_init_(0, 0)
*gdialog = gtk_message_dialog_new_(0, #GTK_DIALOG_MODAL, #GTK_MESSAGE_INFO, #GTK_BUTTONS_OK, "Hello there!" ,"","")
resp=gtk_dialog_run_(*gdialog)
gtk_widget_destroy_(*gdialog)
Image Image
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes, gtk2 expect UTF8 string, while gtk1 expect ascii (no unicode support). Internal PB strings are UTF16.
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Code: Select all

ImportC "/usr/lib/libgtk.a"
  gtk_message_dialog_new(l.l, d.l, f.l, e.l, s.p-utf8 , r.p-utf8, k.p-utf8)
EndImport

gtk_init_(0, 0) 
 *gdialog = gtk_message_dialog_new(0, #GTK_DIALOG_MODAL, #GTK_MESSAGE_INFO, #GTK_BUTTONS_OK, "Hello there!" ,"","") 
 resp=gtk_dialog_run_(*gdialog) 
 gtk_widget_destroy_(*gdialog)
works.

How do I get such a path? Are these libs always in /usr/lib/?

Or: where can I read about standard paths of Linux?
Athlon64 3700+, 1024MB Ram, Radeon X1600
WishMaster
Enthusiast
Enthusiast
Posts: 277
Joined: Fri Jun 17, 2005 7:13 pm
Location: Franconia
Contact:

Post by WishMaster »

Image Image
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Yep, I used whereis to find it, but I wasn't sure if it is always in this path. I often
see paths like "lib-tkg-1.8.1.0\tkgg-lib". I think this one isn't safe because
of the version number in the path, but it sometimes is the only path I can
find.

Thx for the wiki-link :)
Athlon64 3700+, 1024MB Ram, Radeon X1600
WishMaster
Enthusiast
Enthusiast
Posts: 277
Joined: Fri Jun 17, 2005 7:13 pm
Location: Franconia
Contact:

Post by WishMaster »

I looked fot libgtk.a here on my OpenSUSE 10.2 system - even with whereis I couldn't find it.
So I used find / | grep libgtk.a et voilà: It is in /opt/gnome/lib :shock:
Image Image
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

This path doesn't exist here.
Uh, what if it were a shared object? :shock:


btw: The IDE doesn't show the SO-Output option.
Athlon64 3700+, 1024MB Ram, Radeon X1600
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

remi_meier wrote:This path doesn't exist here.
Uh, what if it were a shared object?
This is why Linux has ldconfig & /etc/ld.so.conf..
To sort out different paths to libs on different distros..
WishMaster
Enthusiast
Enthusiast
Posts: 277
Joined: Fri Jun 17, 2005 7:13 pm
Location: Franconia
Contact:

Post by WishMaster »

> This is why Linux has ldconfig & /etc/ld.so.conf..
Great, I didn't know this yet. :D
Image Image
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Thx olejr, I think I have to read about it now a little bit.
Athlon64 3700+, 1024MB Ram, Radeon X1600
Post Reply