Re: embedding arbitrary graphics in text



On Tue, September 7, 2010 4:36 pm, Travis Griggs wrote:
> I'm fleshing out a Smalltalk binding to Pango, and want to be able to
> show breakpoint graphics embedded at arbitrary points in the text.
>
> I found the pange_attr_shape_new() function, but I don't know if
> that's what I want at all.
>
> ATM, what would seem cool, is a way of having an Attribute that says
> "when I draw these items, run this callback with position information,
> so I can do some custom drawing at this point." But maybe that's the
> wrong way to think about getting the job done.

That would be cool.

> Help and pointers and hints appreciated! TIA

Use pango_attr_shape_new_with_data() to associate a closure or object with
the shape.  (I should try it myself sometime: it's cleaner than anything
I've ever done with associating shapes with callbacks.)

Regards,


Tony Graham                         Tony Graham MenteithConsulting com
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd                               XML Guild member
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2



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