projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tweak : select the first widget by default
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
modules
/
gui
/
lttvwindow
/
lttvwindow
/
callbacks.c
diff --git
a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
index 455113bc9ee0609bb74eaf32302dc01e33ea4373..1ea288a5dd14ad2568c4bf20d43a45c3fdaf648d 100644
(file)
--- a/
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
+++ b/
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
@@
-227,9
+227,7
@@
void insert_viewer(GtkWidget* widget, lttvwindow_viewer_constructor constructor)
* child of this widget. The little trick is to get each child
* of each GTK_CONTAINER, even subchildren.
*/
* child of this widget. The little trick is to get each child
* of each GTK_CONTAINER, even subchildren.
*/
- {
- connect_focus_recursive(viewer, viewer);
- }
+ connect_focus_recursive(viewer, viewer);
}
}
}
}
@@
-472,6
+470,11
@@
void create_new_window(GtkWidget* widget, gpointer user_data, gboolean clone)
}
}
}
}
+/* Get the currently focused viewer.
+ * If no viewer is focused, use the first one.
+ *
+ * If no viewer available, return NULL.
+ */
GtkWidget *viewer_container_focus(GtkWidget *container)
{
GtkWidget *widget;
GtkWidget *viewer_container_focus(GtkWidget *container)
{
GtkWidget *widget;
@@
-479,7
+482,14
@@
GtkWidget *viewer_container_focus(GtkWidget *container)
widget = (GtkWidget*)g_object_get_data(G_OBJECT(container),
"focused_viewer");
widget = (GtkWidget*)g_object_get_data(G_OBJECT(container),
"focused_viewer");
- if(widget == NULL) g_debug("no widget focused");
+ if(widget == NULL) {
+ g_debug("no widget focused");
+ GList *children = gtk_container_get_children(GTK_CONTAINER(container));
+
+ if(children != NULL)
+ widget = GTK_WIDGET(children->data);
+ }
+
return widget;
return widget;
This page took
0.023412 seconds
and
4
git commands to generate.