Locking the width of a column in a tree view
- From: Kevin DeKorte <kdekorte gmail com>
- To: gtk-app-devel-list gnome org
- Subject: Locking the width of a column in a tree view
- Date: Tue, 24 Jul 2007 10:48:16 -0600
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I have this code... and I would like to make it so that the first column
is the column that is stretched and the second column remains the
smallest size it can be based on contents and font. Right now the first
column stays the same size and the second column expands. I'm sure it is
just a simple attribute but I can't seem to find it.
Thanks,
Kevin
GtkWidget *playlist_window;
GtkWidget *close;
GtkWidget *list;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkWidget *vbox;
GtkWidget *hbox;
playlist_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW(playlist_window),
GDK_WINDOW_TYPE_HINT_UTILITY);
gtk_window_set_title(GTK_WINDOW(playlist_window), _("Playlist"));
vbox = gtk_vbox_new(FALSE, 10);
hbox = gtk_hbutton_box_new();
gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_END);
list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(playliststore));
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Items to Play"),
renderer,
"text", ITEM_COLUMN,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("",
renderer,
"text", COUNT_COLUMN,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
g_signal_connect_swapped(GTK_OBJECT(close), "clicked",
GTK_SIGNAL_FUNC(config_close),
playlist_window);
gtk_container_add(GTK_CONTAINER(hbox), close);
gtk_box_pack_start(GTK_BOX(vbox),list,TRUE,TRUE,0);
gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0);
gtk_container_add(GTK_CONTAINER(playlist_window), vbox);
gtk_widget_show_all(playlist_window);
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Remi - http://enigmail.mozdev.org
iD8DBQFGpi1P6w2kMH0L1dERArFOAJ44JhNgh6do9ZnbqazW6EzQz7La1wCfaqg3
XARakd3nFaVNCxxkCGQav8A=
=HEsa
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]