Re: printer in Gtk



Le lundi 17 janvier 2005 �5:00 +0100, Joerg Anders a �it :
> Hi all!
> 
> I'm about to decide between Qt or Gtk for my new project. One
> important issue is printing. With Qt you can paint something
> with a painter:
> 
> For exammple the function:
> 
>    void MyWidget::draw(QPainter *p) {
>           p->begin(this);
>           p->drawArc(4, 4, 100, 100, 0, 16*360);
>           p->end();
>    }
> 
> paints a circle on widget surface if you call it such a way:
> 
>     QPainter *p = new QPainter(this);
>     draw(p);
> 
> If you want to print the widget content you call it such a way:
> 
>     QPrinter *pr = new QPrinter();
>     pr->setup(this);
>     QPainter *p = new QPainter(pr);
>     draw(p);
> 
> This way a real WhatYouSeeIsWhatYouGet - editor is possible. I'd decide
> for Gtk if there were a similar way. But I didn't find any pointer
> neither in documentation nor in the tutorials nor in FAQs.
> 
> Any suggestions ?
> 

There is no printing support in Gtk yet (might come with cairo). But you
can use libgnomeprint. The drawback is that you need a separate function
to print.




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