Thank you David for your response. I am just a Gtk newbie so this question is a tough one for me. Sorry for cross-posting & I won't do it again next time. Thank you and have a good day.<br><br>On Saturday, November 19, 2011, David Nečas <<a href="mailto:yeti@physics.muni.cz">yeti@physics.muni.cz</a>> wrote:<br>
><br>> Was it really necessary to cross-post this question to *four* mailing<br>> lists?<br>><br>> On Sat, Nov 19, 2011 at 07:55:59AM -0500, Phong Cao wrote:<br>>> I use GtkHScale for the progress bar, which is responsible for<br>
>> updating the track progress & allow user to move to different time position<br>>> in the track.<br>>><br>>> Everything works fine until now, except that I can not use left-click<br>>> button to snap (or jump) to random position in the GtkHScale. Instead, I<br>
>> have to either drag or right-mouse-click.<br>><br>> The following is a kluge, but I suppose if you want the first button to<br>> invoke the same response as the middle button it should be all right<br>> (written in Python for brevity):<br>
><br>> from gi.repository import Gtk<br>><br>> def button1to2(scale, event):<br>> if event.button == 1:<br>> event.button = 2<br>> return False<br>><br>> adj = Gtk.Adjustment.new(0.0, 0.0, 1.0, 0.001, 0.01, 0)<br>
> scale = Gtk.Scale.new(Gtk.Orientation.HORIZONTAL, adj)<br>> scale.set_round_digits(3)<br>> scale.connect("button-press-event", button1to2)<br>> scale.connect("button-release-event", button1to2)<br>
><br>> window = Gtk.Window()<br>> window.add(scale)<br>> window.set_default_size(400, -1)<br>> window.show_all()<br>> window.connect("destroy", Gtk.main_quit)<br>> Gtk.main()<br>><br>><br>
> Yeti<br>><br>><br><br>-- <br>Phong V. Cao<div><a href="mailto:phngcv@gmail.com" target="_blank">phngcv@gmail.com</a></div><div><br></div><br>