summaryrefslogtreecommitdiff
path: root/gtk/gtksocket.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-06-08 18:09:34 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-06-08 18:09:34 +0000
commit74e7da214f1ee9b98304145813814d4f73a97a15 (patch)
treefc3dd7f61cea4cabf3fc5dc44dc8fbd9ca691b30 /gtk/gtksocket.c
parent72ef055bde913c993d4a38964542b1d1c4470e1b (diff)
downloadgtk+-74e7da214f1ee9b98304145813814d4f73a97a15.tar.gz
geez, don't call g_list funcs on GSList
2001-06-08 Havoc Pennington <hp@redhat.com> * gtk/gtktextbuffer.c (gtk_text_buffer_remove_all_tags): geez, don't call g_list funcs on GSList * gtk/gtkwidget.c (gtk_widget_child_focus): replaces gtk_container_focus(), since some widgets have focusable locations which are not other widgets. These widgets should not have to be containers just to manage the focus. For example, GtkHSV is currently a container for no good reason. Also, this cleans up the "if (is_container && is_sensitive && is_drawable) container_focus ()" mess in widget implementations. * gtk/gtkcontainer.c (gtk_container_focus): deprecate this function, and have it just call gtk_widget_child_focus(). * gtk/gtkhsv.c: derive from widget not container Throughout: fix to reflect GtkContainer::focus change
Diffstat (limited to 'gtk/gtksocket.c')
-rw-r--r--gtk/gtksocket.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index 42eb0e67ad..754ca0e0f9 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -57,7 +57,7 @@ static void gtk_socket_claim_focus (GtkSocket *socket
static gboolean gtk_socket_focus_out_event (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_socket_send_configure_event (GtkSocket *socket);
-static gboolean gtk_socket_focus (GtkContainer *container,
+static gboolean gtk_socket_focus (GtkWidget *widget,
GtkDirectionType direction);
static GdkFilterReturn gtk_socket_filter_func (GdkXEvent *gdk_xevent,
GdkEvent *event,
@@ -126,7 +126,7 @@ gtk_socket_class_init (GtkSocketClass *class)
widget_class->focus_in_event = gtk_socket_focus_in_event;
widget_class->focus_out_event = gtk_socket_focus_out_event;
- container_class->focus = gtk_socket_focus;
+ widget_class->focus = gtk_socket_focus;
}
static void
@@ -702,16 +702,16 @@ gtk_socket_claim_focus (GtkSocket *socket)
}
static gboolean
-gtk_socket_focus (GtkContainer *container, GtkDirectionType direction)
+gtk_socket_focus (GtkWidget *widget, GtkDirectionType direction)
{
GtkSocket *socket;
gint detail = -1;
- g_return_val_if_fail (GTK_IS_SOCKET (container), FALSE);
+ g_return_val_if_fail (GTK_IS_SOCKET (widget), FALSE);
- socket = GTK_SOCKET (container);
+ socket = GTK_SOCKET (widget);
- if (!GTK_WIDGET_HAS_FOCUS (container))
+ if (!GTK_WIDGET_HAS_FOCUS (widget))
{
switch (direction)
{
@@ -730,8 +730,8 @@ gtk_socket_focus (GtkContainer *container, GtkDirectionType direction)
send_xembed_message (socket, XEMBED_FOCUS_IN, detail, 0, 0,
gtk_get_current_event_time ());
- GTK_WIDGET_SET_FLAGS (container, GTK_HAS_FOCUS);
- gtk_widget_grab_focus (GTK_WIDGET (container));
+ GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
+ gtk_widget_grab_focus (widget);
return TRUE;
}
@@ -935,11 +935,11 @@ handle_xembed_message (GtkSocket *socket,
case XEMBED_FOCUS_PREV:
{
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (socket));
- if (toplevel && GTK_IS_CONTAINER (toplevel))
+ if (toplevel)
{
- gtk_container_focus (GTK_CONTAINER (toplevel),
- (message == XEMBED_FOCUS_NEXT ?
- GTK_DIR_TAB_FORWARD : GTK_DIR_TAB_BACKWARD));
+ gtk_widget_child_focus (toplevel,
+ (message == XEMBED_FOCUS_NEXT ?
+ GTK_DIR_TAB_FORWARD : GTK_DIR_TAB_BACKWARD));
}
break;
}