Article View: pl.comp.os.linux.programowanie
Article #72395Jak umieścić Stock Item w gtk_tree_view _
From: Badman
Date: Wed, 07 Dec 2011 12:40
Date: Wed, 07 Dec 2011 12:40
40 lines
2232 bytes
2232 bytes
Witam W jaki sposób w gtk_tree_view'ie umieszczać "ikony" Stock Item ? Gdzieś doczytałem, że komórka powina mieć atrybut stock-id, więc mój kod wygląda tak: [...] listview = gtk_tree_view_new (); kol = gtk_tree_view_column_new (); gtk_tree_view_column_set_title ( kol, "Stock Item" ); gtk_tree_view_append_column ( GTK_TREE_VIEW(listview), kol ); komorka = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_add_attribute(kol, GTK_CELL_RENDERER(komorka), "stock-id", 1); gtk_tree_view_column_pack_start(kol, komorka, TRUE); lista = gtk_list_store_new ( 2, GDK_TYPE_PIXBUF, G_TYPE_STRING ); gtk_list_store_append ( lista, &iter ); ikona = gtk_widget_render_icon (win, GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU, NULL); gtk_list_store_set ( lista, &iter, 0, image, 1, GTK_STOCK_EDIT, -1); gtk_tree_view_set_model ( GTK_TREE_VIEW(listview), GTK_TREE_MODEL(lista) ); [...] Jednak nie działa :( -- Pozdrawiam Badman
Technical Details
Message-ID:
<8c7652ad-4bf8-4c66-8ae8-2c7e63fb7ad1@u5g2000vbd.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!postnews.google.com!u5g2000vbd.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!postnews.google.com!u5g2000vbd.googlegroups.com!not-for-mail From: Badman <tomasz.gutewicz@gmail.com> Newsgroups: pl.comp.os.linux.programowanie Subject: Jak umieścić Stock Item w gtk_tree_view _ Date: Wed, 7 Dec 2011 04:40:08 -0800 (PST) Organization: http://groups.google.com Lines: 41 Message-ID: <8c7652ad-4bf8-4c66-8ae8-2c7e63fb7ad1@u5g2000vbd.googlegroups.com> NNTP-Posting-Host: 80.50.142.34 Mime-Version: 1.0 X-Trace: posting.google.com 1323261694 15380 127.0.0.1 (7 Dec 2011 12:41:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Dec 2011 12:41:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u5g2000vbd.googlegroups.com; posting-host=80.50.142.34; posting-account=LRlyMAoAAAB5PUSE0WgNTC0mFNT33qAa User-Agent: G2/1.0 X-HTTP-Via: 1.1 SATURN X-Google-Web-Client: true X-Google-Header-Order: VCRUHALNK X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit