mirror of
https://gitlab.gnome.org/GNOME/glade.git
synced 2025-10-06 00:05:26 -04:00
Handle writing of the internal-child attribute.
This commit is contained in:
parent
39dd3c2680
commit
61bb4a2894
@ -1,7 +1,8 @@
|
||||
2003-10-23 Paolo Borelli <pborelli@katamail.com>
|
||||
|
||||
* src/glade-widget.[ch]: add glade_widget_new_for_internal_child and
|
||||
add an internal field to the GladeWidget struct.
|
||||
add an internal field to the GladeWidget struct. Handle writing the
|
||||
internal-child attribute to the glade file; reading still needs work.
|
||||
* src/glade-gtk.c: create the GladeWidgets for the internal children
|
||||
in dialog_fill_empty
|
||||
* src/glade-placeholder.c: don't walk up the widget hierarchy when
|
||||
|
@ -492,3 +492,31 @@ glade_util_delete_selection (GladeProject *project)
|
||||
g_list_free (free_me);
|
||||
}
|
||||
|
||||
/*
|
||||
* taken from gtk... maybe someday we can convince them to
|
||||
* expose gtk_container_get_all_children
|
||||
*/
|
||||
static void
|
||||
gtk_container_children_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
GList **children;
|
||||
|
||||
children = (GList**) client_data;
|
||||
*children = g_list_prepend (*children, widget);
|
||||
}
|
||||
|
||||
GList *
|
||||
glade_util_container_get_all_children (GtkContainer *container)
|
||||
{
|
||||
GList *children = NULL;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
|
||||
|
||||
gtk_container_foreach (container,
|
||||
gtk_container_children_callback,
|
||||
&children);
|
||||
|
||||
return g_list_reverse (children);
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,8 @@ void glade_util_add_nodes (GtkWidget *widget);
|
||||
void glade_util_remove_nodes (GtkWidget *widget);
|
||||
gboolean glade_util_has_nodes (GtkWidget *widget);
|
||||
|
||||
GList *glade_util_container_get_all_children (GtkContainer *container);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "glade-clipboard.h"
|
||||
#include "glade-command.h"
|
||||
#include "glade-debug.h"
|
||||
#include "glade-utils.h"
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
/**
|
||||
@ -1205,7 +1206,6 @@ glade_widget_write_child (GladeXmlContext *context, GtkWidget *gtk_widget);
|
||||
GladeXmlNode *
|
||||
glade_widget_write (GladeXmlContext *context, GladeWidget *widget)
|
||||
{
|
||||
|
||||
GladeXmlNode *node;
|
||||
GladeXmlNode *child;
|
||||
GList *list;
|
||||
@ -1244,7 +1244,7 @@ glade_widget_write (GladeXmlContext *context, GladeWidget *widget)
|
||||
|
||||
/* Children */
|
||||
if (GTK_IS_CONTAINER (widget->widget)) {
|
||||
list = gtk_container_get_children (GTK_CONTAINER (widget->widget));
|
||||
list = glade_util_container_get_all_children (GTK_CONTAINER (widget->widget));
|
||||
for (; list; list = list->next) {
|
||||
GtkWidget *child_widget;
|
||||
child_widget = GTK_WIDGET (list->data);
|
||||
@ -1279,9 +1279,11 @@ glade_widget_write_child (GladeXmlContext *context, GtkWidget *gtk_widget)
|
||||
|
||||
child_widget = glade_widget_get_from_gtk_widget (gtk_widget);
|
||||
if (!child_widget)
|
||||
/* internal child... */
|
||||
return NULL;
|
||||
|
||||
if (child_widget->internal)
|
||||
glade_xml_node_set_property_string (child_tag, GLADE_XML_TAG_INTERNAL_CHILD, child_widget->internal);
|
||||
|
||||
child = glade_widget_write (context, child_widget);
|
||||
if (!child) {
|
||||
g_warning ("Failed to write child widget");
|
||||
|
Loading…
x
Reference in New Issue
Block a user