After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 85436 - Slider with inverted Gtk[VH]Scale widget moves opposite direction
Slider with inverted Gtk[VH]Scale widget moves opposite direction
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-06-16 02:55 UTC by Norihiro UMEDA
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to gtk/gtkrange.c (1020 bytes, patch)
2002-06-16 03:03 UTC, Norihiro UMEDA
none Details | Review
Sorry, attachment(id=9250) is a mistake. This is a correct file. (1.00 KB, patch)
2002-06-16 03:18 UTC, Norihiro UMEDA
none Details | Review
Fix applied (1.75 KB, patch)
2002-07-30 23:17 UTC, Owen Taylor
none Details | Review

Description Norihiro UMEDA 2002-06-16 02:55:39 UTC
When I turn mouse wheel on inverted GtkVScale/GtkHScale Widget
( applied gtk_range_set_inverted(GTK_RANGE(scale),TRUE) ),its slider moves 
opposite direction.

Test case.
/* cc scale.c -o scale `pkg-config --cflags --libs gtk+-2.0`
#include <gtk/gtk.h>

int main(int argc,char *argv[])
{
  GtkWidget *window;
  GtkWidget *vslider;
  GtkWidget *hbox;

  gtk_init(&argc,&argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_widget_show(window);
  hbox = gtk_hbox_new(FALSE,0);
  gtk_container_add(GTK_CONTAINER(window),hbox);
  gtk_widget_show(hbox);

  vslider = gtk_vscale_new_with_range(0.0, 100.0, 1.0);
  gtk_widget_show(vslider);
  gtk_range_set_inverted(GTK_RANGE(vslider),FALSE);
  gtk_box_pack_start(GTK_BOX(hbox),vslider,TRUE,TRUE,0);

  vslider = gtk_vscale_new_with_range(0.0, 100.0, 1.0);
  gtk_widget_show(vslider);
  gtk_range_set_inverted(GTK_RANGE(vslider),TRUE);
  gtk_box_pack_start(GTK_BOX(hbox),vslider,TRUE,TRUE,0);

  gtk_main();
  return 0;
}

I turn wheel clockwise in this program, left vertical scale's(non-inverted)
slider 
move up, but right(inverted) one move down.
Comment 1 Norihiro UMEDA 2002-06-16 03:03:08 UTC
Created attachment 9250 [details] [review]
patch to gtk/gtkrange.c
Comment 2 Norihiro UMEDA 2002-06-16 03:05:10 UTC
This patch fixes above problem.If range is inverted, its slider moves
direction
opposite to *not* inverted range.
Comment 3 Norihiro UMEDA 2002-06-16 03:18:21 UTC
Created attachment 9251 [details] [review]
Sorry, attachment(id=9250) is a mistake. This is a correct file.
Comment 4 Owen Taylor 2002-07-30 23:17:19 UTC
Created attachment 10133 [details] [review]
Fix applied
Comment 5 Owen Taylor 2002-07-30 23:18:46 UTC
I've applied a slight different (but functionally equivalent)
version of your fix now. Thanks.

Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkrange.c (gtk_range_scroll_event): Handle
        inverted ranges correctly (#85436, fix from
        Norihiro UMEDA)