Re: GnomeCanvasText item is giving me grief



Robin Cull <robin@icetea.demon.co.uk> writes:

> Hi all,
> 
> I hate to be the one asking all the dumb questions but didn't somebody
> once say to always include an idiot in a group to ask all the questions
> the others were afraid to ask?  Well I'm a newbie as you can probably
> guess and I'm having a little problem with a GnomeCanvasText item giving
> me jip.  All seems to be straightforward but there is no example in The
> Book to show me what I am doing wrong.  My call goes out like this:
> 
> textitem = gnome_canvas_item_new(group, gnome_canvas_text_get_type(), 
>                                    "text", "hello", 
> 				   "x", 250.0, 
> 				   "y", 250.0, 
> 				   "anchor", GTK_ANCHOR_CENTER, 
> 				   "font", "terminal", 
> 				   "fill_color", "black", 
> 				   NULL);

You need to specify the full XLFD (X Logical Font Descriptor) for the
"font" parameter, eg.:

  "font", "-*-terminal-bold-r-normal-*-12-*-*-*-*-*-iso8859-1", 

You can determine these using the program xfontsel, or maybe you can
popup a GnomeFontSelector or use a GnomeFontPicker in your program, to
let the user specify a font.

regards,
Kristian



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