GtkTreeColumn & CellRenderer Question!
- From: Van H Tran <tvhoang1980 yahoo com>
- To: gtk-app-devel-list gnome org
- Subject: GtkTreeColumn & CellRenderer Question!
- Date: Sat, 20 May 2006 13:59:32 -0700 (PDT)
Hi all,
I want to have a FIXED_SIZED colum that displays some
text, followed immediately by some number. Here is the
code:
// cell renderers
textRenderer = gtk_cell_renderer_text_new();
numberRenderer = gtk_cell_renderer_text_new();
g_object_set(G_OBJECT(textRenderer), "ellipsize",
PANGO_ELLIPSIZE_END, NULL);
gtk_cell_renderer_set_fixed_size(textRenderer,
500, -1);
// the column
column = gtk_tree_view_column_new();
g_object_set(G_OBJECT(column), "sizing",
GTK_TREE_VIEW_COLUMN_FIXED, NULL);
gtk_tree_view_column_set_spacing (column,0);
gtk_tree_view_column_set_fixed_width(column, 550);
//pack them in
gtk_tree_view_column_pack_start(column,
textRenderer, FALSE);
gtk_tree_view_column_pack_start(column,
numberRenderer, FALSE);
I want the textRenderer to ellipsize_end
automatically when the text is more than 500 pixels.
And the number should always follow right after the
text
* Now, if i keep line number 5, then if the text is
short enough, the number will stay very far from the
text.
* However, If i comment out line number 5, then if
the text is long enough, the number won't be
displayed....
My question is : what other attributes, properties
must i set to achieve this?
I'd really appreciate any reply. Thanks in advance
Cheers,
TV Hoang
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]