summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-01-02 03:49:09 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-02 03:49:09 +0000
commit290e4efdfeff91b7abad43bb9644e4c8e0ff9887 (patch)
treea8327917ea81dccf0ea7b563bc6f1839de66c1b9 /tests
parente7153de001f47adcba65c007b202dc583e21e09a (diff)
downloadgtk+-290e4efdfeff91b7abad43bb9644e4c8e0ff9887.tar.gz
propagate exposes to no window children not in the buffer window.
2002-01-01 Havoc Pennington <hp@pobox.com> * gtk/gtktextview.c (gtk_text_view_expose_event): propagate exposes to no window children not in the buffer window. (gtk_text_view_class_init): add move_focus bindings for Ctrl-Tab - is this the right way to do it? (gtk_text_view_focus): add focus method, just chains up for now, I'm not sure why the GtkContainer implementation doesn't work * gtk/gtktextbtree.c (_gtk_text_btree_insert_child_anchor): fill in the text line for the child anchor segment * tests/testtext.c (do_add_focus_children): add another test example (to put focusable buttons into the widget)
Diffstat (limited to 'tests')
-rw-r--r--tests/testtext.c69
1 files changed, 68 insertions, 1 deletions
diff --git a/tests/testtext.c b/tests/testtext.c
index 151fdd5612..e153fe204f 100644
--- a/tests/testtext.c
+++ b/tests/testtext.c
@@ -1378,6 +1378,71 @@ do_add_children (gpointer callback_data,
}
static void
+do_add_focus_children (gpointer callback_data,
+ guint callback_action,
+ GtkWidget *widget)
+{
+ View *view = view_from_widget (widget);
+ GtkWidget *child;
+ GtkTextChildAnchor *anchor;
+ GtkTextIter iter;
+ GtkTextView *text_view;
+
+ text_view = GTK_TEXT_VIEW (view->text_view);
+
+ child = gtk_button_new_with_mnemonic ("Button _A in widget->window");
+
+ gtk_text_view_add_child_in_window (text_view,
+ child,
+ GTK_TEXT_WINDOW_WIDGET,
+ 200, 200);
+
+ child = gtk_button_new_with_mnemonic ("Button _B in widget->window");
+
+ gtk_text_view_add_child_in_window (text_view,
+ child,
+ GTK_TEXT_WINDOW_WIDGET,
+ 350, 300);
+
+ child = gtk_button_new_with_mnemonic ("Button _C in left window");
+
+ gtk_text_view_add_child_in_window (text_view,
+ child,
+ GTK_TEXT_WINDOW_LEFT,
+ 0, 0);
+
+ child = gtk_button_new_with_mnemonic ("Button _D in right window");
+
+ gtk_text_view_add_child_in_window (text_view,
+ child,
+ GTK_TEXT_WINDOW_RIGHT,
+ 0, 0);
+
+ gtk_text_buffer_get_start_iter (view->buffer->buffer, &iter);
+
+ anchor = gtk_text_buffer_create_child_anchor (view->buffer->buffer, &iter);
+
+ child = gtk_button_new_with_mnemonic ("Button _E in buffer");
+
+ gtk_text_view_add_child_at_anchor (text_view, child, anchor);
+
+ anchor = gtk_text_buffer_create_child_anchor (view->buffer->buffer, &iter);
+
+ child = gtk_button_new_with_mnemonic ("Button _F in buffer");
+
+ gtk_text_view_add_child_at_anchor (text_view, child, anchor);
+
+ anchor = gtk_text_buffer_create_child_anchor (view->buffer->buffer, &iter);
+
+ child = gtk_button_new_with_mnemonic ("Button _G in buffer");
+
+ gtk_text_view_add_child_at_anchor (text_view, child, anchor);
+
+ /* show all the buttons */
+ gtk_widget_show_all (view->text_view);
+}
+
+static void
view_init_menus (View *view)
{
GtkTextDirection direction = gtk_widget_get_direction (view->text_view);
@@ -1470,6 +1535,7 @@ static GtkItemFactoryEntry menu_items[] =
{ "/Test/_Example", NULL, do_example, 0, NULL },
{ "/Test/_Insert and scroll", NULL, do_insert_and_scroll, 0, NULL },
{ "/Test/_Add fixed children", NULL, do_add_children, 0, NULL },
+ { "/Test/A_dd focusable children", NULL, do_add_focus_children, 0, NULL },
};
static gboolean
@@ -2331,7 +2397,8 @@ line_numbers_expose (GtkWidget *widget,
g_object_unref (G_OBJECT (layout));
- return TRUE;
+ /* don't stop emission, need to draw children */
+ return FALSE;
}
static View *