[Icewing-user] "opts_float_create" and "opts_value_set" precision and gtk
Brought to you by:
floemker
From: Christian L. <chr...@un...> - 2009-06-16 10:29:13
|
Dear all, I have a question about the "opts_float_create" and "opts_value_set" functions of iceWing. When "opts_float_create" is used to create a slider, the given range for the value seems to determine the precision of that value implicitly. In case one uses "opts_value_set" with an value of higher precision in terms of post decimal positions, the value is truncated to that implicitly given precision by the call to "opts_value_set". In addition, gtk produces a beep to indicate that issue (this is at least my interpretation of the situation). I attached a small example which shows the described behavior. It can be compiled with "g++ -shared `icewing-config --cflags` -o libTestPlug.so TestPlug.cpp" and started by "icewing -l ./libTestPlug.so". When the slider is set to a value with two post decimal positions, it is not changed by the call to "opts_float_create". But if a value with three post decimal postions is used, it is truncated to two post decimal positions and the "beep" occurs. My question is now: How exactly is the precision of the value determined? I would like to now this to avoid unintended changes in the value and also to avoid the "beep" every time a value with too high precision is set. Thank you very much. Kind regards, Christian |