mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
leave container_class->add and container_class->remove untouched if we
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org> * gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and container_class->remove untouched if we don't implement them. * gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL initialization for the class method (*foreach). implement a default handler to output a warning for (*add) and (*remove).
This commit is contained in:
parent
b78286eab5
commit
6b411f4b47
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
@ -1,3 +1,12 @@
|
||||
Mon Mar 23 01:08:30 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c (gtk_clist_class_init): leave container_class->add and
|
||||
container_class->remove untouched if we don't implement them.
|
||||
|
||||
* gtk/gtkcontainer.c (gtk_container_class_init): add missing NULL
|
||||
initialization for the class method (*foreach). implement a default
|
||||
handler to output a warning for (*add) and (*remove).
|
||||
|
||||
Sun Mar 22 19:01:36 1998 Owen Taylor <owt1@cornell.edu>
|
||||
|
||||
* gdk/gdkcolor.c: Fixes to allow GTK to work with colormaps
|
||||
|
5
TODO
5
TODO
@ -9,11 +9,6 @@ Bugs:
|
||||
GtkLabels sometimes redraw without clearing up the underlying background on
|
||||
window resizes.
|
||||
|
||||
* GtkCList is derived from GtkContainer but doesn't implement the
|
||||
need_resize, focus, add and remove methods from containers.
|
||||
it should at least issue a warning upon invokation of not supported
|
||||
member functions.
|
||||
|
||||
* GtkTree and GtkList should express in their *_add implementations,
|
||||
that they expect GtkListItems/GtkTreeItems as children. Similar
|
||||
things might apply to other containers.
|
||||
|
@ -355,8 +355,8 @@ gtk_clist_class_init (GtkCListClass * klass)
|
||||
widget_class->size_request = gtk_clist_size_request;
|
||||
widget_class->size_allocate = gtk_clist_size_allocate;
|
||||
|
||||
container_class->add = NULL;
|
||||
container_class->remove = NULL;
|
||||
/* container_class->add = NULL; use the default GtkContainerClass warning */
|
||||
/* container_class->remove = NULL; use the default GtkContainerClass warning */
|
||||
container_class->foreach = gtk_clist_foreach;
|
||||
|
||||
klass->select_row = real_select_row;
|
||||
|
@ -79,6 +79,10 @@ static void gtk_container_get_arg (GtkContainer *container,
|
||||
static void gtk_container_set_arg (GtkContainer *container,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_container_add_unimplemented (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_container_remove_unimplemented (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static gint gtk_real_container_need_resize (GtkContainer *container);
|
||||
static gint gtk_real_container_focus (GtkContainer *container,
|
||||
GtkDirectionType direction);
|
||||
@ -193,12 +197,29 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
* accessable through gtk_container_foreach.
|
||||
*/
|
||||
widget_class->show_all = gtk_container_show_all;
|
||||
widget_class->hide_all = gtk_container_hide_all;
|
||||
|
||||
widget_class->hide_all = gtk_container_hide_all;
|
||||
|
||||
class->add = gtk_container_add_unimplemented;
|
||||
class->remove = gtk_container_remove_unimplemented;
|
||||
class->need_resize = gtk_real_container_need_resize;
|
||||
class->foreach = NULL;
|
||||
class->focus = gtk_real_container_focus;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_add_unimplemented (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
g_warning ("GtkContainerClass::add not implemented for `%s'", gtk_type_name (GTK_OBJECT_TYPE (container)));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_remove_unimplemented (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
g_warning ("GtkContainerClass::remove not implemented for `%s'", gtk_type_name (GTK_OBJECT_TYPE (container)));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_init (GtkContainer *container)
|
||||
{
|
||||
@ -325,12 +346,12 @@ gtk_container_remove (GtkContainer *container,
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_return_if_fail (GTK_CONTAINER (widget->parent) == container);
|
||||
g_return_if_fail (widget->parent == GTK_WIDGET (container));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[REMOVE], widget);
|
||||
|
||||
if (container->focus_child == widget)
|
||||
container->focus_child = NULL;
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[REMOVE], widget);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3019,7 +3019,7 @@ unselect_clist (GtkWidget *widget,
|
||||
clist_selected_row = row;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
insert_row_clist (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
static char *text[] =
|
||||
@ -3037,7 +3037,27 @@ insert_row_clist (GtkWidget *widget, gpointer data)
|
||||
clist_rows++;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
clist_warning_test (GtkWidget *button,
|
||||
GtkWidget *clist)
|
||||
{
|
||||
GtkWidget *child;
|
||||
static gboolean add_remove = FALSE;
|
||||
|
||||
add_remove = !add_remove;
|
||||
child = gtk_label_new ("Test");
|
||||
if (add_remove)
|
||||
gtk_container_add (GTK_CONTAINER (clist), child);
|
||||
else
|
||||
{
|
||||
child->parent = clist;
|
||||
gtk_container_remove (GTK_CONTAINER (clist), child);
|
||||
child->parent = NULL;
|
||||
}
|
||||
gtk_widget_destroy (child);
|
||||
}
|
||||
|
||||
static void
|
||||
create_clist ()
|
||||
{
|
||||
gint i;
|
||||
@ -3169,6 +3189,16 @@ create_clist ()
|
||||
|
||||
gtk_widget_show (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Warning Test");
|
||||
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button),
|
||||
"clicked",
|
||||
(GtkSignalFunc) clist_warning_test,
|
||||
(gpointer) clist);
|
||||
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* vbox for the list itself */
|
||||
box2 = gtk_vbox_new (FALSE, 10);
|
||||
gtk_container_border_width (GTK_CONTAINER (box2), 10);
|
||||
|
@ -3019,7 +3019,7 @@ unselect_clist (GtkWidget *widget,
|
||||
clist_selected_row = row;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
insert_row_clist (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
static char *text[] =
|
||||
@ -3037,7 +3037,27 @@ insert_row_clist (GtkWidget *widget, gpointer data)
|
||||
clist_rows++;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
clist_warning_test (GtkWidget *button,
|
||||
GtkWidget *clist)
|
||||
{
|
||||
GtkWidget *child;
|
||||
static gboolean add_remove = FALSE;
|
||||
|
||||
add_remove = !add_remove;
|
||||
child = gtk_label_new ("Test");
|
||||
if (add_remove)
|
||||
gtk_container_add (GTK_CONTAINER (clist), child);
|
||||
else
|
||||
{
|
||||
child->parent = clist;
|
||||
gtk_container_remove (GTK_CONTAINER (clist), child);
|
||||
child->parent = NULL;
|
||||
}
|
||||
gtk_widget_destroy (child);
|
||||
}
|
||||
|
||||
static void
|
||||
create_clist ()
|
||||
{
|
||||
gint i;
|
||||
@ -3169,6 +3189,16 @@ create_clist ()
|
||||
|
||||
gtk_widget_show (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Warning Test");
|
||||
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button),
|
||||
"clicked",
|
||||
(GtkSignalFunc) clist_warning_test,
|
||||
(gpointer) clist);
|
||||
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* vbox for the list itself */
|
||||
box2 = gtk_vbox_new (FALSE, 10);
|
||||
gtk_container_border_width (GTK_CONTAINER (box2), 10);
|
||||
|
Loading…
Reference in New Issue
Block a user