Re: How to use PangoWeight constants?



On 27.12.2011 13:22, Hubert Mauchle wrote:
Is there a possibility to use PangoWeight constants
(for example PANGO_WEIGHT_BOLD) in the set method?
PangoWeight is an enum, so you should be able to simply use the nickname 
strings:
  $renderer->set("weight" => "bold",
                 "weight-set" => 1);

And if yes: how did you find out?
As long as we don't have a documentation viewer for the introspection 
stuffÂ, your best bet is to look into the .gir file, in this case 
<prefix>/share/gir-1.0/Pango-1.0.gir.  There you see how 
gobject-introspection interprets the C declarations, and this will map 
almost always one-to-one to Perl.
And for enums of course, the usual Glib magic applies.  See 'perldoc 
Glib' â PERL VERSUS C â This Is Now That.
 Writing a documentation viewer would be a worthwile project, I think. 
 All the information is in the .gir files, including documentation.






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