yad icon indicating copy to clipboard operation
yad copied to clipboard

values start with "-" cannot work

Open chengzhpchn opened this issue 1 year ago • 2 comments

UI elements which take a string or a numeric as their value, cannot work well when the value is starts with "-" command:

/usr/bin/yad --form --align='right' --columns=1 --separator='|' --item-separator='!' --date-format=%x --field='':LBL ''
--field='lowwer bound':NUM '3.0!-5..5!1!4'
--field='upper bound':NUM '1.0!-5..5!1!4'
--window-icon='gtk-edit' --width='500' --height='300' --center --title='设置[clientMapImageGet]参数'

can work well, but please notice that the value for NUM is positive, if we set a negative value:

/usr/bin/yad --form --align='right' --columns=1 --separator='|' --item-separator='!' --date-format=%x --field='':LBL ''
--field='lowwer bound':NUM '-3.0!-5..5!1!4'
--field='upper bound':NUM '1.0!-5..5!1!4'
--window-icon='gtk-edit' --width='500' --height='300' --center --title='设置[clientMapImageGet]参数'

it won't work as you thought.

the root cause lies in the gtk command line parser: g_option_context_parse it treat "-3" as a new option, not extra_data( see: options.extra_data in your code)

chengzhpchn avatar Apr 25 '23 09:04 chengzhpchn