Commit f9739e83 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

( From: James Henstridge <james@daa.com.au> )

Wed Mar 18 11:09:10 1998  Owen Taylor  <owt1@cornell.edu>
	( From: James Henstridge <james@daa.com.au> )

	* gtk/gtkclist.c: Don't remove, then destroy labels in
	  gtk_clist_set_column_[*], just remove them.

	* gtk/gtkmain.c (gtk_invoke_timeout_function): call
	  marshal when appropriate, not function.

Tue Mar 17 14:15:07 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/testgtk.c (create_main_window): Alphabetize tests

	* gtk/gtk[hv]paned.c: Change division on resize if
	  necessary to keep handle visible.

	* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
	  _init() functions.

	* gtk/gtkscrolledwindow.c: Added missing _construct()
	  functions.
parent 85d4cd0f
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Wed Mar 18 11:09:10 1998 Owen Taylor <owt1@cornell.edu>
( From: James Henstridge <james@daa.com.au> )
* gtk/gtkclist.c: Don't remove, then destroy labels in
gtk_clist_set_column_[*], just remove them.
* gtk/gtkmain.c (gtk_invoke_timeout_function): call
marshal when appropriate, not function.
Tue Mar 17 14:15:07 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (create_main_window): Alphabetize tests
* gtk/gtk[hv]paned.c: Change division on resize if
necessary to keep handle visible.
* gtk/gtkgamma.c gtk/gtkcurve.c: Moved initialization into
_init() functions.
* gtk/gtkscrolledwindow.c: Added missing _construct()
functions.
Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org> Wed Mar 18 17:38:25 CET 1998 Paolo Molaro <lupus@debian.org>
...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org> ...@@ -12,11 +33,6 @@ Wed Mar 18 02:06:52 1998 Tim Janik <timj@gtk.org>
setting certain arguments, so they actually take affect. setting certain arguments, so they actually take affect.
(gtk_window_set_policy): likewise. (gtk_window_set_policy): likewise.
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org> Tue Mar 17 22:45:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values * gtk/gtkwidget.c (gtk_widget_get_arg): return real boolean values
......
Tue Mar 17 15:51:30 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h: gboolean type changed to int
* garray.c: complete redo by Josh MacDonald
Sun Mar 15 07:13:34 1998 Tim Janik <timj@gimp.org> Sun Mar 15 07:13:34 1998 Tim Janik <timj@gimp.org>
* gutils.c: changed *_handler variables to be named glib_*_handler, * gutils.c: changed *_handler variables to be named glib_*_handler,
......
...@@ -679,10 +679,7 @@ gtk_clist_set_column_title (GtkCList * clist, ...@@ -679,10 +679,7 @@ gtk_clist_set_column_title (GtkCList * clist,
/* remove and destroy the old widget */ /* remove and destroy the old widget */
old_widget = GTK_BUTTON (clist->column[column].button)->child; old_widget = GTK_BUTTON (clist->column[column].button)->child;
if (old_widget) if (old_widget)
{ gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget);
gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget);
gtk_widget_destroy (old_widget);
}
/* create new alignment based no column justification */ /* create new alignment based no column justification */
switch (clist->column[column].justification) switch (clist->column[column].justification)
...@@ -742,10 +739,7 @@ gtk_clist_set_column_widget (GtkCList * clist, ...@@ -742,10 +739,7 @@ gtk_clist_set_column_widget (GtkCList * clist,
/* remove and destroy the old widget */ /* remove and destroy the old widget */
old_widget = GTK_BUTTON (clist->column[column].button)->child; old_widget = GTK_BUTTON (clist->column[column].button)->child;
if (old_widget) if (old_widget)
{ gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget);
gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget);
gtk_widget_destroy (old_widget);
}
/* add and show the widget */ /* add and show the widget */
if (widget) if (widget)
......
...@@ -43,10 +43,13 @@ static guint curve_type_changed_signal = 0; ...@@ -43,10 +43,13 @@ static guint curve_type_changed_signal = 0;
/* forward declarations: */ /* forward declarations: */
static void gtk_curve_class_init (GtkCurveClass *class); static void gtk_curve_class_init (GtkCurveClass *class);
static void gtk_curve_init (GtkCurve *curve); static void gtk_curve_init (GtkCurve *curve);
static void gtk_curve_finalize (GtkObject *object); static void gtk_curve_finalize (GtkObject *object);
static gint gtk_curve_graph_events (GtkWidget *widget,
GdkEvent *event,
GtkCurve *c);
static void gtk_curve_size_graph (GtkCurve *curve);
guint guint
gtk_curve_get_type (void) gtk_curve_get_type (void)
...@@ -92,6 +95,8 @@ gtk_curve_class_init (GtkCurveClass *class) ...@@ -92,6 +95,8 @@ gtk_curve_class_init (GtkCurveClass *class)
static void static void
gtk_curve_init (GtkCurve *curve) gtk_curve_init (GtkCurve *curve)
{ {
gint old_mask;
curve->cursor_type = GDK_TOP_LEFT_ARROW; curve->cursor_type = GDK_TOP_LEFT_ARROW;
curve->pixmap = NULL; curve->pixmap = NULL;
curve->curve_type = GTK_CURVE_TYPE_SPLINE; curve->curve_type = GTK_CURVE_TYPE_SPLINE;
...@@ -103,6 +108,17 @@ gtk_curve_init (GtkCurve *curve) ...@@ -103,6 +108,17 @@ gtk_curve_init (GtkCurve *curve)
curve->num_ctlpoints = 0; curve->num_ctlpoints = 0;
curve->ctlpoint = NULL; curve->ctlpoint = NULL;
curve->min_x = 0.0;
curve->max_x = 1.0;
curve->min_y = 0.0;
curve->max_y = 1.0;
old_mask = gtk_widget_get_events (GTK_WIDGET (curve));
gtk_widget_set_events (GTK_WIDGET (curve), old_mask | GRAPH_MASK);
gtk_signal_connect (GTK_OBJECT (curve), "event",
(GtkSignalFunc) gtk_curve_graph_events, curve);
gtk_curve_size_graph (curve);
} }
static int static int
...@@ -823,22 +839,7 @@ gtk_curve_get_vector (GtkCurve *c, int veclen, gfloat vector[]) ...@@ -823,22 +839,7 @@ gtk_curve_get_vector (GtkCurve *c, int veclen, gfloat vector[])
GtkWidget* GtkWidget*
gtk_curve_new (void) gtk_curve_new (void)
{ {
GtkCurve *curve; return gtk_type_new (gtk_curve_get_type ());
gint old_mask;
curve = gtk_type_new (gtk_curve_get_type ());
curve->min_x = 0.0;
curve->max_x = 1.0;
curve->min_y = 0.0;
curve->max_y = 1.0;
old_mask = gtk_widget_get_events (GTK_WIDGET (curve));
gtk_widget_set_events (GTK_WIDGET (curve), old_mask | GRAPH_MASK);
gtk_signal_connect (GTK_OBJECT (curve), "event",
(GtkSignalFunc) gtk_curve_graph_events, curve);
gtk_curve_size_graph (curve);
return GTK_WIDGET (curve);
} }
static void static void
......
...@@ -42,6 +42,11 @@ static void gtk_gamma_curve_class_init (GtkGammaCurveClass *class); ...@@ -42,6 +42,11 @@ static void gtk_gamma_curve_class_init (GtkGammaCurveClass *class);
static void gtk_gamma_curve_init (GtkGammaCurve *curve); static void gtk_gamma_curve_init (GtkGammaCurve *curve);
static void gtk_gamma_curve_destroy (GtkObject *object); static void gtk_gamma_curve_destroy (GtkObject *object);
static void curve_type_changed_callback (GtkWidget *w, gpointer data);
static void button_realize_callback (GtkWidget *w);
static void button_toggled_callback (GtkWidget *w, gpointer data);
static void button_clicked_callback (GtkWidget *w, gpointer data);
enum enum
{ {
LINEAR = 0, LINEAR = 0,
...@@ -234,7 +239,54 @@ gtk_gamma_curve_class_init (GtkGammaCurveClass *class) ...@@ -234,7 +239,54 @@ gtk_gamma_curve_class_init (GtkGammaCurveClass *class)
static void static void
gtk_gamma_curve_init (GtkGammaCurve *curve) gtk_gamma_curve_init (GtkGammaCurve *curve)
{ {
GtkWidget *vbox;
int i;
curve->gamma = 1.0; curve->gamma = 1.0;
curve->table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (curve->table), 3);
gtk_container_add (GTK_CONTAINER (curve), curve->table);
curve->curve = gtk_curve_new ();
gtk_signal_connect (GTK_OBJECT (curve->curve), "curve_type_changed",
(GtkSignalFunc) curve_type_changed_callback, curve);
gtk_table_attach_defaults (GTK_TABLE (curve->table), curve->curve, 0, 1, 0, 1);
vbox = gtk_vbox_new (/* homogeneous */ FALSE, /* spacing */ 3);
gtk_table_attach (GTK_TABLE (curve->table), vbox, 1, 2, 0, 1, 0, 0, 0, 0);
/* toggle buttons: */
for (i = 0; i < 3; ++i)
{
curve->button[i] = gtk_toggle_button_new ();
gtk_object_set_data (GTK_OBJECT (curve->button[i]), "_GtkGammaCurveIndex",
(gpointer) (long) i);
gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "realize",
(GtkSignalFunc) button_realize_callback, 0);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "toggled",
(GtkSignalFunc) button_toggled_callback, curve);
gtk_widget_show (curve->button[i]);
}
/* push buttons: */
for (i = 3; i < 5; ++i)
{
curve->button[i] = gtk_button_new ();
gtk_object_set_data (GTK_OBJECT (curve->button[i]), "_GtkGammaCurveIndex",
(gpointer) (long) i);
gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "realize",
(GtkSignalFunc) button_realize_callback, 0);
gtk_signal_connect (GTK_OBJECT (curve->button[i]), "clicked",
(GtkSignalFunc) button_clicked_callback, curve);
gtk_widget_show (curve->button[i]);
}
gtk_widget_show (vbox);
gtk_widget_show (curve->table);
gtk_widget_show (curve->curve);
} }
static void static void
...@@ -395,57 +447,7 @@ curve_type_changed_callback (GtkWidget *w, gpointer data) ...@@ -395,57 +447,7 @@ curve_type_changed_callback (GtkWidget *w, gpointer data)
GtkWidget* GtkWidget*
gtk_gamma_curve_new (void) gtk_gamma_curve_new (void)
{ {
GtkGammaCurve *c; return gtk_type_new (gtk_gamma_curve_get_type ());
GtkWidget *vbox;
int i;
c = gtk_type_new (gtk_gamma_curve_get_type ());
c->table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (c->table), 3);
gtk_container_add (GTK_CONTAINER (c), c->table);
c->curve = gtk_curve_new ();
gtk_signal_connect (GTK_OBJECT (c->curve), "curve_type_changed",
(GtkSignalFunc) curve_type_changed_callback, c);
gtk_table_attach_defaults (GTK_TABLE (c->table), c->curve, 0, 1, 0, 1);
vbox = gtk_vbox_new (/* homogeneous */ FALSE, /* spacing */ 3);
gtk_table_attach (GTK_TABLE (c->table), vbox, 1, 2, 0, 1, 0, 0, 0, 0);
/* toggle buttons: */
for (i = 0; i < 3; ++i)
{
c->button[i] = gtk_toggle_button_new ();
gtk_object_set_data (GTK_OBJECT (c->button[i]), "_GtkGammaCurveIndex",
(gpointer) (long) i);
gtk_container_add (GTK_CONTAINER (vbox), c->button[i]);
gtk_signal_connect (GTK_OBJECT (c->button[i]), "realize",
(GtkSignalFunc) button_realize_callback, 0);
gtk_signal_connect (GTK_OBJECT (c->button[i]), "toggled",
(GtkSignalFunc) button_toggled_callback, c);
gtk_widget_show (c->button[i]);
}
/* push buttons: */
for (i = 3; i < 5; ++i)
{
c->button[i] = gtk_button_new ();
gtk_object_set_data (GTK_OBJECT (c->button[i]), "_GtkGammaCurveIndex",
(gpointer) (long) i);
gtk_container_add (GTK_CONTAINER (vbox), c->button[i]);
gtk_signal_connect (GTK_OBJECT (c->button[i]), "realize",
(GtkSignalFunc) button_realize_callback, 0);
gtk_signal_connect (GTK_OBJECT (c->button[i]), "clicked",
(GtkSignalFunc) button_clicked_callback, c);
gtk_widget_show (c->button[i]);
}
gtk_widget_show (vbox);
gtk_widget_show (c->table);
gtk_widget_show (c->curve);
return GTK_WIDGET (c);
} }
static void static void
......
...@@ -149,6 +149,10 @@ gtk_hpaned_size_allocate (GtkWidget *widget, ...@@ -149,6 +149,10 @@ gtk_hpaned_size_allocate (GtkWidget *widget,
else else
paned->child1_size = 0; paned->child1_size = 0;
} }
else
paned->child1_size = CLAMP (paned->child1_size, 0,
allocation->width - paned->gutter_size
- 2 * GTK_CONTAINER (paned)->border_width);
/* Move the handle before the children so we don't get extra expose events */ /* Move the handle before the children so we don't get extra expose events */
......
...@@ -84,17 +84,29 @@ gtk_radio_button_init (GtkRadioButton *radio_button) ...@@ -84,17 +84,29 @@ gtk_radio_button_init (GtkRadioButton *radio_button)
radio_button->group = NULL; radio_button->group = NULL;
} }
GtkWidget* void
gtk_radio_button_new (GSList *group) gtk_radio_button_set_group (GtkRadioButton *radio_button,
GSList *group)
{ {
GtkRadioButton *radio_button;
GtkRadioButton *tmp_button;
GSList *tmp_list; GSList *tmp_list;
GtkRadioButton *tmp_button;
radio_button = gtk_type_new (gtk_radio_button_get_type ()); if (radio_button->group)
{
radio_button->group = g_slist_remove (radio_button->group, radio_button);
tmp_list = radio_button->group;
while (tmp_list)
{
tmp_button = tmp_list->data;
tmp_list = tmp_list->next;
tmp_button->group = radio_button->group;
}
}
tmp_list = group;
radio_button->group = g_slist_prepend (group, radio_button); radio_button->group = g_slist_prepend (group, radio_button);
tmp_list = group;
if (tmp_list) if (tmp_list)
{ {
...@@ -111,6 +123,16 @@ gtk_radio_button_new (GSList *group) ...@@ -111,6 +123,16 @@ gtk_radio_button_new (GSList *group)
GTK_TOGGLE_BUTTON (radio_button)->active = TRUE; GTK_TOGGLE_BUTTON (radio_button)->active = TRUE;
gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE); gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE);
} }
}
GtkWidget*
gtk_radio_button_new (GSList *group)
{
GtkRadioButton *radio_button;
radio_button = gtk_type_new (gtk_radio_button_get_type ());
gtk_radio_button_set_group (radio_button, group);
return GTK_WIDGET (radio_button); return GTK_WIDGET (radio_button);
} }
......
...@@ -55,6 +55,8 @@ GtkWidget* gtk_radio_button_new_from_widget (GtkRadioButton *group); ...@@ -55,6 +55,8 @@ GtkWidget* gtk_radio_button_new_from_widget (GtkRadioButton *group);
GtkWidget* gtk_radio_button_new_with_label (GSList *group, GtkWidget* gtk_radio_button_new_with_label (GSList *group,
const gchar *label); const gchar *label);
GSList* gtk_radio_button_group (GtkRadioButton *radio_button); GSList* gtk_radio_button_group (GtkRadioButton *radio_button);
void gtk_radio_button_set_group (GtkRadioButton *radio_button,
GSList *group);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -122,6 +122,18 @@ gtk_scrolled_window_new (GtkAdjustment *hadjustment, ...@@ -122,6 +122,18 @@ gtk_scrolled_window_new (GtkAdjustment *hadjustment,
scrolled_window = gtk_type_new (gtk_scrolled_window_get_type ()); scrolled_window = gtk_type_new (gtk_scrolled_window_get_type ());
gtk_scrolled_window_construct (scrolled_window, hadjustment, vadjustment);
return GTK_WIDGET (scrolled_window);
}
void
gtk_scrolled_window_construct (GtkScrolledWindow *scrolled_window,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
scrolled_window = gtk_type_new (gtk_scrolled_window_get_type ());
scrolled_window->viewport = gtk_viewport_new (hadjustment, vadjustment); scrolled_window->viewport = gtk_viewport_new (hadjustment, vadjustment);
hadjustment = gtk_viewport_get_hadjustment (GTK_VIEWPORT (scrolled_window->viewport)); hadjustment = gtk_viewport_get_hadjustment (GTK_VIEWPORT (scrolled_window->viewport));
vadjustment = gtk_viewport_get_vadjustment (GTK_VIEWPORT (scrolled_window->viewport)); vadjustment = gtk_viewport_get_vadjustment (GTK_VIEWPORT (scrolled_window->viewport));
...@@ -147,8 +159,6 @@ gtk_scrolled_window_new (GtkAdjustment *hadjustment, ...@@ -147,8 +159,6 @@ gtk_scrolled_window_new (GtkAdjustment *hadjustment,
gtk_widget_ref (scrolled_window->viewport); gtk_widget_ref (scrolled_window->viewport);
gtk_widget_ref (scrolled_window->hscrollbar); gtk_widget_ref (scrolled_window->hscrollbar);
gtk_widget_ref (scrolled_window->vscrollbar); gtk_widget_ref (scrolled_window->vscrollbar);
return GTK_WIDGET (scrolled_window);
} }
GtkAdjustment* GtkAdjustment*
......
...@@ -61,6 +61,9 @@ struct _GtkScrolledWindowClass ...@@ -61,6 +61,9 @@ struct _GtkScrolledWindowClass
guint gtk_scrolled_window_get_type (void); guint gtk_scrolled_window_get_type (void);
GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment, GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment); GtkAdjustment *vadjustment);
void gtk_scrolled_window_construct (GtkScrolledWindow *scrolled_window,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *scrolled_window); GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *scrolled_window);
GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *scrolled_window); GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *scrolled_window);
void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window, void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window,
......
...@@ -1734,12 +1734,16 @@ gtk_text_key_press (GtkWidget *widget, ...@@ -1734,12 +1734,16 @@ gtk_text_key_press (GtkWidget *widget,
break; break;
case GDK_Tab: case GDK_Tab:
gtk_text_insert_1_at_point (text, '\t'); gtk_text_insert_1_at_point (text, '\t');
gtk_editable_changed (editable);
break; break;
case GDK_Return: case GDK_Return:
if (event->state & GDK_CONTROL_MASK) if (event->state & GDK_CONTROL_MASK)
gtk_signal_emit_by_name (GTK_OBJECT (text), "activate"); gtk_signal_emit_by_name (GTK_OBJECT (text), "activate");
else else
gtk_text_insert_1_at_point (text, '\n'); {
gtk_text_insert_1_at_point (text, '\n');
gtk_editable_changed (editable);
}
break; break;
case GDK_Escape: case GDK_Escape:
/* Don't insert literally */ /* Don't insert literally */
......
...@@ -149,6 +149,10 @@ gtk_vpaned_size_allocate (GtkWidget *widget, ...@@ -149,6 +149,10 @@ gtk_vpaned_size_allocate (GtkWidget *widget,
else else
paned->child1_size = 0; paned->child1_size = 0;
}