RE: Problem with pango_tab_array_new_with_positions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----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


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux