Commit 9adcd8a4 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

change demo install dir to datadir/gtk+-2.0/demo

2000-11-12  Havoc Pennington  <hp@pobox.com>

* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo

* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.

* demos/gtk-demo/Makefile.am (demos): Add textview.c

* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.

* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics

* gtk/testtext.c: don't leak the buffer with GObject semantics

* gtk/testtextbuffer.c: ditto
parent 213680a4
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
2000-11-12 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/Makefile.am (democodedir): change demo install
dir to datadir/gtk+-2.0/demo
* demos/gtk-demo/textview.c: Text widget demo; reveals all
sorts of text widget and Pango font bugs. Urgh.
* demos/gtk-demo/Makefile.am (demos): Add textview.c
* demos/gtk-demo/main.c (create_tree): Add instructions at top of
tree that you should double click to see the demo. Fix
types of variables to reflect changed return values from
GtkTreeStore and GtkTreeViewColumn constructors.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): ref/sink the
newly-created buffer to prepare for GObject semantics
* gtk/testtext.c: don't leak the buffer with GObject semantics
* gtk/testtextbuffer.c: ditto
2000-11-12 Havoc Pennington <hp@pobox.com>
Rename this testgtk to gtk-demo to avoid confusion, and
......
## Makefile.am for gtk+/demos
democodedir=$(datadir)/gtk-demo
democodedir=$(datadir)/gtk-2.0/demo
demos = @STRIP_BEGIN@ \
button_box.c \
item_factory.c \
menus.c \
panes.c \
textview.c \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
......
......@@ -307,8 +307,8 @@ create_tree (void)
GtkTreeSelection *selection;
GtkCellRenderer *cell;
GtkWidget *tree_view;
GtkObject *column;
GtkObject *model;
GtkTreeViewColumn *column;
GtkTreeStore *model;
GtkTreeIter iter;
gint i;
......@@ -334,7 +334,7 @@ create_tree (void)
}
cell = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Widget",
column = gtk_tree_view_column_new_with_attributes ("Widget (double click for demo)",
cell,
"text", TITLE_COLUMN,
"italic", ITALIC_COLUMN,
......
......@@ -262,6 +262,9 @@ gtk_text_buffer_new (GtkTextTagTable *table)
gtk_object_sink (GTK_OBJECT (text_buffer->tag_table));
}
gtk_object_ref (GTK_OBJECT (text_buffer));
gtk_object_sink (GTK_OBJECT (text_buffer));
return text_buffer;
}
......
......@@ -252,6 +252,7 @@ void gtk_text_buffer_remove_tag_by_name (GtkTextBuffer *buffer,
/* You can either ignore the return value, or use it to
* set the attributes of the tag. tag_name can be NULL
*/
/* FIXME this should take a varargs list of tag attributes I think */
GtkTextTag *gtk_text_buffer_create_tag (GtkTextBuffer *buffer,
const gchar *tag_name);
......
......@@ -2443,7 +2443,7 @@ gtk_text_view_draw (GtkWidget *widget, GdkRectangle *area)
text_view = GTK_TEXT_VIEW (widget);
gtk_text_view_paint (widget, area);
/* If the area overlaps the "edge" of the widget, draw the focus
* rectangle
*/
......@@ -2452,7 +2452,7 @@ gtk_text_view_draw (GtkWidget *widget, GdkRectangle *area)
(area->x + area->width) > (widget->allocation.width - FOCUS_EDGE_WIDTH) ||
(area->y + area->height) > (widget->allocation.height - FOCUS_EDGE_WIDTH))
gtk_widget_draw_focus (widget);
/* Synthesize expose events for the user-drawn border windows,
* just as we would for a drawing area.
*/
......@@ -2480,14 +2480,14 @@ gtk_text_view_draw (GtkWidget *widget, GdkRectangle *area)
static gint
gtk_text_view_expose_event (GtkWidget *widget, GdkEventExpose *event)
{
{
if (event->window == gtk_text_view_get_window (GTK_TEXT_VIEW (widget),
GTK_TEXT_WINDOW_TEXT))
gtk_text_view_paint (widget, &event->area);
if (event->window == widget->window)
gtk_widget_draw_focus (widget);
return TRUE;
}
......
......@@ -1023,9 +1023,10 @@ do_search (gpointer callback_data,
buffer = gtk_text_buffer_new (NULL);
/* FIXME memory leak once buffer is a GObject */
search_text = gtk_text_view_new_with_buffer (buffer);
g_object_unref (G_OBJECT (buffer));
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
search_text,
TRUE, TRUE, 0);
......@@ -1276,8 +1277,6 @@ create_buffer (void)
buffer = g_new (Buffer, 1);
buffer->buffer = gtk_text_buffer_new (NULL);
gtk_object_ref (GTK_OBJECT (buffer->buffer));
gtk_object_sink (GTK_OBJECT (buffer->buffer));
buffer->refcount = 1;
buffer->filename = NULL;
......
......@@ -66,6 +66,8 @@ main (int argc, char** argv)
run_tests (buffer);
g_object_unref (G_OBJECT (buffer));
g_print ("All tests passed.\n");
return 0;
......
......@@ -1023,9 +1023,10 @@ do_search (gpointer callback_data,
buffer = gtk_text_buffer_new (NULL);
/* FIXME memory leak once buffer is a GObject */
search_text = gtk_text_view_new_with_buffer (buffer);
g_object_unref (G_OBJECT (buffer));
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
search_text,
TRUE, TRUE, 0);
......@@ -1276,8 +1277,6 @@ create_buffer (void)
buffer = g_new (Buffer, 1);
buffer->buffer = gtk_text_buffer_new (NULL);
gtk_object_ref (GTK_OBJECT (buffer->buffer));
gtk_object_sink (GTK_OBJECT (buffer->buffer));
buffer->refcount = 1;
buffer->filename = NULL;
......
......@@ -66,6 +66,8 @@ main (int argc, char** argv)
run_tests (buffer);
g_object_unref (G_OBJECT (buffer));
g_print ("All tests passed.\n");
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment