Commit 6baa568f authored by Bastien Nocera's avatar Bastien Nocera Committed by Bastien Nocera

reviewed by: Matthias Clasen <mclasen@redhat.com>

2007-05-19  Bastien Nocera  <hadess@hadess.net>

	reviewed by: Matthias Clasen <mclasen@redhat.com>

	* gtk/Makefile.am:
	* gtk/gtk.h:
	* gtk/gtk.symbols:
	* gtk/gtkscalebutton.[ch]: Add the GtkScaleButton widget,
	a button that pops up a scale when pressed

2007-05-19  Bastien Nocera  <hadess@hadess.net>

	* POTFILES.in: Add scale button to the list

2007-05-20  Bastien Nocera  <hadess@hadess.net>

	* gtk/gtk-docs.sgml:
	* gtk/gtk-sections.txt: add the GtkScaleButton widget
	to the docs


svn path=/trunk/; revision=17876
parent dc1ccf64
2007-05-19 Bastien Nocera <hadess@hadess.net>
reviewed by: Matthias Clasen <mclasen@redhat.com>
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkscalebutton.[ch]: Add the GtkScaleButton widget,
a button that pops up a scale when pressed
2007-05-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
......
2007-05-20 Bastien Nocera <hadess@hadess.net>
* gtk/gtk-docs.sgml:
* gtk/gtk-sections.txt: add the GtkScaleButton widget
to the docs
2007-05-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk-sections.txt: Add gtk_notebook_[gs]et_group
......
......@@ -108,6 +108,7 @@
<!ENTITY GtkRecentManager SYSTEM "xml/gtkrecentmanager.xml">
<!ENTITY GtkRuler SYSTEM "xml/gtkruler.xml">
<!ENTITY GtkScale SYSTEM "xml/gtkscale.xml">
<!ENTITY GtkScaleButton SYSTEM "xml/gtkscalebutton.xml">
<!ENTITY GtkScrollbar SYSTEM "xml/gtkscrollbar.xml">
<!ENTITY GtkScrolledWindow SYSTEM "xml/gtkscrolledwindow.xml">
<!ENTITY GtkSeparator SYSTEM "xml/gtkseparator.xml">
......@@ -391,6 +392,7 @@ that is, GUI components such as <link linkend="GtkButton">GtkButton</link> or
&GtkButton;
&GtkCheckButton;
&GtkRadioButton;
&GtkScaleButton;
&GtkToggleButton;
&GtkLinkButton;
</chapter>
......
......@@ -3021,9 +3021,11 @@ gtk_scale_get_type
<TITLE>GtkScaleButton</TITLE>
GtkScaleButton
gtk_scale_button_new
gtk_scale_button_set_adjustment
gtk_scale_button_set_icons
gtk_scale_button_set_value
gtk_scale_button_get_adjustment
gtk_scale_button_get_value
gtk_scale_button_set_icons
<SUBSECTION Standard>
GTK_SCALE_BUTTON
GTK_SCALE_IS_BUTTON
......
......@@ -259,6 +259,7 @@ gtk_public_h_sources = \
gtkrecentmanager.h \
gtkruler.h \
gtkscale.h \
gtkscalebutton.h \
gtkscrollbar.h \
gtkscrolledwindow.h \
gtkselection.h \
......@@ -533,6 +534,7 @@ gtk_base_c_sources = \
gtkrecentmanager.c \
gtkruler.c \
gtkscale.c \
gtkscalebutton.c \
gtkscrollbar.c \
gtkscrolledwindow.c \
gtkselection.c \
......
......@@ -150,6 +150,7 @@
#include <gtk/gtkrecentmanager.h>
#include <gtk/gtkruler.h>
#include <gtk/gtkscale.h>
#include <gtk/gtkscalebutton.h>
#include <gtk/gtkscrollbar.h>
#include <gtk/gtkscrolledwindow.h>
#include <gtk/gtkselection.h>
......
......@@ -3234,6 +3234,18 @@ gtk_scale_set_value_pos
#endif
#endif
#if IN_HEADER(__GTK_SCALE_BUTTON_H__)
#if IN_FILE(__GTK_SCALE_BUTTON_C__)
gtk_scale_button_get_type G_GNUC_CONST
gtk_scale_button_get_value
gtk_scale_button_new
gtk_scale_button_set_icons
gtk_scale_button_set_value
gtk_scale_button_get_adjustment
gtk_scale_button_set_adjustment
#endif
#endif
#if IN_HEADER(__GTK_SCROLLBAR_H__)
#if IN_FILE(__GTK_SCROLLBAR_C__)
gtk_scrollbar_get_type G_GNUC_CONST
......
/* GTK - The GIMP Toolkit
* Copyright (C) 2005 Ronald S. Bultje
* Copyright (C) 2006, 2007 Christian Persch
* Copyright (C) 2006 Jan Arne Petersen
* Copyright (C) 2005-2007 Red Hat, Inc.
*
* Authors:
* - Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* - Bastien Nocera <bnocera@redhat.com>
* - Jan Arne Petersen <jpetersen@jpetersen.org>
* - Christian Persch <chpe@svn.gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 2007. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <config.h>
#define _GNU_SOURCE
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkrange.h"
#include "gtkbindings.h"
#include "gtkscale.h"
#include "gtkvscale.h"
#include "gtkframe.h"
#include "gtkvbox.h"
#include "gtkwindow.h"
#include "gtkmarshalers.h"
#include "gtkstock.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdkkeysyms.h>
#include "gtkscalebutton.h"
#define SCALE_SIZE 100
#define CLICK_TIMEOUT 250
enum {
VALUE_CHANGED,
POPUP,
POPDOWN,
LAST_SIGNAL
};
enum {
PROP_0,
PROP_VALUE,
PROP_SIZE,
PROP_ADJUSTMENT
};
struct _GtkScaleButtonPrivate {
GtkWidget *dock, *scale, *image;
GtkIconSize size;
guint click_id;
gdouble direction;
guint32 pop_time;
gchar **icon_list;
gint click_timeout;
guint timeout : 1;
} _GtkScaleButtonPrivate;
static void gtk_scale_button_class_init (GtkScaleButtonClass *klass);
static void gtk_scale_button_init (GtkScaleButton *button);
static void gtk_scale_button_dispose (GObject *object);
static void gtk_scale_button_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_scale_button_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static gboolean gtk_scale_button_scroll (GtkWidget *widget,
GdkEventScroll *event);
static void gtk_scale_button_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen);
static gboolean gtk_scale_button_press (GtkWidget *widget,
GdkEventButton *event);
static gboolean gtk_scale_button_key_release (GtkWidget *widget,
GdkEventKey *event);
static void gtk_scale_button_popup_from_bindings (GtkWidget *widget);
static void gtk_scale_button_popdown_from_bindings (GtkWidget *widget);
static gboolean cb_dock_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
static gboolean cb_dock_key_release (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data);
static gboolean cb_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
static gboolean cb_button_release (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
static void cb_dock_grab_notify (GtkWidget *widget,
gboolean was_grabbed,
gpointer user_data);
static gboolean cb_dock_grab_broken_event (GtkWidget *widget,
gboolean was_grabbed,
gpointer user_data);
static void cb_scale_grab_notify (GtkWidget *widget,
gboolean was_grabbed,
gpointer user_data);
static void gtk_scale_button_update_icon (GtkScaleButton *button);
static void gtk_scale_button_scale_value_changed(GtkRange *range);
/* see below for scale definitions */
static GtkWidget *gtk_scale_button_scale_new (GtkScaleButton *button,
gdouble min,
gdouble max,
gdouble step);
static GtkButtonClass *parent_class = NULL;
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON)
static void
gtk_scale_button_class_init (GtkScaleButtonClass *klass)
{
GtkBindingSet *binding_set;
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
gobject_class->dispose = gtk_scale_button_dispose;
gobject_class->set_property = gtk_scale_button_set_property;
gobject_class->get_property = gtk_scale_button_get_property;
widget_class->button_press_event = gtk_scale_button_press;
widget_class->key_release_event = gtk_scale_button_key_release;
widget_class->scroll_event = gtk_scale_button_scroll;
widget_class->screen_changed = gtk_scale_button_screen_changed;
g_object_class_install_property (gobject_class,
PROP_VALUE,
g_param_spec_double ("value",
P_("Value"),
P_("The value of the scale"),
-G_MAXDOUBLE,
G_MAXDOUBLE,
0,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SIZE,
g_param_spec_enum ("size",
P_("Icon size"),
P_("The icon size"),
GTK_TYPE_ICON_SIZE,
GTK_ICON_SIZE_SMALL_TOOLBAR,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ADJUSTMENT,
g_param_spec_object ("adjustment",
P_("Adjustment"),
P_("The GtkAdjustment that contains the current value of this scale button object"),
GTK_TYPE_ADJUSTMENT,
G_PARAM_READWRITE));
/**
* GtkScaleButton::value-changed:
* @button: the object that received the signal
*
* Emitted when the value field has changed.
*
* Since: 2.12
*
*/
signals[VALUE_CHANGED] =
g_signal_new (I_("value-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkScaleButtonClass, value_changed),
NULL, NULL,
_gtk_marshal_VOID__DOUBLE,
G_TYPE_NONE, 1, G_TYPE_DOUBLE);
signals[POPUP] =
_gtk_binding_signal_new (I_("popup"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_scale_button_popup_from_bindings),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[POPDOWN] =
_gtk_binding_signal_new (I_("popdown"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_scale_button_popdown_from_bindings),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/* Key bindings */
binding_set = gtk_binding_set_by_class (widget_class);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"popup", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
"popup", 0);
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
"popup", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0,
"popup", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"popdown", 0);
}
static void
gtk_scale_button_init (GtkScaleButton *button)
{
GtkWidget *frame, *box;
GtkScaleButtonPrivate *priv;
button->priv = g_new0 (GtkScaleButtonPrivate, 1);
priv = button->priv;
priv->timeout = FALSE;
priv->click_id = 0;
priv->click_timeout = CLICK_TIMEOUT;
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
/* image */
priv->image = gtk_image_new ();
gtk_container_add (GTK_CONTAINER (button), priv->image);
gtk_widget_show_all (priv->image);
/* window */
priv->dock = gtk_window_new (GTK_WINDOW_POPUP);
g_signal_connect (priv->dock, "button-press-event",
G_CALLBACK (cb_dock_button_press), button);
g_signal_connect (priv->dock, "key-release-event",
G_CALLBACK (cb_dock_key_release), button);
g_signal_connect (priv->dock, "grab-notify",
G_CALLBACK (cb_dock_grab_notify), button);
g_signal_connect (priv->dock, "grab-broken-event",
G_CALLBACK (cb_dock_grab_broken_event), button);
gtk_window_set_decorated (GTK_WINDOW (priv->dock), FALSE);
/* frame */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (priv->dock), frame);
box = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), box);
/* + */
button->plus_button = gtk_button_new_with_label ("+");
gtk_button_set_relief (GTK_BUTTON (button->plus_button), GTK_RELIEF_NONE);
g_signal_connect (button->plus_button, "button-press-event",
G_CALLBACK (cb_button_press), button);
g_signal_connect (button->plus_button, "button-release-event",
G_CALLBACK (cb_button_release), button);
gtk_box_pack_start (GTK_BOX (box), button->plus_button, TRUE, FALSE, 0);
/* scale */
priv->scale = gtk_scale_button_scale_new (button, 0., 100., 2.);
gtk_widget_set_size_request (priv->scale, -1, SCALE_SIZE);
gtk_scale_set_draw_value (GTK_SCALE (priv->scale), FALSE);
gtk_range_set_inverted (GTK_RANGE (priv->scale), TRUE);
gtk_box_pack_start (GTK_BOX (box), priv->scale, TRUE, FALSE, 0);
g_signal_connect (priv->scale, "grab-notify",
G_CALLBACK (cb_scale_grab_notify), button);
/* - */
button->minus_button = gtk_button_new_with_label ("-");
gtk_button_set_relief (GTK_BUTTON (button->minus_button), GTK_RELIEF_NONE);
g_signal_connect (button->minus_button, "button-press-event",
G_CALLBACK (cb_button_press), button);
g_signal_connect (button->minus_button, "button-release-event",
G_CALLBACK (cb_button_release), button);
gtk_box_pack_start (GTK_BOX (box), button->minus_button, TRUE, FALSE, 0);
/* set button text and size */
priv->size = GTK_ICON_SIZE_SMALL_TOOLBAR;
gtk_scale_button_update_icon (button);
}
static void
gtk_scale_button_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkScaleButton *button;
button = GTK_SCALE_BUTTON (object);
switch (prop_id)
{
case PROP_VALUE:
gtk_scale_button_set_value (button, g_value_get_double (value));
break;
case PROP_SIZE:
{
GtkIconSize size;
size = g_value_get_enum (value);
if (button->priv->size != size)
{
button->priv->size = size;
gtk_scale_button_update_icon (button);
}
}
break;
case PROP_ADJUSTMENT:
gtk_scale_button_set_adjustment (button, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_scale_button_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkScaleButton *button;
GtkScaleButtonPrivate *priv;
button = GTK_SCALE_BUTTON (object);
priv = button->priv;
switch (prop_id)
{
case PROP_VALUE:
g_value_set_float (value, gtk_scale_button_get_value (button));
break;
case PROP_SIZE:
g_value_set_enum (value, priv->size);
break;
case PROP_ADJUSTMENT:
g_value_set_object (value, gtk_scale_button_get_adjustment (button));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_scale_button_dispose (GObject *object)
{
GtkScaleButton *button;
GtkScaleButtonPrivate *priv;
button = GTK_SCALE_BUTTON (object);
priv = button->priv;
if (priv && priv->dock)
{
gtk_widget_destroy (priv->dock);
priv->dock = NULL;
}
if (priv && priv->click_id != 0)
{
g_source_remove (priv->click_id);
priv->click_id = 0;
}
if (priv && priv->icon_list)
{
g_strfreev (priv->icon_list);
priv->icon_list = NULL;
}
g_free (priv);
button->priv = NULL;
G_OBJECT_CLASS (parent_class)->dispose (object);
}
/**
* gtk_scale_button_new
* @size: a stock icon size
* @lower: the minimum value of the scale (usually 0)
* @upper: the maximum value of the scale (usually 100)
* @step_increment: the stepping of value when a scroll-wheel event,
* or up/down arrow event occurs (usually 2)
* @icons: a %NULL-terminated array of icon names, or %NULL if
* you want to set the list later with gtk_scale_button_set_icons(). See
* gtk_scale_button_set_icons() for details.
*
* Creates a #GtkScaleButton, with a range between lower and upper, with
* a stepping of step_increment.
*
* Return value: a new #GtkScaleButton
*
* Since: 2.12
*/
GtkWidget *
gtk_scale_button_new (GtkIconSize size,
gdouble lower,
gdouble upper,
gdouble step_increment,
const gchar **icons)
{
GtkScaleButton *button;
GtkScaleButtonPrivate *priv;
button = g_object_new (GTK_TYPE_SCALE_BUTTON, NULL);
priv = button->priv;
if (icons != NULL)
gtk_scale_button_set_icons (button, icons);
gtk_range_set_range (GTK_RANGE (priv->scale), lower, upper);
gtk_range_set_increments (GTK_RANGE (priv->scale),
step_increment,
10 * step_increment);
if (priv->size != size)
{
priv->size = size;
gtk_scale_button_update_icon (button);
}
return GTK_WIDGET (button);
}
/**
* gtk_scale_button_get_value
* @button: a #GtkScaleButton
*
* Gets the current value of the scale button.
*
* Return value: current value of the scale button
*
* Since: 2.12
*/
gdouble
gtk_scale_button_get_value (GtkScaleButton * button)
{
GtkScaleButtonPrivate *priv;
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), 0);
priv = button->priv;
return gtk_range_get_value (GTK_RANGE (priv->scale));
}
/**
* gtk_scale_button_set_value
* @button: a #GtkScaleButton
* @value: new value of the scale button
*
* Sets the current value of the scale; if the value is outside the minimum or
* maximum range values, it will be clamped to fit inside them. The scale button
* emits the "value_changed" signal if the value changes.
*
* Since: 2.12
*/
void
gtk_scale_button_set_value (GtkScaleButton *button,
gdouble value)
{
GtkScaleButtonPrivate *priv;
g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
priv = button->priv;
gtk_range_set_value (GTK_RANGE (priv->scale), value);
}
/**
* gtk_scale_button_set_icons
* @button: a #GtkScaleButton
* @icons: a %NULL-terminated array of icon names
*
* Sets the icons to be used by the scale button. The first item in the array
* will be used in the button when the current value is the lowest value, the
* second item for the highest value. All the subsequent icons will be used for
* all the other values, spread evenly over the range of values.
*
* If there's only one icon in the @icons array, it will be used for all the
* values. If only two icons are in the @icons array, the first one will be
* used for the bottom 50% of the scale, and the second one for the top 50%.
* So it is recommended to use at least 3 icons so that the #GtkScaleButton
* reflects the current value of the scale better for the users.
*
* Since 2.12
*/
void
gtk_scale_button_set_icons (GtkScaleButton *button,
const gchar **icons)
{
GtkScaleButtonPrivate *priv;
g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
g_return_if_fail (icons != NULL);
g_return_if_fail (icons[0] != NULL);
priv = button->priv;
g_strfreev (priv->icon_list);
priv->icon_list = g_strdupv ((gchar **) icons);
gtk_scale_button_update_icon (button);
}
/**
* gtk_scale_button_get_adjustment
* @button: a #GtkScaleButton
*
* Gets the #GtkAdjustment associated with the #GtkScaleButton's scale.
* See gtk_range_get_adjustment() for details.
*
* Since: 2.12
*/
GtkAdjustment*
gtk_scale_button_get_adjustment (GtkScaleButton *button)
{
GtkRange *range;
g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), NULL);
range = GTK_RANGE (button->priv->scale);
g_return_val_if_fail (range != NULL, NULL);
return gtk_range_get_adjustment (range);
}
/**
* gtk_scale_button_set_adjustment
* @button: a #GtkScaleButton
* @adjustment: a #GtkAdjustment
*
* Sets the #GtkAdjustment to be used as a model for the #GtkScaleButton's scale.
* See gtk_range_set_adjustment() for details.
*
* Since: 2.12
*/
void
gtk_scale_button_set_adjustment (GtkScaleButton *button,
GtkAdjustment *adjustment)
{
g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
gtk_range_set_adjustment (GTK_RANGE (button->priv->scale),
adjustment);
}
/*
* button callbacks.
*/
static gboolean
gtk_scale_button_scroll (GtkWidget *widget,
GdkEventScroll *event)
{
GtkScaleButton *button;
GtkScaleButtonPrivate *priv;
GtkAdjustment *adj;
gdouble d;
button = GTK_SCALE_BUTTON (widget);
priv = button->priv;
adj = gtk_range_get_adjustment (GTK_RANGE (priv->scale));
if (event->type != GDK_SCROLL)
return FALSE;
d = gtk_scale_button_get_value (button);
if (event->direction == GDK_SCROLL_UP)
{
d += adj->step_increment;
if (d > adj->upper)
d = adj->upper;
}
else
{
d -= adj->step_increment;
if (d < adj->lower)
d = adj->lower;
}
gtk_scale_button_set_value (button, d);
return TRUE;
}
static void
gtk_scale_button_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen)
{
GtkScaleButton *button = (GtkScaleButton *) widget;
GtkScaleButtonPrivate *priv;
GdkScreen *screen;
GValue value = { 0, };
if (gtk_widget_has_screen (widget) == FALSE)
return;
priv = button->priv;
screen = gtk_widget_get_screen (widget);
g_value_init (&value, G_TYPE_INT);
if (gdk_screen_get_setting (screen,
"gtk-double-click-time",
&value) == FALSE)
{
priv->click_timeout = CLICK_TIMEOUT;
return;
}
priv->click_timeout = g_value_get_int (&value);
}
static gboolean
gtk_scale_popup (GtkWidget *widget,
GdkEvent *event,
guint32 time)
{
GtkScaleButton *button;
GtkScaleButtonPrivate *priv;
GtkAdjustment *adj;
gint x, y, m, dx, dy, sx, sy, ystartoff;
gdouble v;
GdkDisplay *display;
GdkScreen *screen;