mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-02 05:17:03 +08:00
Bug fixed: sneding value while no one is availabale for undo
This commit is contained in:
@@ -208,6 +208,7 @@ let one_setting = fun i do_change packing s (tooltips:GData.tooltips) strip ->
|
|||||||
let _n = truncate ((upper -. lower) /. step_incr) in
|
let _n = truncate ((upper -. lower) /. step_incr) in
|
||||||
let commit =
|
let commit =
|
||||||
if step_incr = 1. && upper -. lower <= 2. then
|
if step_incr = 1. && upper -. lower <= 2. then
|
||||||
|
(* Discrete values: radio buttons *)
|
||||||
let ilower = truncate lower
|
let ilower = truncate lower
|
||||||
and iupper = truncate upper in
|
and iupper = truncate upper in
|
||||||
let label = Printf.sprintf "%d" ilower in
|
let label = Printf.sprintf "%d" ilower in
|
||||||
@@ -233,7 +234,7 @@ let one_setting = fun i do_change packing s (tooltips:GData.tooltips) strip ->
|
|||||||
commit_but#set_border_width 2;
|
commit_but#set_border_width 2;
|
||||||
let _icon = GMisc.image ~stock:`APPLY ~packing:commit_but#add () in
|
let _icon = GMisc.image ~stock:`APPLY ~packing:commit_but#add () in
|
||||||
let callback = fun x ->
|
let callback = fun x ->
|
||||||
prev_value := Some (float_of_string _v#text);
|
prev_value := (try Some (float_of_string _v#text) with _ -> None);
|
||||||
commit x
|
commit x
|
||||||
in
|
in
|
||||||
ignore (commit_but#connect#clicked ~callback);
|
ignore (commit_but#connect#clicked ~callback);
|
||||||
|
|||||||
Reference in New Issue
Block a user