( 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.
This commit is contained in:
Owen Taylor 1998-03-18 21:11:04 +00:00 committed by Owen Taylor
parent 85d4cd0f43
commit f9739e8343
22 changed files with 368 additions and 181 deletions

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,24 @@
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>
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

View File

@ -1,3 +1,8 @@
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,

View File

@ -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,
/* 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)

View File

@ -46,7 +46,10 @@ static guint curve_type_changed_signal = 0;
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)
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)
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[])
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

View File

@ -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)
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)
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

View File

@ -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 */

View File

@ -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)
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);
} }

View File

@ -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

View File

@ -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,
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*

View File

@ -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,

View File

@ -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 */

View File

@ -149,6 +149,10 @@ gtk_vpaned_size_allocate (GtkWidget *widget,
else else
paned->child1_size = 0; paned->child1_size = 0;
} }
else
paned->child1_size = CLAMP (paned->child1_size, 0,
allocation->height - 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 */

View File

@ -1276,6 +1276,13 @@ cb_create_tree(GtkWidget* w)
nb_item = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.nb_item_spinner)); nb_item = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.nb_item_spinner));
recursion_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.recursion_spinner)); recursion_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.recursion_spinner));
if (pow (nb_item, recursion_level) > 10000)
{
g_print ("%g total items? That will take a very long time. Try less\n",
pow (nb_item, recursion_level));
return;
}
create_tree_sample(selection_mode, draw_line, view_line, no_root_item, nb_item, recursion_level); create_tree_sample(selection_mode, draw_line, view_line, no_root_item, nb_item, recursion_level);
} }
@ -4100,6 +4107,7 @@ create_panes ()
GtkWidget *frame; GtkWidget *frame;
GtkWidget *hpaned; GtkWidget *hpaned;
GtkWidget *vpaned; GtkWidget *vpaned;
GtkWidget *button;
if (!window) if (!window)
{ {
@ -4126,6 +4134,10 @@ create_panes ()
gtk_paned_add1 (GTK_PANED (hpaned), frame); gtk_paned_add1 (GTK_PANED (hpaned), frame);
gtk_widget_show (frame); gtk_widget_show (frame);
button = gtk_button_new_with_label ("Hi there");
gtk_container_add (GTK_CONTAINER(frame), button);
gtk_widget_show (button);
frame = gtk_frame_new (NULL); frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_usize (frame, 80, 60); gtk_widget_set_usize (frame, 80, 60);
@ -5486,46 +5498,46 @@ create_main_window ()
void (*func) (); void (*func) ();
} buttons[] = } buttons[] =
{ {
{ "buttons", create_buttons },
{ "toggle buttons", create_toggle_buttons },
{ "check buttons", create_check_buttons },
{ "radio buttons", create_radio_buttons },
{ "button box", create_button_box }, { "button box", create_button_box },
{ "toolbar", create_toolbar }, { "buttons", create_buttons },
{ "handle box", create_handle_box }, { "check buttons", create_check_buttons },
{ "statusbar", create_statusbar },
{ "reparent", create_reparent },
{ "pixmap", create_pixmap },
{ "tooltips", create_tooltips },
{ "menus", create_menus },
{ "scrolled windows", create_scrolled_windows },
{ "cursors", create_cursors },
{ "entry", create_entry },
{ "spinbutton", create_spins },
{ "list", create_list },
{ "clist", create_clist}, { "clist", create_clist},
{ "tree", create_tree_mode_window},
{ "color selection", create_color_selection }, { "color selection", create_color_selection },
{ "file selection", create_file_selection }, { "cursors", create_cursors },
{ "dialog", create_dialog }, { "dialog", create_dialog },
{ "dnd", create_dnd },
{ "entry", create_entry },
{ "file selection", create_file_selection },
{ "gamma curve", create_gamma_curve },
{ "handle box", create_handle_box },
{ "list", create_list },
{ "menus", create_menus },
{ "miscellaneous", NULL }, { "miscellaneous", NULL },
{ "range controls", create_range_controls },
{ "rulers", create_rulers },
{ "text", create_text },
{ "notebook", create_notebook }, { "notebook", create_notebook },
{ "panes", create_panes }, { "panes", create_panes },
{ "shapes", create_shapes }, { "pixmap", create_pixmap },
{ "dnd", create_dnd },
{ "WM hints", create_wmhints },
{ "progress bar", create_progress_bar },
{ "preview color", create_color_preview }, { "preview color", create_color_preview },
{ "preview gray", create_gray_preview }, { "preview gray", create_gray_preview },
{ "gamma curve", create_gamma_curve }, { "progress bar", create_progress_bar },
{ "radio buttons", create_radio_buttons },
{ "range controls", create_range_controls },
{ "reparent", create_reparent },
{ "rulers", create_rulers },
{ "scrolled windows", create_scrolled_windows },
{ "shapes", create_shapes },
{ "spinbutton", create_spins },
{ "statusbar", create_statusbar },
{ "test idle", create_idle_test },
{ "test mainloop", create_test },
{ "test scrolling", create_scroll_test }, { "test scrolling", create_scroll_test },
{ "test selection", create_selection_test }, { "test selection", create_selection_test },
{ "test timeout", create_timeout_test }, { "test timeout", create_timeout_test },
{ "test idle", create_idle_test }, { "text", create_text },
{ "test", create_test }, { "toggle buttons", create_toggle_buttons },
{ "toolbar", create_toolbar },
{ "tooltips", create_tooltips },
{ "tree", create_tree_mode_window},
{ "WM hints", create_wmhints },
}; };
int nbuttons = sizeof (buttons) / sizeof (buttons[0]); int nbuttons = sizeof (buttons) / sizeof (buttons[0]);
GtkWidget *window; GtkWidget *window;

View File

@ -163,7 +163,7 @@ selection_handle (GtkWidget *widget,
} }
else else
{ {
buffer = selection_string->str; buffer = (guchar *)selection_string->str;
len = selection_string->len; len = selection_string->len;
} }

View File

@ -1276,6 +1276,13 @@ cb_create_tree(GtkWidget* w)
nb_item = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.nb_item_spinner)); nb_item = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.nb_item_spinner));
recursion_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.recursion_spinner)); recursion_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sTreeSampleSelection.recursion_spinner));
if (pow (nb_item, recursion_level) > 10000)
{
g_print ("%g total items? That will take a very long time. Try less\n",
pow (nb_item, recursion_level));
return;
}
create_tree_sample(selection_mode, draw_line, view_line, no_root_item, nb_item, recursion_level); create_tree_sample(selection_mode, draw_line, view_line, no_root_item, nb_item, recursion_level);
} }
@ -4100,6 +4107,7 @@ create_panes ()
GtkWidget *frame; GtkWidget *frame;
GtkWidget *hpaned; GtkWidget *hpaned;
GtkWidget *vpaned; GtkWidget *vpaned;
GtkWidget *button;
if (!window) if (!window)
{ {
@ -4126,6 +4134,10 @@ create_panes ()
gtk_paned_add1 (GTK_PANED (hpaned), frame); gtk_paned_add1 (GTK_PANED (hpaned), frame);
gtk_widget_show (frame); gtk_widget_show (frame);
button = gtk_button_new_with_label ("Hi there");
gtk_container_add (GTK_CONTAINER(frame), button);
gtk_widget_show (button);
frame = gtk_frame_new (NULL); frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_usize (frame, 80, 60); gtk_widget_set_usize (frame, 80, 60);
@ -5486,46 +5498,46 @@ create_main_window ()
void (*func) (); void (*func) ();
} buttons[] = } buttons[] =
{ {
{ "buttons", create_buttons },
{ "toggle buttons", create_toggle_buttons },
{ "check buttons", create_check_buttons },
{ "radio buttons", create_radio_buttons },
{ "button box", create_button_box }, { "button box", create_button_box },
{ "toolbar", create_toolbar }, { "buttons", create_buttons },
{ "handle box", create_handle_box }, { "check buttons", create_check_buttons },
{ "statusbar", create_statusbar },
{ "reparent", create_reparent },
{ "pixmap", create_pixmap },
{ "tooltips", create_tooltips },
{ "menus", create_menus },
{ "scrolled windows", create_scrolled_windows },
{ "cursors", create_cursors },
{ "entry", create_entry },
{ "spinbutton", create_spins },
{ "list", create_list },
{ "clist", create_clist}, { "clist", create_clist},
{ "tree", create_tree_mode_window},
{ "color selection", create_color_selection }, { "color selection", create_color_selection },
{ "file selection", create_file_selection }, { "cursors", create_cursors },
{ "dialog", create_dialog }, { "dialog", create_dialog },
{ "dnd", create_dnd },
{ "entry", create_entry },
{ "file selection", create_file_selection },
{ "gamma curve", create_gamma_curve },
{ "handle box", create_handle_box },
{ "list", create_list },
{ "menus", create_menus },
{ "miscellaneous", NULL }, { "miscellaneous", NULL },
{ "range controls", create_range_controls },
{ "rulers", create_rulers },
{ "text", create_text },
{ "notebook", create_notebook }, { "notebook", create_notebook },
{ "panes", create_panes }, { "panes", create_panes },
{ "shapes", create_shapes }, { "pixmap", create_pixmap },
{ "dnd", create_dnd },
{ "WM hints", create_wmhints },
{ "progress bar", create_progress_bar },
{ "preview color", create_color_preview }, { "preview color", create_color_preview },
{ "preview gray", create_gray_preview }, { "preview gray", create_gray_preview },
{ "gamma curve", create_gamma_curve }, { "progress bar", create_progress_bar },
{ "radio buttons", create_radio_buttons },
{ "range controls", create_range_controls },
{ "reparent", create_reparent },
{ "rulers", create_rulers },
{ "scrolled windows", create_scrolled_windows },
{ "shapes", create_shapes },
{ "spinbutton", create_spins },
{ "statusbar", create_statusbar },
{ "test idle", create_idle_test },
{ "test mainloop", create_test },
{ "test scrolling", create_scroll_test }, { "test scrolling", create_scroll_test },
{ "test selection", create_selection_test }, { "test selection", create_selection_test },
{ "test timeout", create_timeout_test }, { "test timeout", create_timeout_test },
{ "test idle", create_idle_test }, { "text", create_text },
{ "test", create_test }, { "toggle buttons", create_toggle_buttons },
{ "toolbar", create_toolbar },
{ "tooltips", create_tooltips },
{ "tree", create_tree_mode_window},
{ "WM hints", create_wmhints },
}; };
int nbuttons = sizeof (buttons) / sizeof (buttons[0]); int nbuttons = sizeof (buttons) / sizeof (buttons[0]);
GtkWidget *window; GtkWidget *window;

View File

@ -163,7 +163,7 @@ selection_handle (GtkWidget *widget,
} }
else else
{ {
buffer = selection_string->str; buffer = (guchar *)selection_string->str;
len = selection_string->len; len = selection_string->len;
} }