Use anonymous mark instead of making up a bogus name for first_para_mark

2000-06-23  Havoc Pennington  <hp@redhat.com>

* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark

* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
This commit is contained in:
Havoc Pennington 2000-06-23 19:41:56 +00:00 committed by Havoc Pennington
parent a626ad31e8
commit 797642a563
10 changed files with 61 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -1,3 +1,11 @@
2000-06-23 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_buffer): Use anonymous mark
instead of making up a bogus name for first_para_mark
* gtk/gtkstatusbar.h, gtk/gtkstatusbar.c: Allow
0 as a context ID
Thu Jun 22 17:43:51 BST 2000 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: Change filename. Add Section 3.

View File

@ -202,7 +202,6 @@ gtk_statusbar_push (GtkStatusbar *statusbar,
g_return_val_if_fail (statusbar != NULL, 0);
g_return_val_if_fail (GTK_IS_STATUSBAR (statusbar), 0);
g_return_val_if_fail (text != NULL, 0);
g_return_val_if_fail (context_id > 0, 0);
class = GTK_STATUSBAR_GET_CLASS (statusbar);
msg = g_chunk_new (GtkStatusbarMsg, class->messages_mem_chunk);
@ -228,7 +227,6 @@ gtk_statusbar_pop (GtkStatusbar *statusbar,
g_return_if_fail (statusbar != NULL);
g_return_if_fail (GTK_IS_STATUSBAR (statusbar));
g_return_if_fail (context_id > 0);
if (statusbar->messages)
{
@ -271,7 +269,6 @@ gtk_statusbar_remove (GtkStatusbar *statusbar,
g_return_if_fail (statusbar != NULL);
g_return_if_fail (GTK_IS_STATUSBAR (statusbar));
g_return_if_fail (context_id > 0);
g_return_if_fail (message_id > 0);
msg = statusbar->messages ? statusbar->messages->data : NULL;

View File

@ -84,6 +84,9 @@ struct _GtkStatusbarMsg
GtkType gtk_statusbar_get_type (void);
GtkWidget* gtk_statusbar_new (void);
/* If you don't want to use contexts, 0 is a predefined global
* context_id you can pass to push/pop/remove
*/
guint gtk_statusbar_get_context_id (GtkStatusbar *statusbar,
const gchar *context_description);
/* Returns message_id used for gtk_statusbar_remove */

View File

@ -667,13 +667,10 @@ gtk_text_view_set_buffer (GtkTextView *text_view,
"__drag_target",
&start, FALSE);
/* Initialize. FIXME: Allow anonymous marks and use one here
*/
mark_name = g_strdup_printf ("__first_para_%p", text_view);
text_view->first_para_mark = gtk_text_buffer_create_mark (text_view->buffer,
mark_name,
NULL,
&start, TRUE);
g_free (mark_name);
text_view->first_para_pixels = 0;
gtk_signal_connect (GTK_OBJECT (text_view->buffer), "mark_set",