summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--ChangeLog.pre-2-013
-rw-r--r--ChangeLog.pre-2-1013
-rw-r--r--ChangeLog.pre-2-213
-rw-r--r--ChangeLog.pre-2-413
-rw-r--r--ChangeLog.pre-2-613
-rw-r--r--ChangeLog.pre-2-813
-rw-r--r--docs/reference/ChangeLog2
-rwxr-xr-xdocs/tutorial/gtk-tut.sgml117
-rw-r--r--examples/paned/Makefile12
-rw-r--r--examples/paned/paned.c117
-rw-r--r--gdk-pixbuf/ChangeLog6
12 files changed, 188 insertions, 157 deletions
diff --git a/ChangeLog b/ChangeLog
index a56ead4829..eed75915ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index a56ead4829..eed75915ce 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index a56ead4829..eed75915ce 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index a56ead4829..eed75915ce 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index a56ead4829..eed75915ce 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index a56ead4829..eed75915ce 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index a56ead4829..eed75915ce 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,8 @@
+2002-02-17 Matthias Clasen <maclas@gmx.de>
+
+ * docs/tutorial/gtk-tut.sgml, examples/paned/paned.c,
+ examples/paned/Makefile: Make the paned example deprecation-clean.
+
2002-02-17 jacob berkman <jacob@ximian.com>
* Makefile.am: remove the packer example files as they don't exist
@@ -85,7 +90,7 @@
* gdk/linux-fb/miarc.c: use fabs() on a double instead of abs()
-2002-02-17 Matthias Clasen <matthias@YAST_ASK>
+2002-02-17 Matthias Clasen <maclas@gmx.de>
More work on #71430.
@@ -106,11 +111,11 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
-2002-02-16 Matthias Clasen <matthias@YAST_ASK>
+2002-02-16 Matthias Clasen <maclas@gmx.de>
* examples/extract.awk: rearrange rules to not emit the example
start and end markers.
@@ -179,7 +184,7 @@ Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
if anyone complains. (#71317, Morten Welinder.)
-2002-02-14 Matthias Clasen <matthias@YAST_ASK>
+2002-02-14 Matthias Clasen <maclas@gmx.de>
The following changes are the beginning of the work on #71430.
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index 34f211eb18..34c44f52e1 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,4 +1,4 @@
-2002-02-05 Matthias Clasen <matthias@local>
+2002-02-05 Matthias Clasen <maclas@gmx.de>
* gtk/tmpl/gtkrc.sgml: Update the description of RC file loading
to match recent code changes. Also document font_name and engine.
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index 306d4fad00..fe7ca735de 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -7325,11 +7325,13 @@ GtkWidget *create_list( void )
{
GtkWidget *scrolled_window;
- GtkWidget *list;
- GtkWidget *list_item;
-
+ GtkWidget *tree_view;
+ GtkListStore *model;
+ GtkTreeIter iter;
+ GtkCellRenderer *cell;
+ GtkTreeViewColumn *column;
+
int i;
- char buffer[16];
/* Create a new scrolled window, with scrollbars only if needed */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
@@ -7337,22 +7339,34 @@ GtkWidget *create_list( void )
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- /* Create a new list and put it in the scrolled window */
- list = gtk_list_new ();
- gtk_scrolled_window_add_with_viewport (
- GTK_SCROLLED_WINDOW (scrolled_window), list);
- gtk_widget_show (list);
+ model = gtk_list_store_new (1, G_TYPE_STRING);
+ tree_view = gtk_tree_view_new ();
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
+ tree_view);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
+ gtk_widget_show (tree_view);
/* Add some messages to the window */
- for (i=0; i<10; i++) {
-
- sprintf(buffer,"Message #%d",i);
- list_item = gtk_list_item_new_with_label (buffer);
- gtk_container_add (GTK_CONTAINER(list), list_item);
- gtk_widget_show (list_item);
-
+ for (i = 0; i < 10; i++) {
+ gchar *msg = g_strdup_printf ("Message #%d", i);
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model),
+ &iter,
+ 0, msg,
+ -1);
+ g_free (msg);
}
+ cell = gtk_cell_renderer_text_new ();
+
+ column = gtk_tree_view_column_new_with_attributes ("Messages",
+ cell,
+ "text", 0,
+ NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
+ GTK_TREE_VIEW_COLUMN (column));
+
return scrolled_window;
}
@@ -7361,11 +7375,13 @@ when our window is realized. We could also force our window to be
realized with gtk_widget_realize, but it would have to be part of
a hierarchy first */
-void realize_text( GtkWidget *text,
- gpointer data )
+void insert_text (GtkTextBuffer *buffer)
{
- gtk_text_freeze (GTK_TEXT (text));
- gtk_text_insert (GTK_TEXT (text), NULL, &amp;text->style->black, NULL,
+ GtkTextIter iter;
+
+ gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
+
+ gtk_text_buffer_insert (buffer, &iter,
"From: pathfinder@nasa.gov\n"
"To: mom@nasa.gov\n"
"Subject: Made it!\n"
@@ -7374,46 +7390,29 @@ void realize_text( GtkWidget *text,
"great - clear but cold, and there are lots of fun sights.\n"
"Sojourner says hi. See you soon.\n"
" -Path\n", -1);
-
- gtk_text_thaw (GTK_TEXT (text));
}
/* Create a scrolled text area that displays a "message" */
GtkWidget *create_text( void )
{
- GtkWidget *table;
- GtkWidget *text;
- GtkWidget *hscrollbar;
- GtkWidget *vscrollbar;
-
- /* Create a table to hold the text widget and scrollbars */
- table = gtk_table_new (2, 2, FALSE);
-
- /* Put a text widget in the upper left hand corner. Note the use of
- * GTK_SHRINK in the y direction */
- text = gtk_text_new (NULL, NULL);
- gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
- gtk_widget_show (text);
-
- /* Put a HScrollbar in the lower left hand corner */
- hscrollbar = gtk_hscrollbar_new (GTK_TEXT (text)->hadj);
- gtk_table_attach (GTK_TABLE (table), hscrollbar, 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (hscrollbar);
-
- /* And a VScrollbar in the upper right */
- vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj);
- gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
- gtk_widget_show (vscrollbar);
-
- /* Add a handler to put a message in the text widget when it is realized */
- gtk_signal_connect (GTK_OBJECT (text), "realize",
- GTK_SIGNAL_FUNC (realize_text), NULL);
-
- return table;
+ GtkWidget *scrolled_window;
+ GtkWidget *view;
+ GtkTextBuffer *buffer;
+
+ view = gtk_text_view_new ();
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+
+ gtk_container_add (GTK_CONTAINER (scrolled_window), view);
+ insert_text (buffer);
+
+ gtk_widget_show_all (scrolled_window);
+
+ return scrolled_window;
}
int main( int argc,
@@ -7428,7 +7427,7 @@ int main( int argc,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Paned Windows");
- gtk_signal_connect (GTK_OBJECT (window), "destroy",
+ g_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_widget_set_size_request (GTK_WIDGET (window), 450, 400);
@@ -7436,17 +7435,17 @@ int main( int argc,
/* create a vpaned widget and add it to our toplevel window */
vpaned = gtk_vpaned_new ();
- gtk_container_add (GTK_CONTAINER(window), vpaned);
+ gtk_container_add (GTK_CONTAINER (window), vpaned);
gtk_widget_show (vpaned);
/* Now create the contents of the two halves of the window */
list = create_list ();
- gtk_paned_add1 (GTK_PANED(vpaned), list);
+ gtk_paned_add1 (GTK_PANED (vpaned), list);
gtk_widget_show (list);
text = create_text ();
- gtk_paned_add2 (GTK_PANED(vpaned), text);
+ gtk_paned_add2 (GTK_PANED (vpaned), text);
gtk_widget_show (text);
gtk_widget_show (window);
gtk_main ();
diff --git a/examples/paned/Makefile b/examples/paned/Makefile
index 857e53fe26..d1ad1a9a50 100644
--- a/examples/paned/Makefile
+++ b/examples/paned/Makefile
@@ -1,13 +1,11 @@
CC = gcc
-#CFLAGS = -Wall \
-# -DG_DISABLE_DEPRECATED \
-# -DGDK_DISABLE_DEPRECATED \
-# -DGDK_PIXBUF_DISABLE_DEPRECATED \
-# -DGTK_DISABLE_DEPRECATED
-
-CFLAGS = -DGTK_ENABLE_BROKEN
+CFLAGS = -Wall \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED
paned: paned.c
$(CC) paned.c -o paned $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
diff --git a/examples/paned/paned.c b/examples/paned/paned.c
index ce19ea6c86..cd3beb819f 100644
--- a/examples/paned/paned.c
+++ b/examples/paned/paned.c
@@ -7,11 +7,13 @@ GtkWidget *create_list( void )
{
GtkWidget *scrolled_window;
- GtkWidget *list;
- GtkWidget *list_item;
-
+ GtkWidget *tree_view;
+ GtkListStore *model;
+ GtkTreeIter iter;
+ GtkCellRenderer *cell;
+ GtkTreeViewColumn *column;
+
int i;
- char buffer[16];
/* Create a new scrolled window, with scrollbars only if needed */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
@@ -19,22 +21,34 @@ GtkWidget *create_list( void )
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- /* Create a new list and put it in the scrolled window */
- list = gtk_list_new ();
- gtk_scrolled_window_add_with_viewport (
- GTK_SCROLLED_WINDOW (scrolled_window), list);
- gtk_widget_show (list);
+ model = gtk_list_store_new (1, G_TYPE_STRING);
+ tree_view = gtk_tree_view_new ();
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
+ tree_view);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
+ gtk_widget_show (tree_view);
/* Add some messages to the window */
- for (i=0; i<10; i++) {
-
- sprintf(buffer,"Message #%d",i);
- list_item = gtk_list_item_new_with_label (buffer);
- gtk_container_add (GTK_CONTAINER(list), list_item);
- gtk_widget_show (list_item);
-
+ for (i = 0; i < 10; i++) {
+ gchar *msg = g_strdup_printf ("Message #%d", i);
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model),
+ &iter,
+ 0, msg,
+ -1);
+ g_free (msg);
}
+ cell = gtk_cell_renderer_text_new ();
+
+ column = gtk_tree_view_column_new_with_attributes ("Messages",
+ cell,
+ "text", 0,
+ NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
+ GTK_TREE_VIEW_COLUMN (column));
+
return scrolled_window;
}
@@ -43,11 +57,13 @@ when our window is realized. We could also force our window to be
realized with gtk_widget_realize, but it would have to be part of
a hierarchy first */
-void realize_text( GtkWidget *text,
- gpointer data )
+void insert_text (GtkTextBuffer *buffer)
{
- gtk_text_freeze (GTK_TEXT (text));
- gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL,
+ GtkTextIter iter;
+
+ gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
+
+ gtk_text_buffer_insert (buffer, &iter,
"From: pathfinder@nasa.gov\n"
"To: mom@nasa.gov\n"
"Subject: Made it!\n"
@@ -56,46 +72,29 @@ void realize_text( GtkWidget *text,
"great - clear but cold, and there are lots of fun sights.\n"
"Sojourner says hi. See you soon.\n"
" -Path\n", -1);
-
- gtk_text_thaw (GTK_TEXT (text));
}
/* Create a scrolled text area that displays a "message" */
GtkWidget *create_text( void )
{
- GtkWidget *table;
- GtkWidget *text;
- GtkWidget *hscrollbar;
- GtkWidget *vscrollbar;
-
- /* Create a table to hold the text widget and scrollbars */
- table = gtk_table_new (2, 2, FALSE);
-
- /* Put a text widget in the upper left hand corner. Note the use of
- * GTK_SHRINK in the y direction */
- text = gtk_text_new (NULL, NULL);
- gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
- gtk_widget_show (text);
-
- /* Put a HScrollbar in the lower left hand corner */
- hscrollbar = gtk_hscrollbar_new (GTK_TEXT (text)->hadj);
- gtk_table_attach (GTK_TABLE (table), hscrollbar, 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (hscrollbar);
-
- /* And a VScrollbar in the upper right */
- vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj);
- gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
- gtk_widget_show (vscrollbar);
-
- /* Add a handler to put a message in the text widget when it is realized */
- gtk_signal_connect (GTK_OBJECT (text), "realize",
- GTK_SIGNAL_FUNC (realize_text), NULL);
-
- return table;
+ GtkWidget *scrolled_window;
+ GtkWidget *view;
+ GtkTextBuffer *buffer;
+
+ view = gtk_text_view_new ();
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+
+ gtk_container_add (GTK_CONTAINER (scrolled_window), view);
+ insert_text (buffer);
+
+ gtk_widget_show_all (scrolled_window);
+
+ return scrolled_window;
}
int main( int argc,
@@ -110,7 +109,7 @@ int main( int argc,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Paned Windows");
- gtk_signal_connect (GTK_OBJECT (window), "destroy",
+ g_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_widget_set_size_request (GTK_WIDGET (window), 450, 400);
@@ -118,17 +117,17 @@ int main( int argc,
/* create a vpaned widget and add it to our toplevel window */
vpaned = gtk_vpaned_new ();
- gtk_container_add (GTK_CONTAINER(window), vpaned);
+ gtk_container_add (GTK_CONTAINER (window), vpaned);
gtk_widget_show (vpaned);
/* Now create the contents of the two halves of the window */
list = create_list ();
- gtk_paned_add1 (GTK_PANED(vpaned), list);
+ gtk_paned_add1 (GTK_PANED (vpaned), list);
gtk_widget_show (list);
text = create_text ();
- gtk_paned_add2 (GTK_PANED(vpaned), text);
+ gtk_paned_add2 (GTK_PANED (vpaned), text);
gtk_widget_show (text);
gtk_widget_show (window);
gtk_main ();
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 4d6448f347..d139f41347 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,4 +1,4 @@
-2002-02-15 Matthias Clasen <matthias@YAST_ASK>
+2002-02-15 Matthias Clasen <maclas@gmx.de>
* pixops/pixops.c (correct_total): New function to make sure
that the weights sum up to the correct total without introducing
@@ -6,7 +6,7 @@
(tile_make_weights, bilinear_make_fast_weights,
bilinear_make_weights): Use correct_total.
-2002-02-10 Matthias Clasen <matthias@local>
+2002-02-10 Matthias Clasen <maclas@gmx.de>
* test-images.h (tiff1_test_3), test-loaders.c (main): Add a
(#ifdef 0'ed) test provoking a segfault in TIFFReadDirectory().
@@ -28,7 +28,7 @@ Mon Feb 11 14:31:53 2002 Owen Taylor <otaylor@redhat.com>
* pixops/pixops.c (bilinear_make_weights): Fix handing of
overall alpha.
-2002-02-10 Matthias Clasen <matthias@local>
+2002-02-10 Matthias Clasen <maclas@gmx.de>
* test-loaders.c (main): Enable some tests which should work
now.