Re: upgrade gtk 1.2 code to 2.2, conditional compilation?
- From: Owen Taylor <otaylor redhat com>
- To: Filip Hroch <hroch physics muni cz>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: upgrade gtk 1.2 code to 2.2, conditional compilation?
- Date: 18 Mar 2003 13:21:52 -0500
On Tue, 2003-03-18 at 13:07, Filip Hroch wrote:
Hi,
I've a gtk1.2 application with GtkStyle->font structure member
(in non-important part of code). I know it isn't a right way
on gtk1.2 but I'd not found other way. Also, the 'font' isn't more
in GtkStyle class for 2.2 version.
This is a problematic part of code:
/* set optimal column width */
for( i = 0; i < NT; i++ ) {
ipix = gdk_string_width(style->font,title[i]);
gtk_clist_set_column_width (GTK_CLIST(clist),i,ipix);
}
Is there some way (conditional compilation both versions for example)
for correction?
Is there some way to smoothly upgrade the code to more portable shape
usable for a portable code?
A) Trying to make code compile with GTK+-1.2 and GTK+-2.2 at the
same time is just a bad idea. You do work without being able
to take advantage of the improvements in GTK+-2.2.
B) gtk_widget_create_pango_layout() and pango_layout_get_pixel_size()
(followed by g_object_unref() the layout) is the right way
to get the size of a string in GTK+-2.x
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]