l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2008 Mar 03 10:34

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] GTK, GtkCList Widget, Font Alignment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] GTK, GtkCList Widget, Font Alignment

Would someone happen to know how to set the font in GTK CList widgets such
that the text is a fixed width and aligned from row to row?  (In C.)  I'm
attempting to adjust the style, but if I execute gtk_clist_append, use the r
eturned row #, then use that corresponding # to retrieve the row style, the
style pointer retrieved happens to be null as returned by the GTK code below:

GtkStyle *
gtk_clist_get_row_style (GtkCList *clist,
                         gint      row)
  GtkCListRow *clist_row;

  g_return_val_if_fail (clist != NULL, NULL);
  g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);

  if (row < 0 || row >= clist->rows)
    return NULL;

  clist_row = ROW_ELEMENT (clist, row)->data;

  return clist_row->style;

... So, before I dig any deeper - am I supposed to set my own style data?
Sorry if this is a stupid question - the documentation on gtk.org doesn't
make this very clear.  (Windows has a very nice way of doing this with
WM_SETFONT for ListView controls... ) Some things are very lacking in GTK.
Looking through the GTK application developer's mailing list isn't
revealing any great clues either.

My guess is that I'm going to have to create my own style object, and set
some kind of font information ... But I don't want to go through all this
trouble if someone out there knows what I am trying to do.

Any help is much appreciated.

Mr. Resistor (-/\/\/\-) (pxxxxxx@shoelacessuck.org)
Computer Engineering Student &
"What's-popularly-referred-to-as-Velcro{tm, VBIV}" Shoe Supremacist
http://www.shoelacessuck.org/ [currently down]

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.