summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-05-31 19:07:17 +0000
committerdteske <dteske@FreeBSD.org>2013-05-31 19:07:17 +0000
commita0eece46063b1db33804c35b64793e3afc2424c1 (patch)
tree2634f68f77f7c057b30aa67f1c494a01df2e22a7 /lib
parent838ba827a2bbb59d8184419cf6632b7afa203afa (diff)
downloadFreeBSD-src-a0eece46063b1db33804c35b64793e3afc2424c1.zip
FreeBSD-src-a0eece46063b1db33804c35b64793e3afc2424c1.tar.gz
Improve portion of the dialog(1) API in dialog.subr responsible for
calculating widget sizes. Instead of forking a sub-shell to calculate the optimum size for a widget, use a byRef style call-out to set variables in the parent namespace. For example, instead of: size=$( f_dialog_buttonbox_size title btitle msg ) $DIALOG --title title --backtitle btitle --msgbox msg $size The new API replaces the above with the following: f_dialog_buttonbox_size height width title btitle msg $DIALOG --title title --backtitle btitle --msgbox msg $height $width This reduces the number of forks, improves performance, and makes the code more readable by revealing the argument-order for widget sizing. It also makes performing minor adjustments to the calculated values easier as you no longer have to split-out the response (which required knowledge of ordering so was counter-intuitive).
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud