2009/9/23 Simon Arnaud <ruby-forum-incoming@...>:
> Michal Suchanek wrote:
>> 2009/9/23 Simon Arnaud <ruby-forum-incoming@...>:
>>> I tried your example, but I don't see what's wrong.
>>> Is it supposed to demonstrate the problem ?
>> Yes, when you check the update checkbox the hscales are no longer
>> Perhaps I should have make it checked it to start with.
> I think 'on_xxxx_change_value' should return false/nil if you want the
> scale to update, or true otherwise.
> change 'update min, max' to :
> def update min,max
> if @update then
> STDERR.puts "returning false, scale will move"
> return false
> STDERR.puts "returning true, scale will NOT move"
> return true
> Since ruby returns your last statement, it returns max for you, which is
> always true. However, when you call queue_draw, it returns false, so,
> you on_xxx_change_value returns false.
Indeed, moving the handler to value_changed handler resolves the problem.
Unfortunately, this is not documented for ruby-gnome2.