Add gtk_scale_new{,_with_range}() for compatibility

This commit is contained in:
Pierre Pronchery 2018-01-16 05:45:23 +01:00
parent 4001fc6de3
commit e65358ed3d
2 changed files with 36 additions and 0 deletions

View File

@ -117,6 +117,12 @@ GtkWidget * gtk_button_box_new(GtkOrientation orientation);
GtkWidget * gtk_paned_new(GtkOrientation orientation);
GtkWidget * gtk_scale_new(GtkOrientation orientation,
GtkAdjustment * adjustment);
GtkWidget * gtk_scale_new_with_range(GtkOrientation orientation,
gdouble min, gdouble max, gdouble step);
GtkWidget * gtk_separator_new(GtkOrientation orientation);
void gtk_widget_override_font(GtkWidget * widget,

View File

@ -93,6 +93,36 @@ GtkWidget * gtk_paned_new(GtkOrientation orientation)
}
/* gtk_scale_new */
GtkWidget * gtk_scale_new(GtkOrientation orientation,
GtkAdjustment * adjustment)
{
switch(orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
return gtk_hscale_new(adjustment);
case GTK_ORIENTATION_VERTICAL:
default:
return gtk_vscale_new(adjustment);
}
}
/* gtk_scale_new_with_range */
GtkWidget * gtk_scale_new_with_range(GtkOrientation orientation,
gdouble min, gdouble max, gdouble step)
{
switch(orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
return gtk_hscale_new_with_range(min, max, step);
case GTK_ORIENTATION_VERTICAL:
default:
return gtk_vscale_new_with_range(min, max, step);
}
}
/* gtk_separator_new */
GtkWidget * gtk_separator_new(GtkOrientation orientation)
{