[rep-gtk] a bit more GtkTreeView/GtkListStore work
- From: Christopher Bratusek <chrisb src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rep-gtk] a bit more GtkTreeView/GtkListStore work
- Date: Thu, 7 Jan 2010 19:17:15 +0000 (UTC)
commit 2e4cb517f2858f4505f70db5c03846752aeecc82
Author: Christopher Roy Bratusek <chris nanolx org>
Date: Thu Jan 7 20:16:50 2010 +0100
a bit more GtkTreeView/GtkListStore work
ChangeLog | 3 +++
examples/gtktreeview.jl | 20 +++++++++++++++++---
gtktree.defs | 10 ++++++++++
3 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f1a7264..d5913e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
gtk_list_store_new
gtk_list_store_newv
gtk_list_store_set_column_types
+ gtk_list_store_append
+ ****************** gtktreeview.h ****************
+ gtk_tree_view_append_column
2010-01-06 Christopher Bratusek <zanghar freenet de>
* gtktree.defs:
diff --git a/examples/gtktreeview.jl b/examples/gtktreeview.jl
index b60f5f1..2230de3 100755
--- a/examples/gtktreeview.jl
+++ b/examples/gtktreeview.jl
@@ -12,9 +12,23 @@ exec rep --batch "$0" "$@"
;; Widgets
(define MainWindow (gtk-window-new 'toplevel))
- ; (define ListStore (gtk-list-store-newv 1 G_TYPE_STRING))
- ; (define TreeView (gtk-tree-view-new-with-model ListStore))
- (define TreeView (gtk-tree-view-new))
+ (define ListStore (gtk-list-store-newv 1 '(GdkPixbuf) 2 '(gchararray)))
+ (define TreeView (gtk-tree-view-new-with-model ListStore))
+
+ (define PixbufRender (gtk-cell-renderer-pixbuf-new))
+ (define PixbufColumn (gtk-tree-view-column-new))
+ (gtk-tree-view-column-pack-start PixbufColumn PixbufRender t)
+ (gtk-tree-view-column-add-attribute PixbufColumn PixbufRender '("pixbuf") 0)
+ (gtk-tree-view-append-column TreeView PixbufColumn)
+
+ (define TextRender (gtk-cell-renderer-text-new))
+ (define TextColumn (gtk-tree-view-column-new))
+ (gtk-tree-view-column-pack-start TextColumn TextRender t)
+ (gtk-tree-view-column-add-attribute TextColumn TextRender '("text") 1)
+ (gtk-tree-view-append-column TreeView TextColumn)
+
+ (define TestImage (gdk-pixbuf-new-from-file "test.png"))
+ ;(gtk-list-store-append ListStore '(TestImage . "Test"))
;; Windowborder
(gtk-container-set-border-width MainWindow 10)
diff --git a/gtktree.defs b/gtktree.defs
index 0f6daeb..2aac867 100644
--- a/gtktree.defs
+++ b/gtktree.defs
@@ -791,6 +791,11 @@
(int columns)
((tvec type in) type)))
+(define-func gtk_list_store_append
+ none
+ ((GtkListStore store)
+ (GtkTreeIter iter)))
+
;; GtkTreeView [Base]
(define-object GtkTreeView (GtkContainer))
@@ -870,3 +875,8 @@
(define-func gtk_tree_view_get_rules_hint
bool
((GtkTreeView tree)))
+
+(define-func gtk_tree_view_append_column
+ int
+ ((GtkTreeView tree)
+ (GtkTreeViewColumn column)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]