+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
+Sat Nov 18 18:00:17 2000 Jonathan Blandford <jrb@redhat.com>
+
+ * demos/gtk-demo/main.c: Changed to have the list become
+ non-italic when the demo window is destroyed through an external
+ event (like a close button). Doing so found three bugs in the
+ widget.
+
+ * demos/gtk-demo/*.c (do_*): Changed to return the toplevel window.
+
+ * gtk/gtkliststore.c (gtk_list_store_set_cell): emit "change" when
+ we actually set the cell.
+
+ * gtk/gtktreestore.c (gtk_tree_store_set_cell): ditto
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
+ free a leaked path. Thanks memprof.
+
Sat Nov 18 11:58:17 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c (gdk_rgb_allocate_images): Fix
return frame;
}
-void
+GtkWidget *
do_button_box (void)
{
static GtkWidget* window = NULL;
}
if (!GTK_WIDGET_VISIBLE (window))
- gtk_widget_show_all (window);
+ {
+ gtk_widget_show_all (window);
+ }
else
- gtk_widget_destroy (window);
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
}
#!/usr/bin/perl -w
print <<EOT;
+typedef GtkWidget *(*GDoDemoFunc) (void);
+
typedef struct _Demo Demo;
struct _Demo
{
gchar *title;
gchar *filename;
- void (*func) (void);
+ GDoDemoFunc func;
};
EOT
close INFO_FILE;
- print "void do_$basename (void);\n";
+ print "GtkWidget *do_$basename (void);\n";
$array .= qq( { "$title", "$file", do_$basename });
}
#!/usr/bin/perl -w
print <<EOT;
+typedef GtkWidget *(*GDoDemoFunc) (void);
+
typedef struct _Demo Demo;
struct _Demo
{
gchar *title;
gchar *filename;
- void (*func) (void);
+ GDoDemoFunc func;
};
EOT
close INFO_FILE;
- print "void do_$basename (void);\n";
+ print "GtkWidget *do_$basename (void);\n";
$array .= qq( { "$title", "$file", do_$basename });
}
static int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
-void
+GtkWidget *
do_item_factory (void)
{
static GtkWidget *window = NULL;
gtk_widget_show_all (window);
}
else
- gtk_widget_destroy (window);
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
}
NUM_COLUMNS
};
+typedef struct _CallbackData CallbackData;
+struct _CallbackData
+{
+ GtkTreeModel *model;
+ GtkTreePath *path;
+};
+
+static void
+window_closed_cb (GtkWidget *window, gpointer data)
+{
+ CallbackData *cbdata = data;
+ GtkTreeIter iter;
+ gboolean italic;
+
+ gtk_tree_model_get_iter (cbdata->model, &iter, cbdata->path);
+ gtk_tree_store_get (GTK_TREE_STORE (cbdata->model), &iter,
+ ITALIC_COLUMN, &italic,
+ -1);
+ if (italic)
+ gtk_tree_store_set (GTK_TREE_STORE (cbdata->model), &iter,
+ ITALIC_COLUMN, !italic,
+ -1);
+
+ gtk_tree_path_free (cbdata->path);
+ g_free (cbdata);
+}
+
gboolean
read_line (FILE *stream, GString *str)
{
{
GtkTreeIter iter;
gboolean italic;
- GVoidFunc func;
+ GDoDemoFunc func;
+ GtkWidget *window;
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_store_get (GTK_TREE_STORE (model),
FUNC_COLUMN, &func,
ITALIC_COLUMN, &italic,
-1);
- (func) ();
gtk_tree_store_set (GTK_TREE_STORE (model),
&iter,
ITALIC_COLUMN, !italic,
-1);
- gtk_tree_path_free (path);
+ window = (func) ();
+ if (window != NULL)
+ {
+ CallbackData *cbdata;
+
+ cbdata = g_new (CallbackData, 1);
+ cbdata->model = model;
+ cbdata->path = path;
+
+ gtk_signal_connect (GTK_OBJECT (window),
+ "destroy",
+ window_closed_cb,
+ cbdata);
+ }
+ else
+ {
+ gtk_tree_path_free (path);
+ }
}
gtk_signal_emit_stop_by_name (GTK_OBJECT (tree_view),
return menu;
}
-void
+GtkWidget *
do_menus (void)
{
static GtkWidget *window = NULL;
}
if (!GTK_WIDGET_VISIBLE (window))
- gtk_widget_show (window);
+ {
+ gtk_widget_show (window);
+ }
else
- gtk_widget_destroy (window);
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
}
return frame;
}
-void
+GtkWidget *
do_panes (void)
{
static GtkWidget *window = NULL;
}
if (!GTK_WIDGET_VISIBLE (window))
- gtk_widget_show (window);
+ {
+ gtk_widget_show (window);
+ }
else
- gtk_widget_destroy (window);
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
}
GtkTextIter start, end;
GdkPixbuf *pixbuf;
- pixbuf = gdk_pixbuf_new_from_xpm_data (book_closed_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) book_closed_xpm);
/* get start of buffer; each insertion will revalidate the
* iterator to point to just after the inserted text.
g_object_unref (G_OBJECT (pixbuf));
}
-void
+GtkWidget *
do_textview (void)
{
static GtkWidget *window = NULL;
}
if (!GTK_WIDGET_VISIBLE (window))
- gtk_widget_show (window);
+ {
+ gtk_widget_show (window);
+ }
else
- gtk_widget_destroy (window);
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+ return window;
}
if (column == 0)
{
_gtk_tree_data_list_value_to_node (list, value);
+ gtk_signal_emit_by_name (GTK_OBJECT (list_store),
+ "changed",
+ NULL, iter);
return;
}
}
else
selected = TRUE;
+ gtk_tree_path_free (path);
}
if (selected == TRUE)
{
if (column == 0)
{
_gtk_tree_data_list_value_to_node (list, value);
+ gtk_signal_emit_by_name (GTK_OBJECT (tree_store),
+ "changed",
+ NULL, iter);
return;
}
else
{
/* FIXME: just redraw the node */
- gtk_widget_queue_resize (GTK_WIDGET (data));
+ gtk_widget_queue_draw (GTK_WIDGET (data));
}
}