RE: Problem with pango_tab_array_new_with_positions?
- From: "Ian Puleston" <ian underpressuredivers com>
- To: "'Ian Puleston'" <ian underpressuredivers com>, "'gtk-list'" <gtk-list gnome org>
- Subject: RE: Problem with pango_tab_array_new_with_positions?
- Date: Fri, 24 Apr 2009 19:23:21 -0700
> -----Original Message-----
> From: Ian Puleston
> Sent: Thursday, April 23, 2009 10:50 PM
>
> Then I changed it to use Pango units and it changed to this:
> #define PANGO_CAIRO_INCHES(n) (n * 72 * PANGO_SCALE)
> tabArray = pango_tab_array_new_with_positions(5, FALSE,
> PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(0.1),
> PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(0.5),
> PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(3.3),
> PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(4.2),
> PANGO_TAB_LEFT, PANGO_CAIRO_INCHES(6.0));
>
> But with that no text from the 2nd tab stop on got printed.
Hi,
I just realized what the problem is that's causing this, and it's my error
in the above code. pango_tab_array_new_with_positions uses varargs so the
type of the arguments must match what it is expecting. It is expecting gints
for the tab positions, but my macro above yields a double. Adding a cast to
gint within the macro definition fixes this problem.
Ian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]