Re: Pango text in a dialog



Bryan Brown wrote:

Hello,

Another part of the application I'm porting from gtk 1.2 to gtk 2.x
involves displaying multiple paragraphs of text in a dialog attached to a
drawing area.  This looks like another good place to use pango and its
markup capabilities.  Here's a sample code fragment that tries to display
one pango-marked-up paragraph:

=== begin code fragment ===

<skipped>

=== end code fragment ===

Well, the only thing displayed is the OK button.  Clearly I'm missing
something.

So, how does one put one or more pango layouts into a dialog vbox?

Or does one need to render the layout(s) and then put the rendered thingy
into the vbox?  How do you do that?
Hi,
I can't get why do you need to bother yourself with layouts ? If you need to display some text
in dialog box just use GtkLabel.
1. You can display many lines (paragraphes) of text with one GtkLabel, not just a single line.
2. GtkLabel is a *widget* for showing PangoLayout on screen.
3. GtkLabel derived from GtkMisc, so it have alignment stuff inside.
4. GtkLabel can be feed with marked-up text.
5. GtkLabel can be feed with a list with PangoAttrList.
6. You can set "selectable" property of the label, so the user can copy the label's content. 7. You can always get PangoLayout from GtkLabel if you need smth *VERY* special.
8. So on...

   Olexiy




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