no text output on win32
- From: claude pomalo free fr
- To: gtk-list gnome org
- Subject: no text output on win32
- Date: Thu, 23 Jun 2005 08:01:10 +0200
hello
i am try to build a linux app on win32 with gtk2
i have made some change and build it without problem.
the app run without error but i have no text drawing.
the following function draw text. it work fine on linux.
void draw_layout_text1(int x, int y, char *text, int fsmall)
{
GdkRectangle update_rect;
PangoLayout *pango_layout;
PangoLayoutLine *pango_line;
GtkStyle *style;
PangoFontDescription *font;
// y -= is_windows; /* fix incompatibility in Win GTK */
update_rect.x = x * field_element_size;
update_rect.y = y * field_element_size;
if(fsmall)
pango_layout = pango_layout_new(small_label_context);
else
pango_layout = pango_layout_new(normal_label_context);
pango_layout_set_text(pango_layout,
text,
-1);
pango_line = pango_layout_get_line(pango_layout,
0);
gdk_gc_set_foreground(field_GC,
&(color_table[color_black]));
#if defined(__unix__)
pango_x_render_layout_line(x_display,
gdk_x11_drawable_get_xid(GDK_DRAWABLE(field_pixmap)),
gdk_x11_gc_get_xgc(field_GC),
pango_line,
x * field_element_size,
(y+1) * field_element_size);
#endif
#if defined(__WIN32__)
pango_win32_render_layout_line(gdk_win32_drawable_get_handle(GDK_DRAWABLE(field_pixmap)),
pango_line,
x * field_element_size,
(y+1) * field_element_size);
#endif
if(updating_all)
return;
// update_rect.width = gdk_string_width(font, text);
// update_rect.height = gdk_string_height(font, text);
gtk_widget_draw(field, &update_rect);
}
void draw_link(int x0, int y0, int x1, int y1, int color)
{
int hx;
int hy;
x0 = x0 * field_element_size;
y0 = y0 * field_element_size;
x1 = x1 * field_element_size;
y1 = y1 * field_element_size;
gdk_gc_set_foreground(field_GC,
&(color_table[color]));
hx = field_element_size / 2;
hy = field_element_size / 2;
gdk_draw_line(field_pixmap,
field_GC,
x0 + hx,
y0 + hy,
x1 + hx,
y1 + hy);
}
ca anyone help me
many thanks
claude
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]