handle box signals. fixups for 99.4 -timj

handle box signals.
fixups for 99.4
-timj
This commit is contained in:
Tim Janik 1998-02-28 19:09:20 +00:00
parent fa26673f49
commit 6d3ef70d1e
14 changed files with 178 additions and 28 deletions

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

View File

@ -1,5 +1,14 @@
Sat Feb 28 19:29:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkclist.c (gtk_clist_new_with_titles): retrive the clist widget
from gtk_type_new (gtk_clist_get_type ()), not gtk_clist_new(),
otherwise gtk_clist_construct() gets called twice.
* gtk/gtkhandlebox.h:
* gtk/gtkhandlebox.c: emit signals when the child is attached/detached.
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org>
* gtk/gtkpreview.c: fix behavior of gtk_preview_put() with
srcx/srcy != 0, gtk-shige-980127-0.patch.gz by
AOSASA Shigeru <aozasa@sakuranet.or.jp>.

1
NEWS
View File

@ -22,6 +22,7 @@ Forthcoming Changes for GTK+ 0.99.4:
g_string_hash() -> g_str_hash()
g_string_equal() -> g_str_equal()
gtk_tooltips_set_tips() -> gtk_tooltips_set_tip()
* Motif window mangaer hints support.
* Clean ups and many many bug fixes by a lot of people all over the place.
* New, long and descriptive ChangeLog entries for bored readers ;)

View File

@ -467,19 +467,14 @@ GtkWidget *
gtk_clist_new_with_titles (gint columns,
gchar * titles[])
{
GtkCList *clist;
GtkWidget *widget;
if (titles == NULL)
return NULL;
g_return_val_if_fail (titles != NULL, NULL);
widget = gtk_type_new (gtk_clist_get_type ());
gtk_clist_construct (GTK_CLIST (widget), columns, titles);
widget = gtk_clist_new (columns);
if (!widget)
return NULL;
else
clist = GTK_CLIST (widget);
gtk_clist_construct (clist, columns, titles);
return widget;
}

View File

@ -255,8 +255,8 @@ gtk_combo_popup_list (GtkButton * button, GtkCombo * combo)
gtk_widget_set_uposition (combo->popwin, x, y);
gtk_widget_set_usize (combo->popwin, width, height);
gtk_widget_realize (combo->popwin);
gdk_window_set_cursor (combo->popwin->window,
gdk_cursor_new (GDK_TOP_LEFT_ARROW));
/* gdk_window_set_cursor (combo->popwin->window, gdk_cursor_new (GDK_TOP_LEFT_ARROW));
*/
gdk_window_resize (combo->popwin->window, width, height);
gtk_widget_show (combo->popwin);
gtk_widget_grab_focus (combo->popwin);

View File

@ -71,6 +71,7 @@ static gint gtk_handle_box_delete_float (GtkWidget *widget,
static GtkBinClass *parent_class;
static gint handle_box_signals[SIGNAL_LAST] = { 0 };
guint
@ -97,6 +98,19 @@ gtk_handle_box_get_type (void)
return handle_box_type;
}
static void
gtk_handle_box_marshal_child_attached (GtkObject *object,
GtkSignalFunc func,
gpointer func_data,
GtkArg *args)
{
SignalChildAttached sfunc = (SignalChildAttached) func;
(* sfunc) (object,
(GtkWidget*) GTK_VALUE_OBJECT (args[0]),
func_data);
}
static void
gtk_handle_box_class_init (GtkHandleBoxClass *class)
{
@ -108,6 +122,24 @@ gtk_handle_box_class_init (GtkHandleBoxClass *class)
parent_class = gtk_type_class (gtk_bin_get_type ());
handle_box_signals[SIGNAL_CHILD_ATTACHED] =
gtk_signal_new ("child_attached",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkHandleBoxClass, child_attached),
gtk_handle_box_marshal_child_attached,
GTK_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
handle_box_signals[SIGNAL_CHILD_DETACHED] =
gtk_signal_new ("child_detached",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkHandleBoxClass, child_detached),
gtk_handle_box_marshal_child_attached,
GTK_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
gtk_object_class_add_signals (object_class, handle_box_signals, SIGNAL_LAST);
object_class->destroy = gtk_handle_box_destroy;
widget_class->map = gtk_handle_box_map;
@ -602,6 +634,10 @@ gtk_handle_box_motion (GtkWidget *widget,
gtk_widget_hide (hb->float_window);
gtk_signal_emit (GTK_OBJECT (hb),
handle_box_signals[SIGNAL_CHILD_ATTACHED],
GTK_BIN (hb)->child);
while (gdk_pointer_grab (widget->window,
FALSE,
(GDK_BUTTON1_MOTION_MASK
@ -610,7 +646,7 @@ gtk_handle_box_motion (GtkWidget *widget,
NULL,
hb->fleur_cursor,
GDK_CURRENT_TIME) != 0); /* wait for success */
gtk_widget_queue_resize (widget);
}
}
@ -634,6 +670,10 @@ gtk_handle_box_motion (GtkWidget *widget,
gdk_window_reparent (widget->window, hb->float_window->window, 0, 0);
gtk_widget_show (hb->float_window);
gtk_signal_emit (GTK_OBJECT (hb),
handle_box_signals[SIGNAL_CHILD_DETACHED],
GTK_BIN (hb)->child);
while (gdk_pointer_grab (widget->window,
FALSE,
(GDK_BUTTON1_MOTION_MASK
@ -669,6 +709,11 @@ gtk_handle_box_delete_float (GtkWidget *widget,
gdk_window_reparent (GTK_WIDGET (hb)->window, hb->steady_window, 0, 0);
gtk_widget_hide (hb->float_window);
gtk_signal_emit (GTK_OBJECT (hb),
handle_box_signals[SIGNAL_CHILD_ATTACHED],
GTK_BIN (hb)->child);
gtk_widget_queue_resize (GTK_WIDGET (hb));
return FALSE;

View File

@ -235,7 +235,7 @@ static const gchar *event_key = "gtk-event-mask";
static const gchar *extension_event_key = "gtk-extension-event-mode";
static const gchar *parent_window_key = "gtk-parent-window";
static const gchar *shape_info_key = "gtk-shape-info";
static const gchar *saved_default_style = "gtk-saved-default-style";
static const gchar *saved_default_style_key = "gtk-saved-default-style";
@ -2349,11 +2349,11 @@ gtk_widget_set_style (GtkWidget *widget,
GTK_WIDGET_UNSET_FLAGS (widget, GTK_RC_STYLE);
GTK_PRIVATE_SET_FLAG (widget, GTK_USER_STYLE);
default_style = gtk_object_get_data (GTK_OBJECT (widget), saved_default_style);
default_style = gtk_object_get_data (GTK_OBJECT (widget), saved_default_style_key);
if (!default_style)
{
gtk_style_ref (widget->style);
gtk_object_set_data (GTK_OBJECT (widget), saved_default_style, widget->style);
gtk_object_set_data (GTK_OBJECT (widget), saved_default_style_key, widget->style);
}
gtk_widget_set_style_internal (widget, style, initial_emission);
@ -2381,14 +2381,14 @@ gtk_widget_set_rc_style (GtkWidget *widget)
GTK_PRIVATE_UNSET_FLAG (widget, GTK_USER_STYLE);
GTK_WIDGET_SET_FLAGS (widget, GTK_RC_STYLE);
saved_style = gtk_object_get_data (GTK_OBJECT (widget), saved_default_style);
saved_style = gtk_object_get_data (GTK_OBJECT (widget), saved_default_style_key);
new_style = gtk_rc_get_style (widget);
if (new_style)
{
if (!saved_style)
{
gtk_style_ref (widget->style);
gtk_object_set_data (GTK_OBJECT (widget), saved_default_style, widget->style);
gtk_object_set_data (GTK_OBJECT (widget), saved_default_style_key, widget->style);
}
gtk_widget_set_style_internal (widget, new_style, initial_emission);
}
@ -2398,7 +2398,7 @@ gtk_widget_set_rc_style (GtkWidget *widget)
{
g_assert (initial_emission == FALSE); /* FIXME: remove this line */
gtk_object_remove_data (GTK_OBJECT (widget), saved_default_style);
gtk_object_remove_data (GTK_OBJECT (widget), saved_default_style_key);
gtk_widget_set_style_internal (widget, saved_style, initial_emission);
gtk_style_unref (saved_style);
}
@ -3297,6 +3297,7 @@ static void
gtk_widget_real_destroy (GtkObject *object)
{
GtkWidget *widget = GTK_WIDGET (object);
GtkStyle *saved_style;
gtk_widget_ref (widget);
@ -3321,6 +3322,13 @@ gtk_widget_real_destroy (GtkObject *object)
if (widget->parent)
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
saved_style = gtk_object_get_data (GTK_OBJECT (widget), saved_default_style_key);
if (saved_style)
{
gtk_style_unref (saved_style);
gtk_object_remove_data (GTK_OBJECT (widget), saved_default_style_key);
}
gtk_style_unref (widget->style);
widget->style = NULL;

View File

@ -938,6 +938,17 @@ create_statusbar ()
gtk_widget_destroy (window);
}
static void
handle_box_child_signal (GtkHandleBox *hb,
GtkWidget *child,
const gchar *action)
{
printf ("%s: child <%s> %sed\n",
gtk_type_name (GTK_OBJECT_TYPE (hb)),
gtk_type_name (GTK_OBJECT_TYPE (child)),
action);
}
static void
create_handle_box ()
{
@ -960,6 +971,14 @@ create_handle_box ()
hbox = gtk_handle_box_new ();
gtk_container_add (GTK_CONTAINER (window), hbox);
gtk_signal_connect (GTK_OBJECT (hbox),
"child_attached",
GTK_SIGNAL_FUNC (handle_box_child_signal),
"attached");
gtk_signal_connect (GTK_OBJECT (hbox),
"child_detached",
GTK_SIGNAL_FUNC (handle_box_child_signal),
"detached");
gtk_widget_show (hbox);
toolbar = make_toolbar (window);
@ -1056,7 +1075,7 @@ create_reparent ()
gtk_box_pack_start (GTK_BOX (box3), label, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (label),
"set_parent",
"parent_set",
GTK_SIGNAL_FUNC (set_parent_signal),
(GtkObject*) 42);
gtk_widget_show (label);

View File

@ -938,6 +938,17 @@ create_statusbar ()
gtk_widget_destroy (window);
}
static void
handle_box_child_signal (GtkHandleBox *hb,
GtkWidget *child,
const gchar *action)
{
printf ("%s: child <%s> %sed\n",
gtk_type_name (GTK_OBJECT_TYPE (hb)),
gtk_type_name (GTK_OBJECT_TYPE (child)),
action);
}
static void
create_handle_box ()
{
@ -960,6 +971,14 @@ create_handle_box ()
hbox = gtk_handle_box_new ();
gtk_container_add (GTK_CONTAINER (window), hbox);
gtk_signal_connect (GTK_OBJECT (hbox),
"child_attached",
GTK_SIGNAL_FUNC (handle_box_child_signal),
"attached");
gtk_signal_connect (GTK_OBJECT (hbox),
"child_detached",
GTK_SIGNAL_FUNC (handle_box_child_signal),
"detached");
gtk_widget_show (hbox);
toolbar = make_toolbar (window);
@ -1056,7 +1075,7 @@ create_reparent ()
gtk_box_pack_start (GTK_BOX (box3), label, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (label),
"set_parent",
"parent_set",
GTK_SIGNAL_FUNC (set_parent_signal),
(GtkObject*) 42);
gtk_widget_show (label);