#!/usr/bin/env bash
#
#####################################
#####################################
#
# EasyBashGUI allows you to use SAME script
# with yad, gtkdialog, kdialog, zenity, Xdialog, (c)dialog, whiptail or bare bash !!!!
#
#########################
#
# Copyright (C) 2020 Vittorio Cagnetta
#
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program, 
# called, in this distribution, "EasyBashGUI-license"; if not, write to the 
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
#########################
#
#	Dedicated to Angela, Nicole and Carlo.
#
#			Vittorio Cagnetta
#	https://sites.google.com/site/easybashgui
#
#####################################
#####################################
#
LIB_VERSION="12.0.4"
LIB_NAME="easybashgui.lib"
LIB_URL="https://github.com/BashGui/easybashgui"
LIB_AUTHOR="Vittorio Cagnetta"
#
#####################################
#####################################
#
[ "${easybashgui_debug_mode:-unset}" = "unset" ] && declare easybashgui_debug_mode="NO"
[ "${easybashgui_debug_mode}" = "YES" ] && echo -en "...${LIB_NAME} (vers.: ${LIB_VERSION}) sourcing...\t"
#
#####################################
#####################################
# Initial settings...
#
##
#
[ "${eb_current_process_path:-unset}" = "unset" ] && declare eb_current_process_path="$(echo "${0}" | sed s\#'^-'#''# )"
if [ ${#supertitle} -eq 0 ]
	then
	supertitle="$(basename "${eb_current_process_path}" )"
else
	: supertitle
fi
#
##
#
if [ ${#supericon} -eq 0 ]
	then
	user_icon="NO"
else
	user_icon="YES"
fi
#
##
# mascotte...
[ ${#OSTYPE} -gt 0 ] && os=${OSTYPE} || os="$(uname -s )"
[ $(echo -n "${os}" | grep -i "bsd" | wc -c ) -gt 0 ] && \
mascotte="Beastie" || mascotte="Tux"
#
##
#
# Window width and height...
width=500
: width
height=378
: height
#
##
#
typing_tac="$(type 'tac' 2> /dev/null )"
[ ${#typing_tac} -eq 0 ] && shopt -s expand_aliases && alias tac="sed '1'\!'G;h;$'\!'d'"
: tac
#
typing_seq="$(type 'seq' 2> /dev/null )"
[ ${#typing_seq} -eq 0 ] && seq() { for ((index=${1}; index<=${2}; index++)); do echo "${index}"; done; } && export -f seq
#
##
#
# gsed...
for word in sed gsed
	do
	unset -v "${word}"
	unset -f "${word}"
done 
[ "${mascotte}" = "Beastie" ] && : #later we'll check for gsed binary...
[ "${mascotte}" = "Tux" ] && shopt -s expand_aliases && alias gsed=sed #gsed is no more a function...
typing_gsed="$(type 'gsed' 2> /dev/null )"
if [ ${#typing_gsed} -eq 0 ]
	then
	[ "${mascotte}" = "Beastie" ] && echo -e "\n\n\n\nYou need to install \"gsed\" ( GNU Sed ) port/package to use ${LIB_NAME}...\nSorry :(\n\n\n\n" 1>&2
	[ "${mascotte}" = "Tux" ] && echo -e "\n\n\n\nErr.: gsed aliasing failed!...\n:(\n\n\n\n" 1>&2
	#
	exit 1
fi
#
##
#
# where storing data file...
default_tmp="${HOME}/tmp"
if [ -d "${default_tmp}" ]
	then
	dir_tmp="${default_tmp}"
else
	dir_tmp="/tmp"
fi
[ ! -d "${dir_tmp}" -o ! -w "${dir_tmp}" ] && mkdir "${default_tmp}" && dir_tmp="${default_tmp}"
: dir_tmp
#
if [ -f "${dir_tmp}/${file_tmp}" ]
	then
	: 1> "${dir_tmp}/${file_tmp}"
	: 1> "${dir_tmp}/${file_ignore}"
else
	cd "${dir_tmp}"
	export file_tmp="$(mktemp "XXXXXXXXXXXXXXXXXXXX" )"
	export file_ignore="$(mktemp "XXXXXXXXXXXXXXXXXXXX" )"
	cd - 1>/dev/null
fi
: file_tmp
#
##
#
# Set it if you want _force_ easybashgui mode :
#supermode="" # <= 5 options: "auto" "gtkdialog" "kdialog", "zenity", "Xdialog", "dialog"
: supermode
#
##
#
string_to_clean=':1: error: unexpected .*, expected .* - e.g. .*'
: string_to_clean
#
##
#
#####################################
#
# ... yad, gtkdialog, kdialog, zenity, Xdialog, or dialog ???
#
################
#
yad="NO"
esistenza_yad="$(type "yad" 2> /dev/null )"
if [ ${#esistenza_yad} -gt 0 ]
	then
	#
	# versione minima => 0.17.1.1  ...
	required_yad_first_field=0
	required_yad_second_field=17
	required_yad_third_field=1
	#
	vers_yad="$(yad --version | cut -d ' ' -f 3 )"
	if [ $(echo -n "${vers_yad}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ]
		then
		vers_yad_primo_campo=$(echo "${vers_yad}" | cut -d '.' -f 1 )
		vers_yad_secondo_campo=$(echo "${vers_yad}" | cut -d '.' -f 2 )
		vers_yad_terzo_campo=$(echo "${vers_yad}" | cut -d '.' -f 3 )
		#
		if [ ${vers_yad_primo_campo} -gt ${required_yad_first_field} ]
			then
			#
			yad="SI"
			#
		elif [ ${vers_yad_primo_campo} -eq ${required_yad_first_field} ]
			then
			#
			if [ ${vers_yad_secondo_campo} -gt ${required_yad_second_field} ]
				then
				#
				yad="SI"
				#
			elif [ ${vers_yad_secondo_campo} -eq ${required_yad_second_field} ]
				then
				#
				if [ ${vers_yad_terzo_campo} -ge ${required_yad_third_field} ]
					then
					#
					yad="SI"
					#
				fi
				#
			fi
			#
		fi # if [ ${vers_yad_primo_campo} -gt ${required_yad_first_field} ]
		#
	fi #if [ $(echo -n "${vers_yad}" | tr -dc '[[:digit:]]' | wc -c) -gt 0 ]
	#
fi #if [ ${#esistenza_yad} -gt 0 ]
#
gtkdialog="NO"
esistenza_gtkdialog="$(type "gtkdialog" 2> /dev/null )"
if [ ${#esistenza_gtkdialog} -gt 0 ]
	then
	#
	# versione minima => 0.7.20 ...
	required_gtkdialog_first_field=0
	required_gtkdialog_second_field=7
	required_gtkdialog_third_field=20
	#
	vers_gtkdialog="$(gtkdialog --version | cut -d ' ' -f 3 | head -n 1 )"
	if [ $(echo -n "${vers_gtkdialog}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ]
		then
		vers_gtkdialog_primo_campo=$(echo "${vers_gtkdialog}" | cut -d '.' -f 1 )
		vers_gtkdialog_secondo_campo=$(echo "${vers_gtkdialog}" | cut -d '.' -f 2 )
		vers_gtkdialog_terzo_campo=$(echo "${vers_gtkdialog}" | cut -d '.' -f 3 )
		#
		if [ ${vers_gtkdialog_primo_campo} -gt ${required_gtkdialog_first_field} ]
			then
			#
			gtkdialog="SI"
			#
		elif [ ${vers_gtkdialog_primo_campo} -eq ${required_gtkdialog_first_field} ]
			then
			#
			if [ ${vers_gtkdialog_secondo_campo} -gt ${required_gtkdialog_second_field} ]
				then
				#
				gtkdialog="SI"
				#
			elif [ ${vers_gtkdialog_secondo_campo} -eq ${required_gtkdialog_second_field} ]
				then
				#
				if [ ${vers_gtkdialog_terzo_campo} -ge ${required_gtkdialog_third_field} ]
					then
					#
					gtkdialog="SI"
					#
				fi
				#
			fi
			#
		fi # if [ ${vers_gtkdialog_primo_campo} -gt ${required_gtkdialog_first_field} ]
		#
	fi #if [ $(echo -n "${vers_gtkdialog}" | tr -dc '[[:digit:]]' | wc -c) -gt 0 ]
	#
fi #if [ ${#esistenza_gtkdialog} -gt 0 ]
#
kdialog="NO"
esistenza_kdialog="$(type "kdialog" 2> /dev/null )"
if [ ${#esistenza_kdialog} -gt 0 ]
	then
	# versione minima => 1.0 ...
	required_kdialog_first_field=1
	#
	vers_kdialog="$(kdialog --version 2> /dev/null | gsed -n s\#'^.*kdialog[[:punct:]]*[[:blank:]]*\(.*\)$'#'\1'#Ip )"
	if [ $(echo -n "${vers_kdialog}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ]
		then
		vers_kdialog_primo_campo=$(echo "${vers_kdialog}" | cut -d '.' -f 1 )
		#vers_kdialog_secondo_campo=$(echo "${vers_kdialog}" | cut -d '.' -f 2 )
		# 
		if [ ${vers_kdialog_primo_campo} -ge ${required_kdialog_first_field} ]
			then
			#
			kdialog="SI"
			#
		fi #if [ ${vers_kdialog_primo_campo} -ge 1 ]
		#
	fi #if [ $(echo -n "${vers_kdialog}" | tr -dc '[[:digit:]]' | wc -c) -gt 0 ]
	#
fi #if [ ${#esistenza_kdialog} -gt 0 ]
#
zenity="NO"
esistenza_zenity="$(type "zenity" 2> /dev/null )"
if [ ${#esistenza_zenity} -gt 0 ]
	then
	#
	# versione minima => 2.26 ...
	required_zenity_first_field=2
	required_zenity_second_field=26
	#
	vers_zenity="$(zenity --version 2>/dev/null )"
	if [ $(echo -n "${vers_zenity}" | tr -dc '[[:digit:]]' | wc -c) -gt 0 ]
		then
		vers_zenity_primo_campo=$(echo "${vers_zenity}" | cut -d '.' -f 1 )
		vers_zenity_secondo_campo=$(echo "${vers_zenity}" | cut -d '.' -f 2 )
		#
		if [ ${vers_zenity_primo_campo} -gt ${required_zenity_first_field} ]
			then
			#
			zenity="SI"
			#
		elif [ ${vers_zenity_primo_campo} -eq ${required_zenity_first_field} ]
			then
			#
			if [ ${vers_zenity_secondo_campo} -ge ${required_zenity_second_field} ]
				then
				#
				zenity="SI"
				#
			fi
			#
		fi
		#
	fi #if [ $(echo -n "${vers_zenity}" | tr -dc '[[:digit:]]' | wc -c) -gt 0 ]
	#
fi #if [ ${#esistenza_zenity} -gt 0 ]
#
Xdialog="NO"
esistenza_Xdialog="$(type "Xdialog" 2> /dev/null)"
if [ ${#esistenza_Xdialog} -gt 0 ]
	then
	Xdialog="SI"
fi
#
dialog="NO"
esistenza_dialog="$(type "dialog" 2> /dev/null)"
if [ ${#esistenza_dialog} -gt 0 ]
	then
	dialog="SI"
fi
#
whiptail="NO"
esistenza_whiptail="$(type "whiptail" 2> /dev/null)"
if [ ${#esistenza_whiptail} -gt 0 ]
	then
	whiptail="SI"
fi
#
################
#
if [ "${kdialog}" = "NO" -a "${zenity}" = "NO" -a "${Xdialog}" = "NO" -a "${dialog}" = "NO" -a "${whiptail}" = "NO" ]
	then
	export eb_gui_fallback="true"
else
	export eb_gui_fallback="false"
fi
#
################
#
if [ "${kdialog}" = "NO" -a "${zenity}" = "NO" -a "${Xdialog}" = "NO" ]
	then
	mode="dialog"
	#
elif [ "${kdialog}" = "NO" -a "${zenity}" = "NO" -a "${Xdialog}" = "SI" ]
	then
	mode="Xdialog"
	#
elif [ "${kdialog}" = "NO" -a "${zenity}" = "SI" -a "${Xdialog}" = "NO" ]
	then
	mode="zenity"
	#
elif [ "${kdialog}" = "NO" -a "${zenity}" = "SI" -a "${Xdialog}" = "SI" ]
	then
	# Esistono sia zenity sia Xdialog...
	#
	## priorita' a zenity ? ...solo se c'e' Gnome... : $(ps aux | grep "gnome-panel" | grep -v grep )
	#if [ $(ps aux | grep "gnome-panel" | grep -v grep | wc -c ) -gt 0 ]
	#	then
	#	# Sta girando Gnome... 
	#	mode="zenity"
	#	#
	#else
	#	# Gnome NON sta' girando...
	#	mode="Xdialog"
	#	#
	#fi #if STA GIRANDO GNOME...
	#
	## priorita' a zenity ? ... yes
	mode="zenity"
	#
elif [ "${kdialog}" = "SI" -a "${zenity}" = "NO" -a "${Xdialog}" = "NO" ]
	then
	mode="kdialog"
	#
elif [ "${kdialog}" = "SI" -a "${zenity}" = "NO" -a "${Xdialog}" = "SI" ]
	then
	# Esistono sia kdialog sia Xdialog...
	# priorita' a kdialog ? ...solo se c'e' KDE... : 
	kde="$(ps ax | grep "kde" | grep "bin" | grep -v grep )"
	kwin="$(ps aux | grep "\<kwin\>" | grep -v grep )"
	if [ ${#kde} -gt 0 -a ${#kwin} -gt 0 ]
		then
		# Sta girando KDE... 
		mode="kdialog"
		#
	else
		# KDE NON sta' girando...
		mode="Xdialog"
		#
	fi #if STA GIRANDO KDE...
	#
elif [ "${kdialog}" = "SI" -a "${zenity}" = "SI" ]
	then
	# Esistono sia kdialog sia zenity...
	# priorita' a kdialog ? ...solo se c'e' KDE... : 
	kde="$(ps ax | grep "kde" | grep "bin" | grep -v grep )"
	kwin="$(ps aux | grep "\<kwin\>" | grep -v grep )"
	if [ ${#kde} -gt 0 -a ${#kwin} -gt 0 ]
		then
		# Sta girando KDE... 
		mode="kdialog"
		#
	else
		# KDE NON sta' girando...
		mode="zenity"
		#
	fi #if STA GIRANDO KDE...
	#
fi #if [ "${kdialog}" = "NO" -a "${zenity}" = "NO" -a "${Xdialog}" = "NO" ]
#
################
#
if [ "${mode}" = "kdialog" ]
	then
	kdialog_presente_e_funzionante="$(kdialog 2>&1 )"
	if [ $(echo -n "${kdialog_presente_e_funzionante}" | grep ".*cannot connect to X server" | wc -c ) -eq 0 ]
		then
		mode="kdialog"
	elif [ $(echo -n "${kdialog_presente_e_funzionante}" | grep ".*cannot connect to X server" | wc -c ) -gt 0 ]
		then
		mode="dialog"
	fi
	#
fi
#
if [ "${mode}" = "zenity" ]
	then
	zenity_presente_e_funzionante="$(zenity 2>&1 )"
	if [ $(echo -n "${zenity_presente_e_funzionante}" | grep ".*cannot open display:" | wc -c ) -eq 0 ]
		then
		mode="zenity"
	elif [ $(echo -n "${zenity_presente_e_funzionante}" | grep ".*cannot open display:" | wc -c ) -gt 0 ]
		then
		mode="dialog"
	fi
	#
fi
#
if [ "${mode}" = "Xdialog" ]
	then
	Xdialog_presente_e_funzionante="$(Xdialog --version 2>&1 )"
	if [ $(echo -n "${Xdialog_presente_e_funzionante}" | grep "Do you run under X11 with GTK.*installed ?" | wc -c) -eq 0 ]
		then
		mode="Xdialog"
	elif [ $(echo -n "${Xdialog_presente_e_funzionante}" | grep "Do you run under X11 with GTK.*installed ?" | wc -c) -gt 0 ]
		then
		mode="dialog"
	fi
	#
fi
#
#########################################################################
######### Final: => let's substitute "gtkdialog" or "yad" to... #########
if [ "${gtkdialog}" = "SI" ]
	then
	#
	if [ "${mode}" != "dialog" -a "${mode}" != "kdialog" ] # ...whatever dialog but "dialog" and "kdialog", moreover...
		then
		# ...only if DISPLAY var is set...
		if [ ${#DISPLAY} -gt 0 ]
			then
			# ;)
			mode="gtkdialog"
			#
		else
			# :/
			mode="dialog"
			#
		fi
		#
	fi
	#
fi
#
###############
#
if [ "${yad}" = "SI" ]
	then
	#
	if [ "${mode}" != "dialog" -a "${mode}" != "kdialog" ] # ...whatever dialog but "dialog" and "kdialog", moreover...
		then
		# ...only if DISPLAY var is set...
		if [ ${#DISPLAY} -gt 0 ]
			then
			# ;)
			mode="yad"
			#
		else
			# :/
			mode="dialog"
			#
		fi
		#
	fi
	#
fi
#
###############
#
export notify_send_seconds=4
#
export notify_icon_default="gtk-execute"
export notify_icon_good="gtk-home"
export notify_icon_bad="gtk-help"
#
export notify_tooltip_default="${supertitle} -> starting..."
export notify_tooltip_good="${supertitle} -> OK"
export notify_tooltip_bad="${supertitle} -> BAD"
#
notify_send="NO"
esistenza_notify_send="$(type 'notify-send' 2> /dev/null )"
if [ ${#esistenza_notify_send} -gt 0 ]
	then
	notify_send="SI"
fi
#
#####################################
#
# This is only for test, it's preferable that mode is set automatically...
if [ ${#supermode} -eq 0 ]
	then
	#echo "Var \"\${supermode}\" not set."
	:
else
	case "${supermode}" in
		"auto" )
			:;;
		#
		"yad"|"gtkdialog"|"kdialog"|"zenity"|"Xdialog"|"dialog" )
			[ "${easybashgui_debug_mode}" = "YES" ] && echo -e "\n${LIB_NAME}: Var. \${mode} forced to: \"${supermode}\" ." ; mode="${supermode}" ;;
		#
		"none" )
			[ "${easybashgui_debug_mode}" = "YES" ] && echo -e "\n${LIB_NAME}: Var. \${mode} forced to: \"${supermode}\" ." ; export eb_gui_fallback="true" ; return 1 ;;
		#
		*)
			echo -e "\n${LIB_NAME}: ERR: \"supermode\" is not correct." 1>&2 && sleep 2 && exit 1 ;;
		#
	esac
fi
#
#####################################
#
###############
#
# Variables...
: width
: height
if [ "${mode}" = "yad" ]
	then
	dimensione_finestra="--width=${width} --height=${height}"
	dimensione_finestra_1="--width=${width} --height=${height}"
	dimensione_finestra_2=""
	no_tags=""
	no_buttons=""
	menubox="--list"
	icona_Ok=""
	icona_Attenzione=""
	progress="--progress"
	#
	[ "${user_icon}" = "YES" ] \
	&& \
		dialogo="yad --window-icon ${supericon}" \
	|| \
		dialogo="yad"
	#
elif [ "${mode}" = "gtkdialog" ]
	then
	#
	dialogo="gtkdialog"
	#
elif [ "${mode}" = "kdialog" ]
	then
	x_root=$(xwininfo -root | gsed -n s\#'^.*-geometry[[:blank:]]\([[:digit:]]\+\)[[:alpha:]]\([[:digit:]]\+\).*$'#'\1'#p )
	y_root=$(xwininfo -root | gsed -n s\#'^.*-geometry[[:blank:]]\([[:digit:]]\+\)[[:alpha:]]\([[:digit:]]\+\).*$'#'\2'#p )
	if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
		then
		x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
		y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
	fi
	#
	dimensione_finestra="--geometry=${width}x${height}${x}${y}"
	dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
	dimensione_finestra_2=""
	no_tags=""
	no_buttons=""
	menubox="--menu"
	icona_Ok=""
	icona_Attenzione=""
	progress="--progressbar"
	#
	[ "${user_icon}" = "YES" ] \
	&& \
		dialogo="kdialog ${dimensione_finestra} --icon ${supericon}" \
	|| \
		dialogo="kdialog ${dimensione_finestra}"
	#
elif [ "${mode}" = "zenity" ]
	then
	dimensione_finestra="--width=${width} --height=${height}"
	dimensione_finestra_1="--width=${width} --height=${height}"
	dimensione_finestra_2=""
	no_tags=""
	no_buttons=""
	menubox="--list"
	icona_Ok=""
	icona_Attenzione=""
	progress="--progress"
	# 
	[ "${user_icon}" = "YES" ] \
	&& \
		dialogo="zenity --window-icon ${supericon}" \
	|| \
		dialogo="zenity"
	#
elif [ "${mode}" = "Xdialog" ]
	then
	dimensione_finestra="${width}x${height}"
	dimensione_finestra_1="${width}x${height}"
	dimensione_finestra_2=""
	no_tags="--no-tags"
	no_buttons="--no-buttons"
	menubox="--menubox"
	icona_Ok="--icon /usr/share/easybashgui/Ok.xpm"
	icona_Attenzione="--icon /usr/share/easybashgui/Attenzione.xpm"
	progress="--progress"
	#
	dialogo="Xdialog"
	#
elif [ "${mode}" = "dialog" ]
	then
	ERR_MESSAGE="YES"
	#
	dimensione_finestra="38 80"
	dimensione_finestra_1=38
	dimensione_finestra_2=80
	no_tags=""
	no_buttons=""
	menubox="--menu"
	icona_Ok=""
	icona_Attenzione=""
	progress="--gauge"
	#
	if [ $(dialog --help 2>&1 | grep -- "--separator" | wc -c) -gt 0 ]
		then
		separator="--separator"
		dialogo="dialog"
		#
		ERR_MESSAGE="NO"
		#
	elif [ $(dialog --help 2>&1 | grep -- "--separate-widget" | wc -c) -gt 0 ]
		then
		separator="--separate-widget"
		dialogo="dialog"
		#
		ERR_MESSAGE="NO"
		#
	else
		#
		whiptail="NO"
		esistenza_whiptail="$(type "whiptail" 2> /dev/null )"
		if [ ${#esistenza_whiptail} -gt 0 ]
			then
			required_whiptail_first_field=0
			required_whiptail_second_field=52
			required_whiptail_third_field=10
			# versione minima => 0.52.10 ...
			#
			whiptail_version="$(whiptail --version | cut -d ' ' -f 3 )"
			if [ $(echo -n "${whiptail_version}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ]
				then
				whiptail_first_field=$(echo "${whiptail_version}" | cut -d '.' -f 1 )
				whiptail_second_field=$(echo "${whiptail_version}" | cut -d '.' -f 2 )
				whiptail_third_field=$(echo "${whiptail_version}" | cut -d '.' -f 3 )
				#
				if [ ${whiptail_first_field} -gt ${required_whiptail_first_field} ]
					then
					obsolete_lib="NO"
				elif [ ${whiptail_first_field} -lt ${required_whiptail_first_field} ]
					then
					obsolete_lib="YES"
				elif [ ${whiptail_first_field} -eq ${required_whiptail_first_field} ]
					then
					if [ ${whiptail_second_field} -gt ${required_whiptail_second_field} ]
						then
						obsolete_lib="NO"
					elif [ ${whiptail_second_field} -lt ${required_whiptail_second_field} ]
						then
						obsolete_lib="YES"
					elif [ ${whiptail_second_field} -eq ${required_whiptail_second_field} ]
						then
						if [ ${whiptail_third_field} -gt ${required_whiptail_third_field} ]
							then
							obsolete_lib="NO"
						elif [ ${whiptail_third_field} -lt ${required_whiptail_third_field} ]
							then
							obsolete_lib="YES"
						elif [ ${whiptail_third_field} -eq ${required_whiptail_third_field} ]
							then
							obsolete_lib="NO"
							# perche' le due versioni sono ESATTAMENTE identiche...
						fi
						#
					fi #if [ ${array_LIB_VERSION[1]} -gt ${array_MIN_LIB_VERSION_REQUIRED[1]} ]
					#
				fi #if [ ${array_LIB_VERSION[0]} -gt ${array_MIN_LIB_VERSION_REQUIRED[0]} ]
				#
				if [ "${obsolete_lib}" = "NO" ]
					then
					#
					whiptail="SI"
					#
					separator="--separate-output"
					dialogo="whiptail --fb"
					#
					ERR_MESSAGE="NO"
					#
				else
					#
					ERR_MESSAGE="YES"
					#
				fi
			else
				#
				ERR_MESSAGE="YES"
				#
			fi # if [ $(echo -n "${vers_whiptail}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ]
			#
		else
			#
			ERR_MESSAGE="YES"
			#
		fi # if [ ${#esistenza_whiptail} -gt 0 ]
		#
	fi
	#
	if [ "${ERR_MESSAGE}" = "YES" ]
		then
		echo -e "\nYour \"whiptail\" version is obsolete or your \"dialog\" is NOT an alias to \"cdialog\", but is the original very old one... \nPlease, try to install \"cdialog\" and alias \"dialog\" to it. \nAlternately, you could install newest \"whiptail\", that is a cdialog replacement."
		export eb_gui_fallback="true"
		return 1
	fi
	#
	: dialogo
	#
fi
#
##
#
###############################################
###############################################
######### ...  FUNCTIONS  ... #################
###############################################
###############################################
#
##
#
clean_temp()
	{
	local FUNCT_NAME="clean_temp"
	local IFS=$' \t\n'
	#
	if [ -f "${dir_tmp}/${file_tmp}" ] 2> /dev/null
		then
		rm -f "${dir_tmp}/${file_tmp}" 2> /dev/null
	fi
	#
	if [ -f "${dir_tmp}/${file_ignore}" ] 2> /dev/null
		then
		rm -f "${dir_tmp}/${file_ignore}" 2> /dev/null
	fi
	#
	}
#
##
#
# This is only used in Xdialog mode, for its *annoying* error messages sent in STDOUT...
clean()
	{
	local FUNCT_NAME="clean"
	local IFS=$' \t\n'
	#
	while read Xdialog_stdout
		do
		if [ $(echo -n "${Xdialog_stdout}" | grep "${string_to_clean}" | wc -c ) -gt 0 ]
			then
			echo "yes" 1> "${dir_tmp}/${file_ignore}"
			echo "You have gtk 1.x config problems... :(" 1>&2
		fi
		echo "${Xdialog_stdout}" | grep -v "${string_to_clean}"
	done
	}
#
##
#
arrotonda()
	{
	local FUNCT_NAME="arrotonda"
	local IFS=$' \t\n'
	#
	float="${1}"
	#
	float__integer_part=$(echo "${float}" | cut -d '.' -f 1 ) ; [ ${#float__integer_part} -eq 0 ] && float__integer_part=0
	float__decimal_part=$(echo "${float}" | cut -d '.' -f 2 )
	# =>
	[ ${float__decimal_part} -le 50 ] && \
	arrotondato=${float__integer_part} || \
	arrotondato=$(( ${float__integer_part} + 1 ))
	#
	echo "${arrotondato}"
	#
	}
#
##
#
if_arg_is_an_empty_variable_then_exit()
	{
	local FUNCT_NAME="if_arg_is_an_empty_variable_then_exit"
	local IFS=$' \t\n'
	#
	var_da_controllare="${1}"
	if [ $(echo -n "${!var_da_controllare}" | wc -c ) -eq 0 ]
		then
		#
		clean_temp
		exit
	fi
	}
#
##
#
exit_if_user_closes_window()
	{
	uscita=${?}
	local FUNCT_NAME="exit_if_user_closes_window"
	local IFS=$' \t\n'
	#
	if [ -f "${dir_tmp}/${file_ignore}" ]
		then
		if [ "$(0< "${dir_tmp}/${file_ignore}" )" = "yes" ]
			then
			return 0
		fi
	fi
	#
	if [ ${uscita} -ne 0 ]
		then
		#clean_temp
		if [ ${uscita} -eq 1 ]
			then
        		#
			#echo "Hai cliccato su \"Cancel\"..."
			#
			exit 1
			#
		elif [ ${uscita} -eq 255 ]
			then
	        	#
			#echo "Hai chiuso la finestra..."
			#
			exit 255
			#
		elif [ ${uscita} -eq 252 ]
			then
	        	#
			#echo "_Yad_ ha chiuso la finestra..."
			#
			exit 252
			#
		else
			if [ "${dialogo}" = "zenity" -a ${uscita} -eq 5 ]
				then
				# Non far niente: sembra un codice di uscita di zenity legato ai temi...
				:
				#
			else
				#
				#
				alert_message ":( ...Something went wrong..."
				echo -e "\n:( ...Something went wrong..." 1>&2
				#
				exit 1
				#
			fi
			#
		fi
		#
	fi
	}
#
##
# notify(), notify_change()
if [ "${yad}" = "SI" ]
	then
	# notify <-c "[click command (for mouse left button)]"> <-i "[icon_good]#[icon_bad]"> <-t "[tooltip_good]#[tooltip_bad]"> "[menu item 1]" "[menu command 1]" ... "[menu item n]" "[menu command n]" 
	#
	notify()
		{
		local FUNCT_NAME="notify"
		local IFS=$' \t\n'
		#
		unset click_command
		unset icons
		unset tooltips
		#
		while getopts ":c:i:t:" notify_function_options
			do
			case ${notify_function_options} in
				#
				c	) export click_command="${OPTARG}" ;;
				i	) export icons="${OPTARG}" ;;
				t	) export tooltips="${OPTARG}" ;;
				#
			esac
		done
		shift $((OPTIND-1))
		#
		##############################
		#
		local cut_char="#"
		#
		: notify_icon_good
		: notify_icon_bad
		if [ ${#icons} -gt 0 ]
			then
			notify_icon_good="$(echo "${icons}" | cut -d "${cut_char}" -f 1 )"
			notify_icon_bad="$(echo "${icons}" | cut -d "${cut_char}" -f 2 )"
		fi
		unset icons
		#
		: notify_tooltip_good
		: notify_tooltip_bad
		if [ ${#tooltips} -gt 0 ]
			then
			notify_tooltip_good="$(echo "${tooltips}" | cut -d "${cut_char}" -f 1 )"
			notify_tooltip_bad="$(echo "${tooltips}" | cut -d "${cut_char}" -f 2 )"
		fi
		unset tooltips
		#
		unset notify_args
		unset notify_commands
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				notify_args[${array_index}]="${1}"
				notify_commands[${array_index}]="${2}"
				#
				shift ; shift
			done
		local IFS=$' \t\n'
		: notify_args[@]
		: notify_commands[@]
		#
		local IFS=$'\n'
		notify_items="$(for (( index=0 ; index < ${#notify_args[@]} ; index++ ))
										do
										echo -ne "|-> "
										echo -ne "${notify_args[${index}]}"
										echo -ne "!"
										echo -ne "${notify_commands[${index}]}"
								done )"
		local IFS=$' \t\n'
		#
		notify_menu="  ${supertitle}|${notify_items}|-> Quit!quit"
		#
		##
		#
		# remove previously created FIFOs...
		for ebg_PIPE_file in $(ls "${dir_tmp}/${0##*/}".???????? 2>/dev/null )
			do
			#echo "Removing \"${ebg_PIPE_file}\" ..."
			rm "${ebg_PIPE_file}"
		done
		# create a new FIFO file, used to manage the I/O redirection from shell...
		export ebg_PIPE="$(mktemp -u "${dir_tmp}/${0##*/}.XXXXXXXX" )"
		mkfifo "${ebg_PIPE}"
		# eventually attach a file descriptor to the FIFO...
		exec 3<> "${ebg_PIPE}"
		#
		###
		#
		# add handler to manage process shutdown...
		notify_on_exit()
			{
			echo "quit" 1> "${ebg_PIPE}"
			rm -f "${ebg_PIPE}"
			clean_temp
			}
		trap notify_on_exit EXIT
		#
		# add handler for tray icon left click...
		notify_on_click()
			{
			echo "tooltip:${0##*/} -> wait..." 1> "${ebg_PIPE}"
			#
			if [ ${#click_command} -eq 0 ]
				then
				{
					export supericon="${notify_icon_good}"
					source easybashgui
					ok_message "\n ${supertitle}: powered by EasyBashGUI vers.${LIB_VERSION}"
					clean_temp
				} &>/dev/null
			else
				${click_command}
			fi
			#
			}
		export -f notify_on_click
		#
		#####################################
		#####################################
		#####################################
		#
		#
		#########################
		# finally create the notification...
		#
		yad --notification \
			--no-middle \
			--listen \
			--kill-parent \
			--image="${notify_icon_default}" \
			--icon-size=48 \
			--text="${notify_tooltip_default}" \
			--menu="${notify_menu}" \
			--command="bash -c notify_on_click" 0<&3 &
		#
		}
	#
	###
	#
	# notify_change <-i "[new_icon]"> <-t "[new_tooltip]"> "[good|bad]" 
	#
    notify_change()
		{
		local FUNCT_NAME="notify_change"
		local IFS=$' \t\n'
		#
		[ ${#ebg_PIPE} -eq 0 ] && break
		[ ! -e "${ebg_PIPE}" ] && break
		#
		unset new_icon
		unset new_tooltip
		#
		unset OPTIND
		while getopts ":i:t:" notify_change_function_options
			do
			case ${notify_change_function_options} in
				#
				i	) export new_icon="${OPTARG}" ;;
				t	) export new_tooltip="${OPTARG}" ;;
				#
			esac
		done
		shift $((OPTIND-1))
		#
		##############################
		#
		notify_change_how="${1}"
		#
		##############################
		#
		if [ "${notify_change_how}" = "good" -o "${notify_change_how}" = "GOOD" ]
			then
			#
			###
			[ ${#new_icon} -gt 0 ] && notify_change_icon="${new_icon}" || notify_change_icon="${notify_icon_good}"
			echo "icon:${notify_change_icon}"
			#
			[ ${#new_tooltip} -gt 0 ] && notify_change_tooltip="${new_tooltip}" || notify_change_tooltip="${notify_tooltip_good}"
			echo "tooltip:${notify_change_tooltip}"
			###
			#
		elif [ "${notify_change_how}" = "bad" -o "${notify_change_how}" = "BAD" ]
			then
			#
			###
			[ ${#new_icon} -gt 0 ] && notify_change_icon="${new_icon}" || notify_change_icon="${notify_icon_bad}"
			echo "icon:${notify_change_icon}"
			#
			[ ${#new_tooltip} -gt 0 ] && notify_change_tooltip="${new_tooltip}" || notify_change_tooltip="${notify_tooltip_bad}"
			echo "tooltip:${notify_change_tooltip}"
			###
			#
		else
			#
			return 1
			#
		fi 1> "${ebg_PIPE}"
		#
		}
	#
fi #if [ "${yad}" = "SI" ]
# notify(), notify_change()
##
#
# question()
errexit_option="NO"
if [ "${mode}" = "yad" ]
	then
	question()
		{
		local FUNCT_NAME="question"
		local IFS=$' \t\n'
		#
		set -o | grep "errexit" | grep "on" && errexit_option="YES"
		[ "${errexit_option}" = "YES" ] && set +o errexit #This because question() *does need* error codes to work...
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_yad="$(echo "${testo}" | tr -d '<>' )"
		${dialogo} --ok-label "Ok" --cancel-label "Cancel" --image="dialog-question" --title "${supertitle:-EasyBashGUI}: please confirm" --question \
			--text "$(echo -e "${testo_yad}" )" ${dimensione_finestra_1} ${dimensione_finestra_2} 2> /dev/null
		exit_code="${?}"
		#
		#exit_if_user_closes_window #(l'ho commentato altrimenti lo cattura lui, il "Cancel" ... )
		#
		OUT_STDERR="${exit_code}"
		echo "${OUT_STDERR}" 1>&2
		#
		#[ "${errexit_option}" = "YES" ] && set -o errexit # Come back to shell option (impossible 'cause "return 1" would make script exit)...
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	question()
		{
		local FUNCT_NAME="question"
		local IFS=$' \t\n'
		#
		set -o | grep "errexit" | grep "on" && errexit_option="YES"
		[ "${errexit_option}" = "YES" ] && set +o errexit #This because question() *does need* error codes to work...
		#
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		export QUESTION_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: please confirm\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-question}\">
			<vbox>
				<frame>
					<pixmap xalign=\"0\">
						<input file stock=\"gtk-dialog-question\"></input>
					</pixmap>
					
					<text xalign=\"2\">
						<label>\"$(echo -e "\n\n${testo_gtkdialog}\n")\"</label>
					</text>
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=QUESTION_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		echo "${exit_code}" 1>&2
		#
		#[ "${errexit_option}" = "YES" ] && set -o errexit # Come back to shell option (impossible 'cause "return 1" would make script exit)...
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	question()
		{
		local FUNCT_NAME="question"
		local IFS=$' \t\n'
		#
		set -o | grep "errexit" | grep "on" && errexit_option="YES"
		[ "${errexit_option}" = "YES" ] && set +o errexit #This because question() *does need* error codes to work...
		#
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_kdialog="\n${testo}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n..................................................................................................."
		${dialogo} --title "${supertitle:-EasyBashGUI}: please confirm" --yesno "$(echo -e "${testo_kdialog}" )" 2> /dev/null
		exit_code="${?}"
		#
		#exit_if_user_closes_window # (l'ho commentato altrimenti lo cattura lui, il "Cancel" ... )
		#
		OUT_STDERR="${exit_code}"
		echo "${OUT_STDERR}" 1>&2
		#
		#[ "${errexit_option}" = "YES" ] && set -o errexit # Come back to shell option (impossible 'cause "return 1" would make script exit)...
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	question()
		{
		local FUNCT_NAME="question"
		local IFS=$' \t\n'
		#
		set -o | grep "errexit" | grep "on" && errexit_option="YES"
		[ "${errexit_option}" = "YES" ] && set +o errexit #This because question() *does need* error codes to work...
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_zenity="$(echo "${testo}" | tr -d '<>' )"
		${dialogo} --ok-label "Ok" --cancel-label "Cancel" --title "${supertitle:-EasyBashGUI}: please confirm" --question \
			--text "$(echo -e "${testo_zenity}" )" ${dimensione_finestra_1} ${dimensione_finestra_2} 2> /dev/null
		exit_code="${?}"
		#
		#exit_if_user_closes_window #(l'ho commentato altrimenti lo cattura lui, il "Cancel" ... )
		#
		OUT_STDERR="${exit_code}"
		echo "${OUT_STDERR}" 1>&2
		#
		#[ "${errexit_option}" = "YES" ] && set -o errexit # Come back to shell option (impossible 'cause "return 1" would make script exit)...
		return "${exit_code}"
		#
		}
else
	question()
		{
		local FUNCT_NAME="question"
		local IFS=$' \t\n'
		#
		set -o | grep "errexit" | grep "on" && errexit_option="YES"
		[ "${errexit_option}" = "YES" ] && set +o errexit #This because question() *does need* error codes to work...
		#
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ "${mode}" = "Xdialog" ]
				then
				local dimensione_finestra="${width}x${height}"
				local dimensione_finestra_1="${width}x${height}"
			fi
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			${dialogo} --title "${supertitle:-EasyBashGUI}: please confirm" ${icona_Attenzione} --yesno \
			"$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
			exit_code="${?}"
		else
			${dialogo} --stdout --ok-label "Ok" --cancel-label "Cancel" --title "${supertitle:-EasyBashGUI}: please confirm" ${icona_Attenzione} --yesno \
			"$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
			exit_code="${?}"
		fi
		#
		#exit_if_user_closes_window #(l'ho commentato altrimenti lo cattura lui, il "Cancel" ... )
		#
		OUT_STDERR="${exit_code}"
		echo "${OUT_STDERR}" 1>&2
		#
		#[ "${errexit_option}" = "YES" ] && set -o errexit # Come back to shell option (impossible 'cause "return 1" would make script exit)...
		return "${exit_code}"
		#
		}
fi
# question()
#
##
# notify_message()
[ "${mode}" = "dialog" ] && export notify_send="NO"
# notify_message <-i [icon]> "text"
if [ "${notify_send}" = "SI" ]
	then
	notify_message()
		{
		local FUNCT_NAME="notify_message"
		local IFS=$' \t\n'
		#
		unset notify_message_icon
		#
		unset OPTIND
		while getopts ":i:" notify_change_function_options
			do
			case ${notify_change_function_options} in
				#
				i	) export notify_message_icon="${OPTARG}" ;;
				#
			esac
		done
		shift $((OPTIND-1))
		#
		##############################
		#
		export notify_message_text="${@}"
		#
		##############################
		#
		notify_send_milliseconds=$(( ${notify_send_seconds} * 1000 ))
		[ ${#notify_message_icon} -gt 0 ] && : || notify_message_icon="${notify_icon_default}"
		#
		notify-send -t ${notify_send_milliseconds} -a "${supertitle:-EasyBashGUI}:" -i "${notify_message_icon}" "${notify_message_text}"
		#
		}
elif [ "${notify_send}" = "NO" ]
	then
	#
	notify_message_alt()
		{
		wait_for "\n\n${notify_message_text}\n\n\n\n(Please, install \"kdialog\" or \"notify-send\" for a nicer notification)\n\n."
		sleep ${notify_send_seconds}
		terminate_wait_for
		}
	#
	notify_message()
		{
		local FUNCT_NAME="notify_message"
		local IFS=$' \t\n'
		#
		unset notify_message_icon
		#
		unset OPTIND
		while getopts ":i:" notify_change_function_options
			do
			case ${notify_change_function_options} in
				#
				i	) export notify_message_icon="${OPTARG}" ;;
				#
			esac
		done
		shift $((OPTIND-1))
		#
		##############################
		#
		export notify_message_text="${@}"
		#
		##############################
		#
		[ ${#notify_message_icon} -gt 0 ] && : || notify_message_icon="${notify_icon_default}"
		#
		if [ "${mode}" = "dialog" ]
			then
			#
			wait_for "\n${notify_message_text}"
			sleep ${notify_send_seconds}
			terminate_wait_for
			#
		elif [ "${mode}" != "dialog" ]
			then
			if [ "${kdialog}" = 'SI' ]
				then
				#
				:
				kdialog --icon "${notify_message_icon}" --passivepopup "${supertitle:-EasyBashGUI}:\n\n${notify_message_text}" ${notify_send_seconds}
				#
			else
				#
				:
				notify_message_alt &
				#
			fi
			#
		fi
		#
		}
	#
fi # if [ "${notify_send}" = "SI" ]
# notify_message()
##
#
# message()
if [ "${mode}" = "yad" ]
	then
	message()
		{
		local FUNCT_NAME="message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_yad_pre="$(echo "${testo}" | tr -d '<>' )"
		testo_yad="$(echo "${testo_yad_pre}" | gsed s\#'&'#'&amp;'#g )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: message" --info --text "$(echo -e "${testo_yad}" )" ${dimensione_finestra_1} ${dimensione_finestra_2}
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	message()
		{
		local FUNCT_NAME="message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		export MESSAGE_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: message\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-info}\">
			<vbox>
				<frame>
					<text xalign=\"2\">
						<label>\"$(echo -e "\n\n${testo_gtkdialog}\n")\"</label>
					</text>
				</frame>
				<hbox>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=MESSAGE_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	message()
		{
		local FUNCT_NAME="message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		[ "${reset_geometry}" = "NO" ] && testo_kdialog="\n${testo}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n..................................................................................................." || testo_kdialog="${testo}"
		${dialogo} --title "${supertitle:-EasyBashGUI}: message" --msgbox "$(echo -e "${testo_kdialog}" )"
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	message()
		{
		local FUNCT_NAME="message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_zenity_pre="$(echo "${testo}" | tr -d '<>' )"
		testo_zenity="$(echo "${testo_zenity_pre}" | gsed s\#'&'#'&amp;'#g )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: message" --info --text "$(echo -e "${testo_zenity}" )" ${dimensione_finestra_1} ${dimensione_finestra_2}
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	message()
		{
		local FUNCT_NAME="message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#${dialogo} --title "${supertitle:-EasyBashGUI}: message" --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 1> >( clean )
		${dialogo} --title "${supertitle:-EasyBashGUI}: message" --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" | clean
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	message()
		{
		local FUNCT_NAME="message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		${dialogo} --title "${supertitle:-EasyBashGUI}: message" --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}"
		exit_if_user_closes_window
		#
		}
fi
# message()
#
##
#
# alert_message()
if [ "${mode}" = "yad" ]
	then
	alert_message()
		{
		local FUNCT_NAME="alert_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_yad_pre="$(echo "${testo}" | tr -d '<>' )"
		testo_yad="$(echo "${testo_yad_pre}" | gsed s\#'&'#'&amp;'#g )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: alert message" --warning --image="dialog-warning" --text "$(echo -e "${testo_yad}" )" ${dimensione_finestra_1} ${dimensione_finestra_2}
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	alert_message()
		{
		local FUNCT_NAME="alert_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		export ALERTMESSAGE_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: alert message\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-warning}\">
			<vbox>
				<frame>
					<pixmap xalign=\"0\">
						<input file stock=\"gtk-dialog-warning\"></input>
					</pixmap>
					
					<text xalign=\"2\">
						<label>\"$(echo -e "\n\n${testo_gtkdialog}\n")\"</label>
					</text>
				</frame>
				<hbox>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=ALERTMESSAGE_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	alert_message()
		{
		local FUNCT_NAME="alert_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if  [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		[ "${reset_geometry}" = "NO" ] && testo_kdialog="\n${testo}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n..................................................................................................." || testo_kdialog="${testo}"
		${dialogo} --title "${supertitle:-EasyBashGUI}: alert message" --error "$(echo -e "${testo_kdialog}" )"
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	alert_message()
		{
		local FUNCT_NAME="alert_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_zenity_pre="$(echo "${testo}" | tr -d '<>' )"
		testo_zenity="$(echo "${testo_zenity_pre}" | gsed s\#'&'#'&amp;'#g )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: alert message" --warning --text "$(echo -e "${testo_zenity}" )" ${dimensione_finestra_1} ${dimensione_finestra_2}
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	alert_message()
		{
		local FUNCT_NAME="alert_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		#${dialogo} --title "${supertitle:-EasyBashGUI}: alert message" ${icona_Attenzione} --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 1> >( clean )
		${dialogo} --title "${supertitle:-EasyBashGUI}: alert message" ${icona_Attenzione} --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" | clean
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	alert_message()
		{
		local FUNCT_NAME="alert_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		${dialogo} --title "${supertitle:-EasyBashGUI}: alert message" ${icona_Attenzione} --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}"
		exit_if_user_closes_window
		#
		}
fi
# alert_message()
#
##
#
# ok_message()
if [ "${mode}" = "yad" ]
	then
	ok_message()
		{
		local FUNCT_NAME="ok_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		testo_yad_pre="$(echo "${testo}" | tr -d '<>' )"
		testo_yad="$(echo "${testo_yad_pre}" | gsed s\#'&'#'&amp;'#g )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: ok message" --info --image="info" --text "$(echo -e "${testo_yad}" )" ${dimensione_finestra_1} ${dimensione_finestra_2}
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	ok_message()
		{
		local FUNCT_NAME="ok_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		export OKMESSAGE_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: ok message\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-info}\">
			<vbox>
				<frame>
					<pixmap xalign=\"0\">
						<input file stock=\"gtk-dialog-info\"></input>
					</pixmap>
					
					<text xalign=\"2\">
						<label>\"$(echo -e "\n\n${testo_gtkdialog}\n")\"</label>
					</text>
				</frame>
				<hbox>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=OKMESSAGE_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	ok_message()
		{
		local FUNCT_NAME="ok_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		[ "${reset_geometry}" = "NO" ] && testo_kdialog="\n${testo}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n..................................................................................................." || testo_kdialog="${testo}"
		${dialogo} --title "${supertitle:-EasyBashGUI}: ok message" --msgbox "$(echo -e "${testo_kdialog}" )"
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	ok_message()
		{
		local FUNCT_NAME="ok_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		testo_zenity_pre="$(echo "${testo}" | tr -d '<>' )"
		testo_zenity="$(echo "${testo_zenity_pre}" | gsed s\#'&'#'&amp;'#g )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: ok message" --info --text "$(echo -e "${testo_zenity}" )" ${dimensione_finestra_1} ${dimensione_finestra_2}
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	ok_message()
		{
		local FUNCT_NAME="ok_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		#${dialogo} --title "${supertitle:-EasyBashGUI}: ok message" ${icona_Ok} --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 1> >( clean )
		${dialogo} --title "${supertitle:-EasyBashGUI}: ok message" ${icona_Ok} --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" | clean
		exit_if_user_closes_window
		#
		}
	#
elif [ "${mode}" = "dialog" ]
	then
	ok_message()
		{
		local FUNCT_NAME="ok_message"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		${dialogo} --title "${supertitle:-EasyBashGUI}: ok message" ${icona_Ok} --msgbox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}"
		exit_if_user_closes_window
		#
		}
fi
# ok_message()
#
##
#
# text()
if [ "${mode}" = "yad" ]
	then
	text()
		{
		local FUNCT_NAME="text"
		local IFS=$' \t\n'
		local editable="--editable"
		local window_title="editing text"
		#
		#########################################
		# Begin check for text options...
		while getopts ":w:h:F" function_option
			do
			case ${function_option} in
				#
				w	) : ;;
				h	) : ;;
				F	) editable="" ; window_title="text" ; F_param_number=$(($OPTIND - 1)) ;;
				#
			esac
		done
		#
		if [ ${#editable} -eq 0 ]
			then
			array_parameters=( $@ )
			F_param_array_number=$(( ${F_param_number} - 1 ))
			#echo "devo eliminare array_parameters[${F_param_array_number}]: ${array_parameters[${F_param_array_number}]} ..." 2>/dev/null
			unset array_parameters[${F_param_array_number}]
			#echo "ora i parametri sono: \"${array_parameters[@]}\" ..." 2>/dev/null
			set -- "${array_parameters[@]}"
		fi
		# End check for text options...
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		file="${dir_tmp}/${file_tmp}"
		#${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" --text-info ${editable} --filename <(cat - ) ${dimensione_finestra_1} ${dimensione_finestra_2} 1> "${file}" 2> /dev/null
		${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" --text-info ${editable} --listen ${dimensione_finestra_1} ${dimensione_finestra_2} \
			1> "${file}" 2> /dev/null
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${file}" )"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	text()
		{
		local FUNCT_NAME="text"
		local IFS=$' \t\n'
		export dummy_file="${dir_tmp}/${file_ignore}"
		local editable1="<edit>"
		local editable2="</edit>"
		local window_title="editing text"
		#
		#########################################
		# Begin check for text options...
		while getopts ":w:h:F" function_option
			do
			case ${function_option} in
				#
				w	) : ;;
				h	) : ;;
				F	) editable1="<text>" ; editable2="</text>" ; window_title="text" ; F_param_number=$(($OPTIND - 1)) ;;
				#
			esac
		done
		#
		if [ "${editable1}" = "<text>" ]
			then
			array_parameters=( $@ )
			F_param_array_number=$(( ${F_param_number} - 1 ))
			#echo "devo eliminare array_parameters[${F_param_array_number}]: ${array_parameters[${F_param_array_number}]} ..." 2>/dev/null
			unset array_parameters[${F_param_array_number}]
			#echo "ora i parametri sono: \"${array_parameters[@]}\" ..." 2>/dev/null
			set -- "${array_parameters[@]}"
		fi
		# End check for text options...
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		#read -d "" textStdIn ; export textStdIn ; echo "${textStdIn}" 1> "${dummy_file}"
		cat - 1> "${dummy_file}"
		#
		export TEXT_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: ${window_title}\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-info}\">
			<vbox>
				<frame>
					${editable1}
						<variable>TEXT</variable>
						<input file>\"${dummy_file}\"</input>
					${editable2}
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		# 
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=TEXT_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		if [ "${exit_code}" = "0" ]
			then
			echo "${TEXT}" 1> "${dir_tmp}/${file_tmp}"
			#
			if [ "${window_title}" = "editing text" ]
				then
				echo "${TEXT}" 1>&2
			else
				echo 1>&2
			fi
			#
		fi
		#
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	text()
		{
		local FUNCT_NAME="text"
		local IFS=$' \t\n'
		local editable="YES"
		#
		#########################################
		# Begin check for text options...
		while getopts ":w:h:F" function_option
			do
			case ${function_option} in
				#
				w	) : ;;
				h	) : ;;
				F	) editable="NO" ; F_param_number=$(($OPTIND - 1)) ;;
				#
			esac
		done
		#
		if [ "${editable}" = "NO" ]
			then
			array_parameters=( $@ )
			F_param_array_number=$(( ${F_param_number} - 1 ))
			#echo "devo eliminare array_parameters[${F_param_array_number}]: ${array_parameters[${F_param_array_number}]} ..." 2>/dev/null
			unset array_parameters[${F_param_array_number}]
			#echo "ora i parametri sono: \"${array_parameters[@]}\" ..." 2>/dev/null
			set -- "${array_parameters[@]}"
		fi
		# End check for text options...
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		file="${dir_tmp}/${file_tmp}"
		if [ "${editable}" = "YES" ]
			then
			${dialogo} --title "${supertitle:-EasyBashGUI}: editing text" --textinputbox " " "$(cat - )" \
			1> "${file}" 2> /dev/null
			exit_if_user_closes_window
			#
			OUT_STDERR="$(0< "${file}" )"
			echo "${OUT_STDERR}" 1>&2
			#
		elif [ "${editable}" = "NO" ]
			then
			cat - 1> "${file}"
			${dialogo} --title "${supertitle:-EasyBashGUI}: text" --textbox "${file}" \
			2> /dev/null
			exit_if_user_closes_window
			#
			echo 1>&2
			#
		fi
		#
		#OUT_STDERR="$(0< "${file}" )"
		#echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	text()
		{
		local FUNCT_NAME="text"
		local IFS=$' \t\n'
		local editable="--editable"
		local window_title="editing text"
		#
		#########################################
		# Begin check for text options...
		while getopts ":w:h:F" function_option
			do
			case ${function_option} in
				#
				w	) : ;;
				h	) : ;;
				F	) editable="" ; window_title="text" ; F_param_number=$(($OPTIND - 1)) ;;
				#
			esac
		done
		#
		if [ ${#editable} -eq 0 ]
			then
			array_parameters=( $@ )
			F_param_array_number=$(( ${F_param_number} - 1 ))
			#echo "devo eliminare array_parameters[${F_param_array_number}]: ${array_parameters[${F_param_array_number}]} ..." 2>/dev/null
			unset array_parameters[${F_param_array_number}]
			#echo "ora i parametri sono: \"${array_parameters[@]}\" ..." 2>/dev/null
			set -- "${array_parameters[@]}"
		fi
		# End check for text options...
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		file="${dir_tmp}/${file_tmp}"
		#${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" --text-info ${editable} --filename <(cat - ) ${dimensione_finestra_1} ${dimensione_finestra_2} 1> "${file}" 2> /dev/null
		${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" --text-info ${editable} ${dimensione_finestra_1} ${dimensione_finestra_2} \
			1> "${file}" 2> /dev/null
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${file}" )"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "Xdialog" ]
	then
	text()
		{
		local FUNCT_NAME="text"
		local IFS=$' \t\n'
		local widget_type="--editbox"
		local window_title="editing text"
		#
		#########################################
		# Begin check for text options...
		while getopts ":w:h:F" function_option
			do
			case ${function_option} in
				#
				w	) : ;;
				h	) : ;;
				F	) widget_type="--textbox" ; window_title="text" ; F_param_number=$(($OPTIND - 1)) ;;
				#
			esac
		done
		#
		if [ "${widget_type}" = "--textbox" ]
			then
			array_parameters=( $@ )
			F_param_array_number=$(( ${F_param_number} - 1 ))
			#echo "devo eliminare array_parameters[${F_param_array_number}]: ${array_parameters[${F_param_array_number}]} ..." 2>/dev/null
			unset array_parameters[${F_param_array_number}]
			#echo "ora i parametri sono: \"${array_parameters[@]}\" ..." 2>/dev/null
			set -- "${array_parameters[@]}"
		fi
		# End check for text options...
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		file="${dir_tmp}/${file_tmp}"
		#
		${dialogo} --stdout --title "${supertitle:-EasyBashGUI}: ${window_title}" ${icona_Ok} ${widget_type} "-" "${dimensione_finestra_1}" "${dimensione_finestra_2}" \
		1> "${file}" 2> /dev/null
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${file}" )"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "dialog" ]
	then
	text()
		{
		local FUNCT_NAME="text"
		local IFS=$' \t\n'
		local editable="--editable"
		local window_title="text"
		#
		#########################################
		# Begin check for text options...
		while getopts ":w:h:F" function_option
			do
			case ${function_option} in
				#
				w	) : ;;
				h	) : ;;
				F	) editable="" ; window_title="text" ; F_param_number=$(($OPTIND - 1)) ;;
				#
			esac
		done
		#
		if [ ${#editable} -eq 0 ]
			then
			array_parameters=( $@ )
			F_param_array_number=$(( ${F_param_number} - 1 ))
			#echo "devo eliminare array_parameters[${F_param_array_number}]: ${array_parameters[${F_param_array_number}]} ..." 2>/dev/null
			unset array_parameters[${F_param_array_number}]
			#echo "ora i parametri sono: \"${array_parameters[@]}\" ..." 2>/dev/null
			set -- "${array_parameters[@]}"
		fi
		# End check for text options...
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		file="${dir_tmp}/${file_tmp}"
		dimensione_finestra_1=0
		dimensione_finestra_2=0
		cat - 1> "${dir_tmp}/${file_tmp}"
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title} (select OK by arrows)" ${icona_Ok} --textbox "${file}" --scrolltext "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
		else
			${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" ${icona_Ok} --textbox "${file}" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
		fi
		#
		exit_if_user_closes_window
		#
		if [ "${editable}" = "--editable" ]
			then
			OUT_STDERR="$(0< "${file}" )"
			echo "${OUT_STDERR}" 1>&2
		else
			echo 1>&2
		fi
		#
		}
fi
# text()
#
##
#
# wait_seconds()
if [ "${mode}" = "yad" ]
	then
	wait_seconds()
		{
		local FUNCT_NAME="wait_seconds"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		num_secondi=${1}
		#
		${dialogo} --title "$(basename "${0}" ): please wait" --info --text "Please wait..." ${dimensione_finestra} --timeout ${num_secondi} --timeout-indicator="right" ; [ ${?} -eq 70 ] && :
		#
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	wait_seconds()
		{
		local FUNCT_NAME="wait_seconds"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		secondi="${1}"
		export WAITSECONDS_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: please wait\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-warning}\">
			<vbox>
				<frame>
					<pixmap xalign=\"0\">
						<input file stock=\"gtk-dialog-warning\"></input>
					</pixmap>
					
					<text>
						<label>Please wait...</label>
					</text>
					<progressbar visible=\"false\">
						<input>echo 0; sleep ${secondi} ; echo 100</input>
						<action type=\"exit\">Ready</action>
					</progressbar>
				</frame>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=WAITSECONDS_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT:-unset}" = "abort" ] && exit 255
		#
		##
		#
		#[ "${EXIT}" = "OK" ] && exit_code="0"
		#[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		#return "${exit_code}"
		return "0"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	wait_seconds()
		{
		local FUNCT_NAME="wait_seconds"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		num_secondi=${1}
		#
		local dialogo="kdialog"
		${dialogo} --title "${supertitle:-EasyBashGUI}: please wait" --passivepopup "  Please wait..." \
			${num_secondi}
		#exit_if_user_closes_window
		[ $(( ${num_secondi} - 2 )) -gt 0 ] && sleep $(( ${num_secondi} - 2 ))
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	wait_seconds()
		{
		local FUNCT_NAME="wait_seconds"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		num_secondi=${1}
		#
		yes | ${dialogo} --title "${supertitle:-EasyBashGUI}: please wait" --progress --pulsate --auto-kill --text "Please wait..." ${dimensione_finestra} \
			--timeout ${num_secondi}
		#
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	wait_seconds()
		{
		local FUNCT_NAME="wait_seconds"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		num_secondi=${1}
		#
		num_milli_secondi=$(( ${num_secondi} * 1000 ))
		#
		#${dialogo} ${no_buttons} --title "${supertitle:-EasyBashGUI}: please wait" ${icona_Attenzione} --infobox "Please wait..." ${dimensione_finestra} ${num_milli_secondi} 1> >( clean )
		${dialogo} ${no_buttons} --title "${supertitle:-EasyBashGUI}: please wait" ${icona_Attenzione} --infobox "Please wait..." ${dimensione_finestra} \
			${num_milli_secondi} | clean
		exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	wait_seconds()
		{
		local FUNCT_NAME="wait_seconds"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		num_secondi=${1}
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			clear
			echo -e "\n\n################################################\n################################################\n\n\tPlease wait...\n\n################################################\n################################################\n"
		fi
		${dialogo} ${no_buttons} --title "${supertitle:-EasyBashGUI}: please wait" ${icona_Attenzione} --infobox "Please wait..." "${dimensione_finestra_1}" "${dimensione_finestra_2}"
		exit_if_user_closes_window
		sleep ${num_secondi}
		#
		}
fi
# wait_seconds()
#
##
#
# wait_for()
if [ "${mode}" = "yad" ]
	then
	wait_for()
		{
		local FUNCT_NAME="wait_for"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		testo_yad="$(echo "${testo}" | tr -d '<>' )"
		#
		yess() { while : ; do echo 'y' ; sleep 0.1 ; done ; }
		#yes | \
		yess | \
			${dialogo} --title "${supertitle:-EasyBashGUI}: please wait" --progress --pulsate --auto-kill --text "$(echo -e "${testo_yad}" )" ${dimensione_finestra} &>/dev/null &
		#
		export wait_for__PID="${!}"
		#
		OUT_STDERR="${wait_for__PID}"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	wait_for()
		{
		local FUNCT_NAME="wait_for"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		#
		export WAITFOR_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: please wait\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-warning}\">
			<vbox>
				<frame>
					<pixmap xalign=\"0\">
						<input file stock=\"gtk-dialog-warning\"></input>
					</pixmap>
					
					<text xalign=\"2\">
						<label>\"$(echo -e "${testo_gtkdialog}")\"</label>
					</text>
				</frame>
			</vbox>
		</window>
		"
		#
		yes | \
			${dialogo} --program=WAITFOR_DIALOG 2> /dev/null &
		export wait_for__PID="${!}"
		#
		OUT_STDERR="${wait_for__PID}"
		echo "${OUT_STDERR}" 1>&2
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		#
		##
		#
		#[ "${EXIT}" = "OK" ] && exit_code="0"
		#[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		#return "${exit_code}"
		return "0"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	wait_for()
		{
		local FUNCT_NAME="wait_for"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		num_secondi=3
		#testo_kdialog="\n${testo}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n..................................................................................................."
		testo_kdialog="${testo}"
		# ${dialogo} NON si puo' usare qui...
		yes | \
			{ 
			while read dummy_var
				do
				local dialogo="kdialog"
				${dialogo} --title "${supertitle:-EasyBashGUI}: please wait" --passivepopup "$(echo -e " ${testo_kdialog}" )" "${num_secondi}"
				sleep 15
			done
			sleep 1
			} &>/dev/null &
		#
		export wait_for__PID="${!}"
		#
		OUT_STDERR="${wait_for__PID}"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	wait_for()
		{
		local FUNCT_NAME="wait_for"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		testo_zenity="$(echo "${testo}" | tr -d '<>' )"
		yes | \
			${dialogo} --title "${supertitle:-EasyBashGUI}: please wait" --progress --pulsate --auto-kill --text "$(echo -e "${testo_zenity}" )" ${dimensione_finestra} &>/dev/null &
		#
		export wait_for__PID="${!}"
		#
		OUT_STDERR="${wait_for__PID}"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	wait_for()
		{
		local FUNCT_NAME="wait_for"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		yes | \
			${dialogo} ${no_buttons} --title "${supertitle:-EasyBashGUI}: please wait" ${icona_Attenzione} --infobox "$(echo -e "${testo}" )" ${dimensione_finestra} 0 &>/dev/null &
		#
		export wait_for__PID="${!}"
		#
		OUT_STDERR="${wait_for__PID}"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	wait_for()
		{
		local FUNCT_NAME="wait_for"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${@}"
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			clear
			echo -e "\n\n################################################\n################################################\n\n\t$(echo -e "${testo}" )\n\n################################################\n################################################\n"
		fi
		num_secondi=1972
		${dialogo} ${no_buttons} --title "${supertitle:-EasyBashGUI}: please wait" ${icona_Attenzione} --infobox "$(echo -e "${testo}" )" "${dimensione_finestra_1}" "${dimensione_finestra_2}" ; exit_if_user_closes_window
		#
		sleep "${num_secondi}" &
		#
		export wait_for__PID="${!}"
		#
		OUT_STDERR="${wait_for__PID}"
		echo "${OUT_STDERR}" 1>&2
		#
		}
fi
# wait_for()
#
##
#
terminate_wait_for()
	{
	local FUNCT_NAME="terminate_wait_for"
	local IFS=$' \t\n'
	#
	[ ${#} -gt 0 ] && wait_for__PID="${1}"
	[ ${#wait_for__PID} -gt 0 ] && kill "${wait_for__PID}"
	}
#
##
#
# fselect()
if [ "${mode}" = "yad" ]
	then
	fselect()
		{
		local FUNCT_NAME="fselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		[ $(yad --help | grep "\-\-file\-selection" | wc -c ) -gt 0 ] && fselect="--file-selection" || fselect="--file"
		#
		dim_finestra="${dimensione_finestra}"
		eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} --filename \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	fselect()
		{
		local FUNCT_NAME="fselect"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		init_dir="${@}" ; [ ${#init_dir} -eq 0 ] && init_dir="${HOME}"
		export FSELECT_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: file select\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-question}\">
			<vbox>
				<frame>
					<chooser>
						<default>\"${init_dir}\"</default>
						<height>\"${height}\"</height><width>\"${width}\"</width>
						<variable>FILESELECTED</variable>
					</chooser>
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=FSELECT_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0" && echo "${FILESELECTED}" 1> "${dir_tmp}/${file_tmp}"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	fselect()
		{
		local FUNCT_NAME="fselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		fselect="--getopenfilename"
		:
		eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} \"${dir}\" 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	fselect()
		{
		local FUNCT_NAME="fselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		fselect="--file-selection"
		dim_finestra="${dimensione_finestra}"
		eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} --filename \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	fselect()
		{
		local FUNCT_NAME="fselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		fselect="--fselect"
		dim_finestra="${dimensione_finestra}"
		eval ${dialogo} --stdout --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	fselect()
		{
		local FUNCT_NAME="fselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		dim=13
		dim_finestra="\"${dim}\" \"${dimensione_finestra_2}\""
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			#
			cd "${dir}"
			while :
				do
				#
				######################################
				local IFS=$'\n'
					args=( ".." 
						$(for element in $(find "${PWD}" -maxdepth 1 -type d | grep -v '~' )
							do
							echo "${element}/" | tr -s '/' | grep -v "^${PWD}/$"
						done | sort ) 
						$(for element in $(find "${PWD}" -maxdepth 1 -type f | grep -v '~' )
							do
							echo "${element}"
						done | sort ) 
						)
				local IFS=$' \t\n'
				: args[@]
				#
				#
				local IFS=$'\n'
					dimensione_menu=$(if [ ${#args[@]} -le 17 ]; then echo ${#args[@]}; else echo 17; fi )
					[ ${dimensione_menu} -eq 6 ] && dimensione_menu=5
					parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
							do
							echo -ne "\"${args[${index}]}\" - "
						done )"
				local IFS=$' \t\n'
				#
				##
				#
				fselect="--menu"
				eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} \"file select\" ${dim_finestra} ${dimensione_menu} ${parametri} 2> "${dir_tmp}/${file_tmp}"
				exit_if_user_closes_window
				######################################
				#
				menu_choice="$(0< "${dir_tmp}/${file_tmp}" )"
				if [[ ${menu_choice} = .. ]]
					then
					cd ..
				elif [[ ${menu_choice} = */ ]]
					then
					cd "${menu_choice}"
				else
					break
				fi
				#
			done && cd "${dir}"
			#
		else
			#
			fselect="--fselect"
			eval ${dialogo} --stdout --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
			exit_if_user_closes_window
			#
		fi
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
fi
# fselect()
#
##
#
# dselect()
if [ "${mode}" = "yad" ]
	then
	dselect()
		{
		local FUNCT_NAME="dselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		[ $(yad --help | grep "\-\-file\-selection" | wc -c ) -gt 0 ] && dselect="--file-selection --directory" || dselect="--file --directory"
		#
		dim_finestra="${dimensione_finestra}"
		eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} --filename \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	dselect()
		{
		local FUNCT_NAME="dselect"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		init_dir="${@}" ; [ ${#init_dir} -eq 0 ] && init_dir="${HOME}"
		export DSELECT_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: dir. select\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-question}\">
			<vbox>
				<frame>
					<chooser>
						<default>\"${init_dir}\"</default>
						<height>\"${height}\"</height><width>\"${width}\"</width>
						<variable>DIRSELECTED</variable>
					</chooser>
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=DSELECT_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0" && echo "${DIRSELECTED}" 1> "${dir_tmp}/${file_tmp}"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	dselect()
		{
		local FUNCT_NAME="dselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		dselect="--getexistingdirectory"
		:
		eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} \"${dir}\" 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	dselect()
		{
		local FUNCT_NAME="dselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		dselect="--file-selection --directory"
		dim_finestra="${dimensione_finestra}"
		eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} --filename \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	dselect()
		{
		local FUNCT_NAME="dselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		dselect="--dselect"
		dim_finestra="${dimensione_finestra}"
		eval ${dialogo} --stdout --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	dselect()
		{
		local FUNCT_NAME="dselect"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		if [ ${#} -gt 0 ]
			then
			dir="${1}"
		else
			dir="${HOME}/"
		fi
		#
		dim=13
		dim_finestra="\"${dim}\" \"${dimensione_finestra_2}\""
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			#
			cd "${dir}"
			while :
				do
				#
				######################################
				local IFS=$'\n'
					args=( ".." 
						$(for element in $(find "${PWD}" -maxdepth 1 -type d | grep -v '~' )
							do
							echo "${element}/" | tr -s '/'
						done | sort )
						)
				local IFS=$' \t\n'
				: args[@]
				#
				#
				local IFS=$'\n'
					dimensione_menu=$(if [ ${#args[@]} -le 17 ]; then echo ${#args[@]}; else echo 17; fi )
					[ ${dimensione_menu} -eq 6 ] && dimensione_menu=5
					parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
							do
							echo -ne "\"${args[${index}]}\" - "
						done )"
				local IFS=$' \t\n'
				#
				##
				#
				dselect="--menu"
				eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} \"dir. select\" ${dim_finestra} ${dimensione_menu} ${parametri} 2> "${dir_tmp}/${file_tmp}"
				exit_if_user_closes_window
				######################################
				#
				menu_choice="$(0< "${dir_tmp}/${file_tmp}" )"
				if [[ ${menu_choice} = .. ]]
					then
					cd ..
				elif [[ ${menu_choice} = ${PWD}/ ]]
					then
					break
				else
					cd "${menu_choice}"
				fi
				#
			done && cd "${dir}"
			#
		else
			#
			dselect="--fselect"
			eval ${dialogo} --stdout --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
			exit_if_user_closes_window
			#
		fi
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
fi
# deselect()
#
##
#
# menu()
if [ "${mode}" = "yad" ]
	then
	menu()
		{
		local FUNCT_NAME="menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset args
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		#
		local IFS=$'\n'
			stdout=""
			text="--text"
			column="--column\t\" \""
			dimensione_menu=""
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					arg_pre="${args[${index}]}"
					first_char="${arg_pre:0:1}"
					#
					if [ "${first_char}" = "-" ]
						then
						arg="${arg_pre:1}"
					else
						arg="${arg_pre}"
					fi
					#
					echo -ne "\"${arg}\"\t" | gsed s\#'<'#'{--|'#g | gsed s\#'>'#'|--}'#g
				done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t--no-headers\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t--separator=''\t${column}\t${parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			scelta="$(echo "${scelta}" | gsed s\#'{--|'#'<'#g | gsed s\#'|--}'#'>'#g )"
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	menu()
		{
		local FUNCT_NAME="menu"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		unset args
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}" | tr '"' "'"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		#
		local IFS=$'\n'
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					echo -e "<item>\"${args[${index}]}\"</item>"
				done )"
		local IFS=$' \t\n'
		#
		export MENU_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: Select option...\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-question}\">
			<vbox>
				<frame>
					<list>
						<variable>CHOICE</variable>
						${parametri}
					</list>
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=MENU_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0" && \
			echo "${CHOICE}" 1> "${dir_tmp}/${file_tmp}" && echo "${CHOICE}" 1>&2
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	menu()
		{
		local FUNCT_NAME="menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset args
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		#
		local IFS=$'\n'
			stdout=""
			text=""
			column=""
			dimensione_menu=""
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					echo -ne "\"${args[${index}]}\"\t\"${args[${index}]}\"\t"
				done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	menu()
		{
		local FUNCT_NAME="menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset args
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		#
		local IFS=$'\n'
			stdout=""
			text="--text"
			column="--column\t\" \""
			dimensione_menu=""
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					arg_pre="${args[${index}]}"
					first_char="${arg_pre:0:1}"
					#
					if [ "${first_char}" = "-" ]
						then
						arg="${arg_pre:1}"
					else
						arg="${arg_pre}"
					fi
					#
					echo -ne "\"${arg}\"\t"
				done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	menu()
		{
		local FUNCT_NAME="menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset args
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		#
		local IFS=$'\n'
			stdout="--stdout"
			text=""
			column=""
			dimensione_menu=0
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					echo -ne "\"${args[${index}]}\"\t\"${args[${index}]}\"\t"
				done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	menu()
		{
		local FUNCT_NAME="menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		unset args
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		#
		local IFS=$'\n'
			stdout="--stdout"
			text=""
			column=""
			dimensione_menu=$(if [ ${#args[@]} -le 17 ]; then echo ${#args[@]}; else echo 17; fi )
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					echo -ne "$(( ${index} + 1 ))\t\"${args[${index}]}\"\t"
				done )"
		local IFS=$' \t\n'
		#
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			dim=13
			dim_finestra="\"${dim}\" \"${dimensione_finestra_2}\""
			#
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					echo -en "\"${args[${index}]}\" - "
				done )"
			#echo "eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: menu\" --menu \"Select option...\" ${dim_finestra} ${dimensione_menu} ${parametri}"
			[ ${dimensione_menu} -eq 6 ] && dimensione_menu=5
			eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: menu\" --menu \"Select option...\" ${dim_finestra} ${dimensione_menu} ${parametri} 2> "${dir_tmp}/${file_tmp}"
			exit_if_user_closes_window
			#
			scelta="$(0< "${dir_tmp}/${file_tmp}" )"
			#
		else
			local IFS=$'\t\n'
				scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
				if [ "${dialogo}" = "dialog" ]
					then
					if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
						then
						indice_capisci_a_me=$(( ${scelta} - 1 ))
						scelta="${args[${indice_capisci_a_me}]}"
					fi
				fi
				#
				####
				#######
				echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
				#######
				####
				#
			local IFS=$' \t\n'
		fi
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
fi
# menu()
#
##
#
# tagged_menu()
if [ "${mode}" = "yad" ]
	then
	tagged_menu()
		{
		local FUNCT_NAME="tagged_menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset tagged_tags
		unset tagged_args
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				tagged_tags[${array_index}]="${1}"
				tagged_args[${array_index}]="${2}"
				#
				shift ; shift
			done
				
		local IFS=$' \t\n'
		: tagged_tags[@]
		: tagged_args[@]
		#
		#
		local IFS=$'\n'
			stdout=""
			text="--text"
			tagged_mode_options="--hide-column=1\t--print-column=1"
			column="--column\t\" \""
			dimensione_menu=""
			tagged_parametri="$(for (( index=0 ; index < ${#tagged_args[@]} ; index++ ))
						do
						echo -ne "\"${tagged_tags[${index}]}\"\t"
						#
						arg_pre="${tagged_args[${index}]}"
						first_char="${arg_pre:0:1}"
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_pre:1}"
						else
							arg="${arg_pre}"
						fi
						#
						echo -ne "\"${arg}\"\t" | gsed s\#'<'#'{--|'#g | gsed s\#'>'#'|--}'#g
					done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t--no-headers\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t--separator=''\t${column}\t${column}\t${tagged_mode_options}\t${tagged_parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${tagged_args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			scelta="$(echo "${scelta}" | gsed s\#'{--|'#'<'#g | gsed s\#'|--}'#'>'#g )"
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	tagged_menu()
		{
		local FUNCT_NAME="tagged_menu"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		unset tagged_tags
		unset tagged_args
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				tagged_tags[${array_index}]="${1}"
				tagged_args[${array_index}]="${2}"
				#
				shift ; shift
			done
				
		local IFS=$' \t\n'
		: tagged_tags[@]
		: tagged_args[@]
		#
		#
		local IFS=$'\n'
			tagged_parametri="$(for (( index=0 ; index < ${#tagged_args[@]} ; index++ ))
						do
						echo -e "<item>\"$(( ${index} + 1 ))) ${tagged_args[${index}]}\"</item>"
					done )"
		local IFS=$' \t\n'
		#
		export MENU_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: Select option...\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-question}\">
			<vbox>
				<frame>
					<list>
						<variable>CHOICE</variable>
						${tagged_parametri}
					</list>
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=MENU_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		scelta="$(echo "${CHOICE}" | cut -d ')' -f 1 )"
		indice_capisci_a_me=$(( ${scelta} - 1 ))
		scelta="${tagged_tags[${indice_capisci_a_me}]}"
		#
		[ "${EXIT}" = "OK" ] && exit_code="0" && \
			echo "${scelta}" 1> "${dir_tmp}/${file_tmp}" && echo "${scelta}" 1>&2
		#	
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	tagged_menu()
		{
		local FUNCT_NAME="tagged_menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset tagged_tags
		unset tagged_args
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				tagged_tags[${array_index}]="${1}"
				tagged_args[${array_index}]="${2}"
				#
				shift ; shift
			done
				
		local IFS=$' \t\n'
		: tagged_tags[@]
		: tagged_args[@]
		#
		#########################################
		local IFS=$'\n'
			stdout=""
			text=""
			column=""
			dimensione_menu=""
			tagged_parametri="$(for (( index=0 ; index < ${#tagged_args[@]} ; index++ ))
						do
						echo -ne "\"${tagged_tags[${index}]}\"\t\"${tagged_args[${index}]}\"\t"
					done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${tagged_parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${tagged_args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	tagged_menu()
		{
		local FUNCT_NAME="tagged_menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset tagged_tags
		unset tagged_args
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				tagged_tags[${array_index}]="${1}"
				tagged_args[${array_index}]="${2}"
				#
				shift ; shift
			done
				
		local IFS=$' \t\n'
		: tagged_tags[@]
		: tagged_args[@]
		#
		#
		local IFS=$'\n'
			stdout=""
			text="--text"
			tagged_mode_options="--hide-column=1\t--print-column=1"
			column="--column\t\" \""
			dimensione_menu=""
			tagged_parametri="$(for (( index=0 ; index < ${#tagged_args[@]} ; index++ ))
						do
						echo -ne "\"${tagged_tags[${index}]}\"\t"
						#
						arg_pre="${tagged_args[${index}]}"
						first_char="${arg_pre:0:1}"
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_pre:1}"
						else
							arg="${arg_pre}"
						fi
						#
						echo -ne "\"${arg}\"\t"
					done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t--separator=''\t${column}\t${column}\t${tagged_mode_options}\t${tagged_parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${tagged_args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	tagged_menu()
		{
		local FUNCT_NAME="tagged_menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		unset tagged_tags
		unset tagged_args
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				tagged_tags[${array_index}]="${1}"
				tagged_args[${array_index}]="${2}"
				#
				shift ; shift
			done
				
		local IFS=$' \t\n'
		: tagged_tags[@]
		: tagged_args[@]
		#
		#########################################
		#
		local IFS=$'\n'
			stdout="--stdout"
			text=""
			column=""
			dimensione_menu=0
			tagged_parametri="$(for (( index=0 ; index < ${#tagged_args[@]} ; index++ ))
						do
						echo -ne "\"${tagged_tags[${index}]}\"\t\"${tagged_args[${index}]}\"\t"
					done )"
		local IFS=$' \t\n'
		#
		#
		local IFS=$'\t\n'
			scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${tagged_parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
			if [ "${dialogo}" = "dialog" ]
				then
				if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
					then
					indice_capisci_a_me=$(( ${scelta} - 1 ))
					scelta="${tagged_args[${indice_capisci_a_me}]}"
				fi
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		local IFS=$' \t\n'
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	tagged_menu()
		{
		local FUNCT_NAME="tagged_menu"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		unset tagged_tags
		unset tagged_args
		local IFS=$'\n'
			threshold=${#}
			for (( num=1,array_index=0 ; num <= ${threshold} ; num++,num++,array_index++ ))
				do
				tagged_tags[${array_index}]="${1}"
				tagged_args[${array_index}]="${2}"
				#
				shift ; shift
			done
				
		local IFS=$' \t\n'
		: tagged_tags[@]
		: tagged_args[@]
		#
		#########################################
		#
		local IFS=$'\n'
			stdout="--stdout"
			text=""
			column=""
			dimensione_menu=$(if [ ${#tagged_args[@]} -le 17 ]; then echo ${#tagged_args[@]}; else echo 17; fi )
			tagged_parametri="$(for (( index=0 ; index < ${#tagged_args[@]} ; index++ ))
						do
						echo -ne "$(( ${index} + 1 ))\t\"${tagged_args[${index}]}\"\t"
					done )"
		local IFS=$' \t\n'
		#
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			dim=13
			dim_finestra="\"${dim}\" \"${dimensione_finestra_2}\""
			#
# 			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
# 					do
# 					echo -en "\"${args[${index}]}\" - "
# 				done )"
			#echo "eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: menu\" --menu \"Select option...\" ${dim_finestra} ${dimensione_menu} ${parametri}"
			[ ${dimensione_menu} -eq 6 ] && dimensione_menu=5
			eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: menu\" --menu \"Select option...\" ${dim_finestra} ${dimensione_menu} ${tagged_parametri} 2> "${dir_tmp}/${file_tmp}"
			exit_if_user_closes_window
			scelta="$(0< "${dir_tmp}/${file_tmp}" )"
			#echo -e "\n\nparametri: ${parametri}\n\nscelta: ${scelta} ...capito?\n\n"
			#
			if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
				then
				indice_capisci_a_me=$(( ${scelta} - 1 ))
				scelta="${tagged_tags[${indice_capisci_a_me}]}"
			fi
			#
			####
			#######
			echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
			#######
			####
			#
		else
			local IFS=$'\t\n'
				scelta="$(eval $(local IFS=$'\t' ; echo -e "${dialogo}\t${stdout}\t${no_tags}\t--title\t\"${supertitle:-EasyBashGUI}: menu\"\t${menubox}\t${text}\t\"Select option...\"\t${dimensione_finestra}\t${dimensione_menu}\t${column}\t${tagged_parametri}\t2>\t/dev/null" ; local IFS=$'\t\n') )"
				if [ "${dialogo}" = "dialog" ]
					then
					if [ $(echo -n "${scelta}" | wc -c) -gt 0 ]
						then
						indice_capisci_a_me=$(( ${scelta} - 1 ))
						scelta="${tagged_tags[${indice_capisci_a_me}]}"
					fi
				fi
				#
				####
				#######
				echo "${scelta}" | grep -v "${string_to_clean}" 1> "${dir_tmp}/${file_tmp}"
				#######
				####
				#
			local IFS=$' \t\n'
		fi
		#
		if [ $(echo -n "${scelta}" | grep -v "${string_to_clean}" | wc -c) -eq 0 ]
			then
			#Vuol dire che _non ha scelto nulla_ ( cioe' HA cliccato su "Cancel" ) ...
			return 1
		else
			#Vuol dire che almeno QUALCOSA _l'ha scelta_ ( cioe' NON ha cliccato su "Cancel" ) ...
			if [ "$(echo "${scelta}" | grep -v "${string_to_clean}" )" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
				then
				:
			else
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					return 1
				fi
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
fi
# tagged_menu()
#
##
#
# list()
if [ "${mode}" = "yad" ]
	then
	list()
		{
		local FUNCT_NAME="list"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		#
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					#
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
						echo -ne "\"TRUE\" \"${arg}\" " | gsed s\#'<'#'{--|'#g | gsed s\#'>'#'|--}'#g
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
						echo -ne "\"FALSE\" \"${arg}\" " | gsed s\#'<'#'{--|'#g | gsed s\#'>'#'|--}'#g
						#
					fi #if [ "${first_char}" = "+" ]
					#
				done )"
		: parametri
		#
		#
		#dimensione_menu
		#
		scelte="$(eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: list\" --separator \"\\n\" --list --checklist --column \" \" --column \" \" --text \"Select multiple options...\" ${dimensione_finestra_1} ${dimensione_finestra_2} ${parametri} 2> /dev/null )"
		exit_code="${?}"
		#
		scelte="$(echo "${scelte}" | gsed s\#'{--|'#'<'#g | gsed s\#'|--}'#'>'#g )"
		echo -e "${scelte}" | gsed s\#'^TRUE$'#''# | gsed '/^$/d' 1> "${dir_tmp}/${file_tmp}"
		#
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		[ ${#exit_code} -gt 0 ] && return "${exit_code}"
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	list()
		{
		local FUNCT_NAME="list"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		: 1> "${dir_tmp}/${file_tmp}"
		#
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}" | tr '"' "'"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		checkboxes="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					#
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
						echo -e "<checkbox active=\"true\">"
						echo -e "<label>\"${arg}\"</label>"
						echo -e "<variable>CHECKBOX${index}</variable>"
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
						echo -e "<checkbox active=\"false\">"
						echo -e "<label>\"${arg}\"</label>"
						echo -e "<variable>CHECKBOX${index}</variable>"
						#
					fi #if [ "${first_char}" = "+" ]
					#
					echo "</checkbox>"
					#
				done )"
		: checkboxes
		#
		export LIST_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: list\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-question}\">
			<vbox>
				<frame>
					${checkboxes}
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=LIST_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#
		if [ ${exit_code} -eq 0 ]
			then
			#
			: ${args[@]}
			#
			for (( index=0 ; index < ${#args[@]} ; index++ ))
				do
				checkbox="CHECKBOX${index}"
				true_or_false="${!checkbox}"
				#
				if [ "${true_or_false}" = "true" ]
					then
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
					fi #if [ "${first_char}" = "+" ]
					echo "${arg}" 1>> "${dir_tmp}/${file_tmp}"
					echo "${arg}" 1>&2
				fi
				#
			done
		fi
		#
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	list()
		{
		local FUNCT_NAME="list"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		#
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					#
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
						echo -ne "\"${arg}\" \"${arg}\" \"on\" "
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
						echo -ne "\"${arg}\" \"${arg}\" \"off\" "
						#
					fi #if [ "${first_char}" = "+" ]
					#
				done )"
		: parametri
		#
		#
		#dimensione_menu
		#
		scelte="$(eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: list\" --separate-output --checklist \"Select multiple options...\" ${parametri} 2> /dev/null )"
		exit_code="${?}"
		echo -e "${scelte}" 1> "${dir_tmp}/${file_tmp}"
		#
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		[ ${#exit_code} -gt 0 ] && return "${exit_code}"
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	list()
		{
		local FUNCT_NAME="list"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		#
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					#
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
						echo -ne "\"TRUE\" \"${arg}\" "
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
						echo -ne "\"FALSE\" \"${arg}\" "
						#
					fi #if [ "${first_char}" = "+" ]
					#
				done )"
		: parametri
		#
		#
		#dimensione_menu
		#
		scelte="$(eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: list\" --separator \"\\n\" --list --checklist --column \" \" --column \" \" --text \"Select multiple options...\" ${dimensione_finestra_1} ${dimensione_finestra_2} ${parametri} 2> /dev/null )"
		exit_code="${?}"
		#
		echo -e "${scelte}" 1> "${dir_tmp}/${file_tmp}"
		#
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		[ ${#exit_code} -gt 0 ] && return "${exit_code}"
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	list()
		{
		local FUNCT_NAME="list"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		#
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					#
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
						echo -ne "\"${arg}\" \"${arg}\" \"on\" "
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
						echo -ne "\"${arg}\" \"${arg}\" \"off\" "
						#
					fi #if [ "${first_char}" = "+" ]
					#
				done )"
		: parametri
		#
		#
		dimensione_menu=0
		#
		scelte="$(eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: list\" --stdout --separator \"\\n\" ${no_tags} ${icona_Ok} --checklist \"Select multiple options...\" ${dimensione_finestra_1} ${dimensione_finestra_2} ${dimensione_menu} ${parametri} 2> /dev/null )"
		exit_code="${?}"
		echo -e "${scelte}" 1> "${dir_tmp}/${file_tmp}"
		#
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		[ ${#exit_code} -gt 0 ] && return "${exit_code}"
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	list()
		{
		local FUNCT_NAME="list"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		#
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
						do
						echo "${1}"
						shift
					done) )
		local IFS=$' \t\n'
		: args[@]
		#
		parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					#
					arg_prog="${args[${index}]}"
					first_char="${arg_prog:0:1}"
					#
					if [ "${first_char}" = "+" ]
						then
						arg="${arg_prog:1}"
						#
						echo -ne "\"${arg}\" \"(click on 'space' to disable)\" \"on\" "
						#
					else
						#
						if [ "${first_char}" = "-" ]
							then
							arg="${arg_prog:1}"
						else
							arg="${arg_prog}"
						fi
						#
						echo -ne "\"${arg}\" \"(click on 'space' to enable)\" \"off\" "
						#
					fi #if [ "${first_char}" = "+" ]
					#
				done )"
		: parametri
		#
		#
		dimensione_menu=$(if [ ${#args[@]} -le 17 ]; then echo ${#args[@]}; else echo 17; fi )
		#
		if [ "${dialogo}" = "whiptail --fb" ]
			then
			dim=13
			dim_finestra="\"${dim}\" \"${dimensione_finestra_2}\""
			#
			[ ${dimensione_menu} -eq 6 ] && dimensione_menu=5
			eval ${dialogo} ${separator} --title \"${supertitle:-EasyBashGUI}: list\" --checklist \"Select options...\" ${dim_finestra} ${dimensione_menu} ${parametri} 2> "${dir_tmp}/${file_tmp}"
			exit_if_user_closes_window
			#
			scelta="$(0< "${dir_tmp}/${file_tmp}" )"
			#
		else
			#
			scelte="$(eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: list\" --stdout  --separate-output ${icona_Ok} --checklist \"Select options...\" \"${dimensione_finestra_1}\" \"${dimensione_finestra_2}\" ${dimensione_menu} ${parametri} 2> /dev/null )"
			exit_code="${?}"
			#
			echo -e "${scelte}" 1> "${dir_tmp}/${file_tmp}"
			#
		fi
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		[ ${#exit_code} -gt 0 ] && return "${exit_code}"
		#
		}
fi
# list()
#
##
#
# input()
if [ "${mode}" = "yad" ]
	then
	input()
		{
		local FUNCT_NAME="input"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		quanti_campi=${1}
		: 1> "${dir_tmp}/${file_tmp}"
		#
		shift #...perche' il primo parametro e': "quanti_campi" ...
		threshold=${#}
		local IFS=$'\n'
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
					do
					echo "${1}"
					shift
				done) )
		local IFS=$' \t\n'
		#
		for (( volta=1 ; volta <= $(( ${quanti_campi} * 2 )) ; volta++,volta++ ))
			do
			#
			testo="${args[$(( ${volta} - 1 ))]}"
			parametro="${args[${volta}]}" ; [ ${#parametro} -eq 0 -a ${quanti_campi} -eq 1 ] && testo=" " && parametro="${args[$(( ${volta} - 1 ))]}"
			#
			stringa_yad="${stringa_yad}\t--field=\"${testo}\"\t\"${parametro}\""
			#
		done	
		#
		#############
		scelta="$(eval $(local IFS=$'\t' && echo -e "${dialogo}\t--title\t\"${supertitle:-EasyBashGUI}: data input\"\t--form\t${stringa_yad}\t--separator\t\"\\\n\"\t${dimensione_finestra}\t2>\t/dev/null" ) )"
		unset stringa_yad
		echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}"
		#############
		#
		if [ $(grep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ]
			then
			question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}"
			if [ "${conferma}" -eq 0 ] #"Confermato"
				then
				:
			elif [ "${conferma}" -eq 1 ] #"Non confermato"
				then
				exit
			fi
		fi
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	input()
		{
		local FUNCT_NAME="input"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		## testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		quanti_campi=${1}
		: 1> "${dir_tmp}/${file_tmp}"
		#
		shift #...perche' il primo parametro e': "quanti_campi" ...
		threshold=${#}
		local IFS=$'\n'
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
					do
					echo "${1}" | tr '"' "'"
					shift
				done) )
		local IFS=$' \t\n'
		#
		inputboxes="$(for (( index=0 ; index < ${quanti_campi} ; index++ ))
					do
					#
					array_label_index=$(( ${index} * 2 ))
					label_value="${args[${array_label_index}]}"
					#
					array_default_index=$(( ${array_label_index} + 1 ))
					default_value="${args[${array_default_index}]}" ; [ ${#default_value} -eq 0 -a ${quanti_campi} -eq 1 ] && label_value=" " && default_value="${args[${array_label_index}]}"
					#
					echo -e "<hbox>"
					echo -e "<text>"
					echo -e "<label>\"${label_value}\"</label>"
					echo -e "</text>"
					echo -e "<entry>"
					echo -e "<default>\"${default_value}\"</default>"
					echo -e "<variable>INPUT$(( ${index} + 1 ))</variable>"
					echo -e "</entry>"
					echo -e "</hbox>"
					#
				done )"
		#
		: inputboxes
		#
		export INPUT_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: data input\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-info}\">
			<vbox>
				<frame>
					${inputboxes}
				</frame>
				<hbox>
					<button cancel></button>
					<button ok></button>
				</hbox>
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=INPUT_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#
		if [ ${exit_code} -eq 0 ]
			then
			#
			for (( index=0 ; index < ${quanti_campi} ; index++ ))
				do
				#
				input_name="INPUT$(( ${index} + 1 ))"
				echo "${!input_name}" 1>> "${dir_tmp}/${file_tmp}"
				echo "${!input_name}" 1>&2
				#
			done
		fi
		#
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	input()
		{
		local FUNCT_NAME="input"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		quanti_campi=${1}
		: 1> "${dir_tmp}/${file_tmp}"
		#
		shift #...perche' il primo parametro e': "quanti_campi" ...
		threshold=${#}
		local IFS=$'\n'
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
					do
					echo "${1}"
					shift
				done) )
		local IFS=$' \t\n'
		#
		for (( volta=1 ; volta <= $(( ${quanti_campi} * 2 )) ; volta++,volta++ ))
			do
			#
			testo="${args[$(( ${volta} - 1 ))]}"
			parametro="${args[${volta}]}" ; [ ${#parametro} -eq 0 -a ${quanti_campi} -eq 1 ] && testo=" " && parametro="${args[$(( ${volta} - 1 ))]}"
			#
			#############
			scelta="$(eval $(local IFS=$'\t' && echo -e "${dialogo}\t--title\t\"${supertitle:-EasyBashGUI}: data input\"\t--inputbox\t\"${testo}\"\t\"${parametro}\"\t2>\t/dev/null" ) )"
			echo -e "${scelta}" 1>> "${dir_tmp}/${file_tmp}"
			#############
			#
			if [ $(grep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ]
				then
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					exit
				fi
			fi
			#
			exit_if_user_closes_window
			#
		done
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
	#
elif [ "${mode}" = "zenity" ]
	then
	input()
		{
		local FUNCT_NAME="input"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		quanti_campi=${1}
		: 1> "${dir_tmp}/${file_tmp}"
		#
		shift #...perche' il primo parametro e': "quanti_campi" ...
		threshold=${#}
		local IFS=$'\n'
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
					do
					echo "${1}"
					shift
				done) )
		local IFS=$' \t\n'
		#
		for (( volta=1 ; volta <= $(( ${quanti_campi} * 2 )) ; volta++,volta++ ))
			do
			#
			testo="${args[$(( ${volta} - 1 ))]}"
			parametro="${args[${volta}]}" ; [ ${#parametro} -eq 0 -a ${quanti_campi} -eq 1 ] && testo=" " && parametro="${args[$(( ${volta} - 1 ))]}"
			#
			#############
			scelta="$(eval $(local IFS=$'\t' && echo -e "${dialogo}\t--title\t\"${supertitle:-EasyBashGUI}: data input\"\t--entry\t--text\t\"${testo}\"\t${dimensione_finestra}\t--entry-text\t\"${parametro}\"\t2>\t/dev/null" ) )"
			echo -e "${scelta}" 1>> "${dir_tmp}/${file_tmp}"
			#############
			#
			if [ $(grep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ]
				then
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					exit
				fi
			fi
			#
			exit_if_user_closes_window
			#
		done
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
	#
elif [ "${mode}" = "Xdialog" ]
	then
	input()
		{
		local FUNCT_NAME="input"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		quanti_campi=${1}
		: 1> "${dir_tmp}/${file_tmp}"
		#
		shift
		local IFS=$'\n'
			threshold=${#}
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
					do
					echo "${1}"
					shift
				done) )
			parametri="$(for (( index=0 ; index < ${#args[@]} ; index++ ))
					do
					echo -ne "${args[${index}]}\t"
				done)"
		#
		if [ ${quanti_campi} -eq 1 ]
			then
			inputbox="--inputbox"
			#
			testo="${args[0]}"
			parametro="${args[1]}" ; [ ${#parametro} -eq 0 -a ${quanti_campi} -eq 1 ] && testo="Please, write data ..." && parametro="${args[0]}"
			#
			local IFS=$'\t\n'
				#
				#############
				scelta=$( ${dialogo} --stdout --separator "\\n" --title "${supertitle:-EasyBashGUI}: data input" ${inputbox} "${testo}" ${dimensione_finestra} ${parametro} 2> /dev/null | grep -v "${string_to_clean}" )
				echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}"
				#############
				#
			local IFS=$' \t\n'
			#
		elif [ ${quanti_campi} -gt 1 ]
			then
			inputbox="--${quanti_campi}inputsbox"
			#
			local IFS=$'\t\n'
				#
				#############
				scelta=$( ${dialogo} --stdout --separator "\\n" --title "${supertitle:-EasyBashGUI}: data input" ${inputbox} "Please, write data ..." ${dimensione_finestra} ${parametri} 2> /dev/null | grep -v "${string_to_clean}" )
				echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}"
				#############
				#
			local IFS=$' \t\n'
			#
		fi #if [ ${quanti_campi} -eq 1 ]
		#
		if [ $(grep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ]
			then
			question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?" ; conferma="${?}"
			if [ "${conferma}" -eq 0 ] #"Confermato"
				then
				:
			elif [ "${conferma}" -eq 1 ] #"Non confermato"
				then
				exit
			fi
		fi #if [ "${scelta}" = "$(0< "${dir_tmp}/${file_tmp}" )" ]
		#
		exit_if_user_closes_window
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	input()
		{
		local FUNCT_NAME="input"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		quanti_campi=${1}
		: 1> "${dir_tmp}/${file_tmp}"
		#
		shift #...perche' il primo parametro e': "quanti_campi" ...
		threshold=${#}
		local IFS=$'\n'
			args=( $(for (( num=1 ; num <= ${threshold} ; num++ ))
					do
					echo "${1}"
					shift
				done) )
		local IFS=$' \t\n'
		#
		for (( volta=1 ; volta <= $(( ${quanti_campi} * 2 )) ; volta++,volta++ ))
			do
			#
			testo="${args[$(( ${volta} - 1 ))]}"
			parametro="${args[${volta}]}" ; [ ${#parametro} -eq 0 -a ${quanti_campi} -eq 1 ] && testo="" && parametro="${args[$(( ${volta} - 1 ))]}"			
			#
			#############
			if [ "${dialogo}" = "whiptail --fb" ]
				then
				#
				${dialogo} ${separator} --title "${supertitle:-EasyBashGUI}: data input" --inputbox "${testo}" ${dimensione_finestra} "${parametro}" 2>> "${dir_tmp}/${file_tmp}" ; echo "" 1>> "${dir_tmp}/${file_tmp}"
				#
				scelta="$(0< "${dir_tmp}/${file_tmp}" )"
				#
			else
				#
				scelta="$(eval $(local IFS=$'\t' && echo -e "${dialogo}\t--stdout\t${separator}\t\"\\n\"\t--title\t\"${supertitle:-EasyBashGUI}: data input\"\t--inputbox\t\"${testo}\"\t${dimensione_finestra}\t\"${parametro}\"\t2>\t/dev/null" ) )"
				#
				echo -e "${scelta}" 1>> "${dir_tmp}/${file_tmp}"
				#
			fi
			#
			#############
			#
			if [ $(grep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ]
				then
				question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}"
				if [ "${conferma}" -eq 0 ] #"Confermato"
					then
					:
				elif [ "${conferma}" -eq 1 ] #"Non confermato"
					then
					exit
				fi
			fi
			#
			exit_if_user_closes_window
			#
		done
		#
		OUT_STDERR="$(0< "${dir_tmp}/${file_tmp}" )"
		echo "${OUT_STDERR}" 1>&2
		#
		}
fi
# input()
#
##
#
# progress()
if [ "${mode}" = "yad" ]
	then
	progress()
		{
		local FUNCT_NAME="progress"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		steps=100
		[ ${#} -eq 0 ] && testo="Progress" || testo="${1}"
		testo_yad="$(echo "${testo}" | tr -d '<>' )"
		testo_progress_bar=""
		#
		if [ ${#} -ge 2 ]
			then
			if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ]
				then
				# Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
				alert_message "${supertitle:-EasyBashGUI}: \n second argument \n\n must be an integer..."
				return
				#
			else
				quanti_sono_gli_elementi=$(echo -n "${2}" | tr -dc '[[:digit:]]' )
				steps=${quanti_sono_gli_elementi}
				testo_progress_bar="(${steps} steps to go)"
				#
				if [ ${quanti_sono_gli_elementi} -eq 0 ]
					then
					alert_message "${supertitle:-EasyBashGUI}: \n this progress \n\n \"${testo_yad}\" \n\n has 0 elements..."
					return
				fi
				#
				percentuale_di_1_elemento_sul_totale_degli_elementi=$(echo "scale=10; 100 / ${quanti_sono_gli_elementi}" | bc -l)
				if [ $(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 1 | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
					then
					secondo_numero=$(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 2)
					percentuale_di_1_elemento_sul_totale_degli_elementi="0.${secondo_numero}"
				fi
				#
			fi #if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ] # Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
			#
		fi #if [ ${#} -ge 2 ]
		#
		#
		{
		declare -i index=0
		while read standard_input
			do
			if [ "${standard_input}" = "PROGRESS" ]
				then
				index=$(( ${index} + 1 ))
				percentuale=$(echo "scale=10; ${index} * ${percentuale_di_1_elemento_sul_totale_degli_elementi}" | bc -l )
				[ "X${percentuale%%.*}" = "X" ] && secondo_numero=${percentuale_di_1_elemento_sul_totale_degli_elementi##*.} && percentuale="0.${secondo_numero}"
				#
				echo "${percentuale}"
				#
			else
				#
				echo "${standard_input}"
				#
			fi
		done
		echo 100
		sleep 1 
		} | \
		\
		${dialogo} --title "${supertitle:-EasyBashGUI}: progress" ${progress} --text "${testo_yad}" --progress-text="${testo_progress_bar}" ${dimensione_finestra_1} ${dimensione_finestra_2} \
			--auto-close --auto-kill
		#exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	progress()
		{
		local FUNCT_NAME="progress"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		steps=100
		[ ${#} -eq 0 ] && testo="Progress" || testo="${1}"
		#
		if [ ${#} -ge 2 ]
			then
			if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ]
				then
				# Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
				alert_message "${supertitle:-EasyBashGUI}: \n second argument \n\n must be an integer..."
				return
				#
			else
				quanti_sono_gli_elementi=$(echo -n "${2}" | tr -dc '[[:digit:]]' )
				steps=${quanti_sono_gli_elementi}
				#
				if [ ${quanti_sono_gli_elementi} -eq 0 ]
					then
					alert_message "${supertitle:-EasyBashGUI}: \n this progress \n\n \"${testo}\" \n\n has 0 elements..."
					return
				fi
				#
				percentuale_di_1_elemento_sul_totale_degli_elementi=$(echo "scale=10; 100 / ${quanti_sono_gli_elementi}" | bc -l)
				if [ $(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 1 | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
					then
					secondo_numero=$(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 2)
					percentuale_di_1_elemento_sul_totale_degli_elementi="0.${secondo_numero}"
				fi
				#
			fi #if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ] # Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
			#
		fi #if [ ${#} -ge 2 ]
		#
		#
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		export PROGRESS_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: progress\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-info}\">
			<vbox>
				<frame>
					<pixmap xalign=\"0\">
						<input file stock=\"gtk-dialog-info\"></input>
					</pixmap>
					
					<text xalign=\"2\">
						<label>\"$(echo -e "\n\n${testo_gtkdialog}\n\n")\"</label>
					</text>
					
					<progressbar>
						<input>while read riga; do echo \$riga ; done</input>
						<action type=\"exit\">Ready</action>
					</progressbar>

				</frame>
				
			</vbox>
		</window>
		"
		#
		#
		local IFS=""
		for DICHIARAZIONI in $(
					{
					declare -i index=0
					while read standard_input
						do
						if [ "${standard_input}" = "PROGRESS" ]
							then
							index=$(( ${index} + 1 ))
							percentuale=$(echo "scale=10; ${index} * ${percentuale_di_1_elemento_sul_totale_degli_elementi}" | bc -l )
							[ "X${percentuale%%.*}" = "X" ] && secondo_numero=${percentuale_di_1_elemento_sul_totale_degli_elementi##*.} && percentuale="0.${secondo_numero}"
							#
							echo "${percentuale}"
							#
						else
							#
							echo "${standard_input}"
							#
						fi
					done
					echo 100
					#sleep 1 
					} | ${dialogo} --program=PROGRESS_DIALOG 2> /dev/null 
					)
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var., it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	progress()
		{
		local FUNCT_NAME="progress"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		steps=100
		[ ${#} -eq 0 ] && testo="Progress" || testo="${1}"
		#
		if [ ${#} -ge 2 ]
			then
			if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ]
				then
				# Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
				alert_message "${supertitle:-EasyBashGUI}: \n second argument \n\n must be an integer..."
				return
				#
			else
				quanti_sono_gli_elementi=$(echo -n "${2}" | tr -dc '[[:digit:]]' )
				steps=${quanti_sono_gli_elementi}
				#
				if [ ${quanti_sono_gli_elementi} -eq 0 ]
					then
					alert_message "${supertitle:-EasyBashGUI}: \n this progress \n\n \"${testo}\" \n\n has 0 elements..."
					return
				fi
				#
				percentuale_di_1_elemento_sul_totale_degli_elementi=$(echo "scale=10; 100 / ${quanti_sono_gli_elementi}" | bc -l)
				if [ $(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 1 | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
					then
					secondo_numero=$(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 2)
					percentuale_di_1_elemento_sul_totale_degli_elementi="0.${secondo_numero}"
				fi
				#
			fi #if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ] # Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
			#
		fi #if [ ${#} -ge 2 ]
		#
		qdbus_or_dcop="$(if [ $(echo -n "$(type qdbus 2>/dev/null)" | wc -c ) -gt 0 ]
					then
					echo "qdbus" 
				else
					echo "dcop"
				fi )"
		#
		# Creazione della finestra...
		progress_var="$(${dialogo} --title "${supertitle:-EasyBashGUI}" ${progress} "$(echo -e "${testo}" )" ${steps} )" ; ${qdbus_or_dcop} ${progress_var} showCancelButton "true"
		#
		# Loop dei valori...
		conteggio=0
		until [ "$(${qdbus_or_dcop} ${progress_var} wasCancelled )" = "true" ]
			do
			# Leggi lo StdIn...		
			read standard_input
			if [ "${standard_input}" = "PROGRESS" ]
				then
				#
				conteggio=$(( ${conteggio} + 1 ))
				#
			else
				#
				conteggio="${standard_input%%.*}"
				#
			fi
			#
			# Setta la barra...
			if [ "${qdbus_or_dcop}" = "qdbus" ]
				then
				${qdbus_or_dcop} ${progress_var} Set "" "value" ${conteggio} 1> /dev/null
				#
			elif [ "${qdbus_or_dcop}" = "dcop" ]
				then
				${qdbus_or_dcop} ${progress_var} setProgress ${conteggio}
				#
			fi
			#
			# Alla fine esci dal loop...
			risultato=$(echo "scale=10; ${conteggio} == ${steps}" | bc -l )
			[ ${risultato} -eq 1 ] && break
			#
		done
		sleep 1 ; ${qdbus_or_dcop} ${progress_var} close
		#exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "zenity" ]
	then
	progress()
		{
		local FUNCT_NAME="progress"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		steps=100
		[ ${#} -eq 0 ] && testo="Progress" || testo="${1}"
		testo_zenity="$(echo "${testo}" | tr -d '<>' )"
		#
		if [ ${#} -ge 2 ]
			then
			if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ]
				then
				# Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
				alert_message "${supertitle:-EasyBashGUI}: \n second argument \n\n must be an integer..."
				return
				#
			else
				quanti_sono_gli_elementi=$(echo -n "${2}" | tr -dc '[[:digit:]]' )
				steps=${quanti_sono_gli_elementi}
				#
				if [ ${quanti_sono_gli_elementi} -eq 0 ]
					then
					alert_message "${supertitle:-EasyBashGUI}: \n this progress \n\n \"${testo_zenity}\" \n\n has 0 elements..."
					return
				fi
				#
				percentuale_di_1_elemento_sul_totale_degli_elementi=$(echo "scale=10; 100 / ${quanti_sono_gli_elementi}" | bc -l)
				if [ $(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 1 | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
					then
					secondo_numero=$(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 2)
					percentuale_di_1_elemento_sul_totale_degli_elementi="0.${secondo_numero}"
				fi
				#
			fi #if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ] # Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
			#
		fi #if [ ${#} -ge 2 ]
		#
		#
		{
		declare -i index=0
		while read standard_input
			do
			if [ "${standard_input}" = "PROGRESS" ]
				then
				index=$(( ${index} + 1 ))
				percentuale=$(echo "scale=10; ${index} * ${percentuale_di_1_elemento_sul_totale_degli_elementi}" | bc -l )
				[ "X${percentuale%%.*}" = "X" ] && secondo_numero=${percentuale_di_1_elemento_sul_totale_degli_elementi##*.} && percentuale="0.${secondo_numero}"
				#
				echo "${percentuale}"
				#
			else
				#
				echo "${standard_input}"
				#
			fi
		done
		sleep 1 
		} | \
		\
		${dialogo} --title "${supertitle:-EasyBashGUI}: progress" ${progress} --text "${testo_zenity}" ${dimensione_finestra_1} ${dimensione_finestra_2} \
			--auto-close --auto-kill
		#exit_if_user_closes_window
		#
		}
elif [ "${mode}" = "Xdialog" ]
	then
	progress()
		{
		local FUNCT_NAME="progress"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		steps=100
		[ ${#} -eq 0 ] && testo="Progress" || testo="${1}"
		#
		if [ ${#} -ge 2 ]
			then
			if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ]
				then
				# Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
				alert_message "${supertitle:-EasyBashGUI}: \n second argument \n\n must be an integer..."
				return
				#
			else
				quanti_sono_gli_elementi=$(echo -n "${2}" | tr -dc '[[:digit:]]' )
				steps=${quanti_sono_gli_elementi}
				#
				if [ ${quanti_sono_gli_elementi} -eq 0 ]
					then
					alert_message "${supertitle:-EasyBashGUI}: \n this progress \n\n \"${testo}\" \n\n has 0 elements..."
					return
				fi
				#
				percentuale_di_1_elemento_sul_totale_degli_elementi=$(echo "scale=10; 100 / ${quanti_sono_gli_elementi}" | bc -l)
				if [ $(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 1 | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
					then
					secondo_numero=$(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 2)
					percentuale_di_1_elemento_sul_totale_degli_elementi="0.${secondo_numero}"
				fi
				#
			fi #if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ] # Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
			#
		fi #if [ ${#} -ge 2 ]
		#
		{
		testo_new="$(echo "${testo}" | gsed s\#'\\n'#'^'#g )"
		local IFS=$'^'
			array__testo_new=( ${testo_new} )
		local IFS=$' \t\n'
		#
		declare -i count=0
		if [ ${#array__testo_new[@]} -eq 1 ]
			then
			#
			progr_text="$(echo "\\n" ; echo "${array__testo_new[0]}" )"
			for ((count=1 ; ; count++ ))
				do
				read standard_input && \
				{
				if [ "${standard_input}" = "PROGRESS" ]
					then
					percentuale=$(echo "scale=10; ${count} * ${percentuale_di_1_elemento_sul_totale_degli_elementi}" | bc -l )
					[ "X${percentuale%%.*}" = "X" ] && secondo_numero=${percentuale_di_1_elemento_sul_totale_degli_elementi##*.} && percentuale="0.${secondo_numero}"
					#
					echo "${percentuale}"
					#
				else
					#
					echo "${standard_input}"
					#
				fi
				echo "XXX"
				echo "[Inter-process message #]: ${count} ..."
				echo "\\n"
				echo "${progr_text}"
				echo "XXX"
				} || \
				break
			done
		else
			#
			progr_text="$(for (( index=0 ; index < ${#array__testo_new[@]} ; index++ ))
					do
					echo "\\n"
					echo "${array__testo_new[${index}]}"
				done)"
			for ((count=1 ; ; count++ ))
				do
				read standard_input && \
				{
				if [ "${standard_input}" = "PROGRESS" ]
					then
					percentuale=$(echo "scale=10; ${count} * ${percentuale_di_1_elemento_sul_totale_degli_elementi}" | bc -l )
					[ "X${percentuale%%.*}" = "X" ] && secondo_numero=${percentuale_di_1_elemento_sul_totale_degli_elementi##*.} && percentuale="0.${secondo_numero}"
					#
					echo "${percentuale}"
					#
				else
					#
					echo "${standard_input}"
					#
				fi
				echo "XXX"
				echo "[Inter-process message #]: ${count} ..."
				echo "\\n"
				echo "${progr_text}"
				echo "XXX"
				} || \
				break
			done
		fi 
		sleep 1 
		} | \
		\
		${dialogo} --title "${supertitle:-EasyBashGUI}: progress" --gauge "[Inter-process message #]: <starting> ...\n\n${testo}"  "${dimensione_finestra_1}" "${dimensione_finestra_2}"
		exit_if_user_closes_window ; unset testo_new
		#
		}
elif [ "${mode}" = "dialog" ]
	then
	progress()
		{
		local FUNCT_NAME="progress"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		steps=100
		[ ${#} -eq 0 ] && testo="Progress" || testo="${1}"
		#
		if [ ${#} -ge 2 ]
			then
			if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ]
				then
				# Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
				alert_message "${supertitle:-EasyBashGUI}: \n second argument \n\n must be an integer..."
				return
				#
			else
				quanti_sono_gli_elementi=$(echo -n "${2}" | tr -dc '[[:digit:]]' )
				steps=${quanti_sono_gli_elementi}
				#
				if [ ${quanti_sono_gli_elementi} -eq 0 ]
					then
					alert_message "${supertitle:-EasyBashGUI}: \n this progress \n\n \"${testo}\" \n\n has 0 elements..."
					return
				fi
				#
				percentuale_di_1_elemento_sul_totale_degli_elementi=$(echo "scale=10; 100 / ${quanti_sono_gli_elementi}" | bc -l)
				if [ $(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 1 | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
					then
					secondo_numero=$(echo -n "${percentuale_di_1_elemento_sul_totale_degli_elementi}" | cut -d '.' -f 2)
					percentuale_di_1_elemento_sul_totale_degli_elementi="0.${secondo_numero}"
				fi
				#
			fi #if [ $(echo -n "${2}" | tr -dc '[[:digit:]]' | wc -c ) -eq 0 ] # Il secondo argomento c'e', ma NON e' formato da cifre numeriche...
			#
		fi #if [ ${#} -ge 2 ]
		#
		#
		dim=10
		{
		declare -i index=0
		while read standard_input
			do
			if [ "${standard_input}" = "PROGRESS" ]
				then
				index=$(( ${index} + 1 ))
				percentuale=$(echo "scale=10; ${index} * ${percentuale_di_1_elemento_sul_totale_degli_elementi}" | bc -l )
				[ "X${percentuale%%.*}" = "X" ] && secondo_numero=${percentuale_di_1_elemento_sul_totale_degli_elementi##*.} && percentuale="0.${secondo_numero}"
				#
				echo "${percentuale%%.*}"
				#
			else
				#
				echo "${standard_input%%.*}"
				#
			fi
		done
		sleep 1 
		} | \
		\
		${dialogo} --title "${supertitle:-EasyBashGUI}: progress" ${progress} "${testo}" "${dim}" "${dimensione_finestra_2}" "0"
		exit_if_user_closes_window
		#
		}
fi
# progress()
#
##
#
# adjust()
if [ "${mode}" = "yad" ]
	then
	adjust()
		{
		local FUNCT_NAME="adjust"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		##
		#
		testo="${1-"Please adjust parameter..."}"
		testo_yad="$(echo "${testo}" | tr -d '<>' )"
		#
		start_value=${2-"0"}
		init_value=${3-"50"}
		end_value=${4-"100"}
		#
		start_value_percent=0
		end_value_percent=100
		#
		num_tot_elementi=$(( ${end_value} - ${start_value} ))
		diff_values_percent=$(( ${end_value_percent} - ${start_value_percent} ))
		step=$(echo "scale=2; ${num_tot_elementi} / ${diff_values_percent}" | bc -l )
		# =>
		init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
		init_value_percent=$(arrotonda "${init_value_percent_float}" )
		#
		#
		${dialogo} --title "${supertitle:-EasyBashGUI}: adjust" --scale --text "${testo_yad}" --value ${init_value_percent} --min-value ${start_value_percent} --max-value ${end_value_percent} ${dimensione_finestra_1} ${dimensione_finestra_2} \
		2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		exit_code="${?}"
		#
		#
		value_percent=$(tr -dc '[[:digit:]]' 0< "${dir_tmp}/${file_tmp}" )
		: value_percent
		#
		final_value_temp=$(echo "scale=2; ${value_percent} * ${step}" | bc -l )
		final_value_float=$(echo "scale=2; ${start_value} + ${final_value_temp}" | bc -l )
		: final_value_float
		#
		final_value=$(arrotonda "${final_value_float}" )
		: final_value
		#
		echo "${final_value}" 1> "${dir_tmp}/${file_tmp}" 
		#
		#####################################################
		# Exit code check... 
		# ( Note:  for this function is better _do not_ use:
		#          "exit_if_user_closes_window" )
		uscita="${exit_code}"
		if [ ${uscita} -ne 0 ]
			then
			#clean_temp
			if [ ${uscita} -eq 1 ]
				then
				#
				#echo "Hai cliccato su \"Cancel\"..."
				#
				exit 1
				#
			elif [ ${uscita} -eq 255 ]
				then
				#
				#echo "Hai chiuso la finestra..."
				#
				exit 255
				#
			else
				if [ "${dialogo}" = "yad" -a ${uscita} -eq 70 ]
					then
					# Non far niente: sembra un codice di uscita di zenity legato al timeout?...
					:
					#
				else
					#
					#
					alert_message ":( ...Something went wrong..."
					echo -e "\n:( ...Something went wrong..." 1>&2
					#
					exit 1
					#
				fi
				#
			fi
			#
		fi
		# End exit code check... 
		#####################################################
		#
		OUT_STDERR="${final_value}"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "gtkdialog" ]
	then
	adjust()
		{
		local FUNCT_NAME="adjust"
		local IFS=$' \t\n'
		#
		#clean_temp
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		testo="${1-"Please adjust parameter..."}"
		testo_gtkdialog="$(echo "${testo}" | tr '"' "'" )"
		#
		start_value=${2-"0"}
		init_value=${3-"50"}
		end_value=${4-"100"}
		#
		start_value_percent=0
		end_value_percent=100
		#
		num_tot_elementi=$(( ${end_value} - ${start_value} ))
		diff_values_percent=$(( ${end_value_percent} - ${start_value_percent} ))
		step=$(echo "scale=2; ${num_tot_elementi} / ${diff_values_percent}" | bc -l )
		# =>
		init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
		init_value_percent=$(arrotonda "${init_value_percent_float}" )
		#
		#
		export dummy_file="${dir_tmp}/${file_tmp}"
		echo "${init_value_percent}" 1> "${dummy_file}"
		#
		functions_step=$(echo "${step}" | cut -d '.' -f 1 )
		[ ${#functions_step} -eq 0 ] && functions_step=1
		#
		export functions_file="${dir_tmp}/${file_ignore}"
		cat <<-EOB1 1> "${functions_file}"
# "adjust" functions:
export dummy_file="${dir_tmp}/${file_tmp}"
export step=${functions_step}
EOB1
		cat <<-'EOB2' 1>> "${functions_file}"
aumenta()
	{
	vecchio_valore=$(cat "${dummy_file}" )
	nuovo_valore=$(expr ${vecchio_valore} + ${step} )
	if [ ${nuovo_valore} -le 100 ]
		then
		echo "${nuovo_valore}" 1> "${dummy_file}"
	fi
	}
diminuisci()
	{
	vecchio_valore="$(cat "${dummy_file}" )"
	nuovo_valore=$(expr ${vecchio_valore} - ${step} )
	if [ ${nuovo_valore} -ge 0 ]
		then
		echo "${nuovo_valore}" 1> "${dummy_file}"
	fi
	}
EOB2
		: testo
		: dummy_file
		export ADJUST_DIALOG="
		<window title=\"${supertitle:-EasyBashGUI}: adjust\" default_height=\"${height}\" default_width=\"${width}\" window_position=\"1\" icon-name=\"${supericon:-gtk-dialog-info}\">
			<vbox>
				<frame>
					<frame>
						<hbox homogeneous=\"true\">
							<text>
								<label>\"$(echo -e "${testo_gtkdialog}" )\"</label>
							</text>
						</hbox>
					</frame>
					
					
					<frame>
						<hbox homogeneous=\"true\">
							<text>
								<input file>\"${dummy_file}\"</input>
								<variable>LIVELLO</variable>
							</text>
							
						</hbox>
						<hbox homogeneous=\"true\">
							<text>
								<label>\"(%)\"</label>
							</text>
						</hbox>
					</frame>
				
					
					
					<frame>
						<button>
							<input file icon=\"gtk-go-up\"></input>
							<action>. ${functions_file} ; aumenta</action>
							<action type=\"refresh\">LIVELLO</action>
						</button>

						<progressbar bar-style=\"0\" orientation=\"0\">
							<input>while [ -e \"${dummy_file}\" ] ; do cat \"${dummy_file}\" ; sleep 0.1; done</input>
							<action type=\"refresh\">LIVELLO</action>
						</progressbar>

						<button>
							<input file icon=\"gtk-go-down\"></input>
							<action>. \"${functions_file}\" ; diminuisci</action>
							<action type=\"refresh\">LIVELLO</action>
						</button>
					</frame>
					
				</frame>
				
				<hbox>
					<button ok></button>
				</hbox>
				
			</vbox>
		</window>
		"
		#
		local IFS=""
		for DICHIARAZIONI in $(${dialogo} --program=ADJUST_DIALOG 2> /dev/null )
			do
			eval ${DICHIARAZIONI}
		done
		local IFS=$' \t\n'
		#
		##
		#
		#exit_if_user_closes_window #(gtkdialog sets "EXIT" var.,it doesn't handle exit codes  ... )
		[ "${EXIT}" = "abort" ] && exit 255
		#
		##
		#
		[ "${EXIT}" = "OK" ] && exit_code="0"
		[ "${EXIT}" = "Cancel" ] && exit_code="1"
		#
		if [ ${exit_code} -eq 0 ]
			then
			#
			value_percent=$(tr -dc '[[:digit:]]' 0< "${dir_tmp}/${file_tmp}" )
			: value_percent
			#
			final_value_temp=$(echo "scale=2; ${value_percent} * ${step}" | bc -l )
			final_value_float=$(echo "scale=2; ${start_value} + ${final_value_temp}" | bc -l )
			: final_value_float
			#
			final_value=$(arrotonda "${final_value_float}" )
			: final_value
			#
			echo "${final_value}" 1> "${dir_tmp}/${file_tmp}" 
			echo "${final_value}" 1>&2
		else
			: 1> "${dir_tmp}/${file_tmp}"
		fi
		#echo "${exit_code}" 1>&2
		return "${exit_code}"
		#
		}
elif [ "${mode}" = "kdialog" ]
	then
	adjust()
		{
		local FUNCT_NAME="adjust"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
				then
				local x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
				local y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
			fi
			local dimensione_finestra="--geometry=${width}x${height}${x}${y}"
			local dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
			local dialogo="kdialog ${dimensione_finestra}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		##
		#
		testo="${1-"Please adjust parameter..."}"
		#
		start_value=${2-"0"}
		init_value=${3-"50"}
		end_value=${4-"100"}
		#
		start_value_percent=0
		end_value_percent=100
		#
		num_tot_elementi=$(( ${end_value} - ${start_value} ))
		diff_values_percent=$(( ${end_value_percent} - ${start_value_percent} ))
		step=$(echo "scale=2; ${num_tot_elementi} / ${diff_values_percent}" | bc -l )
		# =>
		init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
		init_value_percent=$(arrotonda "${init_value_percent_float}" )
		#
		#
		pre_values="$(for ((int1=${start_value_percent} ; int1 < ${init_value_percent} ; int1++ )); do echo -n "${int1}% " ; done )"
		post_values="$(for ((int2=${init_value_percent} ; int2 <= ${end_value_percent} ; int2++ )); do echo -n "${int2}% " ; done )"
		${dialogo} --title "${supertitle:-EasyBashGUI}: adjust" --default "${init_value_percent}%" --combobox "${testo}" ${pre_values} ${post_values} \
			2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		exit_code="${?}"
		#
		#
		value_percent=$(tr -dc '[[:digit:]]' 0< "${dir_tmp}/${file_tmp}" )
		: value_percent
		#
		final_value_temp=$(echo "scale=2; ${value_percent} * ${step}" | bc -l )
		final_value_float=$(echo "scale=2; ${start_value} + ${final_value_temp}" | bc -l )
		: final_value_float
		#
		final_value=$(arrotonda "${final_value_float}" )
		: final_value
		#
		echo "${final_value}" 1> "${dir_tmp}/${file_tmp}" 
		#
		#####################################################
		# Exit code check... 
		# ( Note:  for this function it's better _do not_ use:
		#          "exit_if_user_closes_window" )
		uscita="${exit_code}"
		if [ ${uscita} -ne 0 ]
			then
			#clean_temp
			if [ ${uscita} -eq 1 ]
				then
				#
				#echo "Hai cliccato su \"Cancel\"..."
				#
				exit 1
				#
			elif [ ${uscita} -eq 255 ]
				then
				#
				#echo "Hai chiuso la finestra..."
				#
				exit 255
				#
			else
				if [ "${dialogo}" = "zenity" -a ${uscita} -eq 5 ]
					then
					# Non far niente: sembra un codice di uscita di zenity legato ai temi...
					:
					#
				else
					#
					#
					alert_message ":( ...Something went wrong..."
					echo -e "\n:( ...Something went wrong..." 1>&2
					#
					exit 1
					#
				fi
				#
			fi
			#
		fi
		# End exit code check... 
		#####################################################
		#
		OUT_STDERR="${final_value}"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "zenity" ]
	then
	adjust()
		{
		local FUNCT_NAME="adjust"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="--width=${width} --height=${height}"
			local dimensione_finestra_1="--width=${width} --height=${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		##
		#
		testo="${1-"Please adjust parameter..."}"
		testo_zenity="$(echo "${testo}" | tr -d '<>' )"
		#
		start_value=${2-"0"}
		init_value=${3-"50"}
		end_value=${4-"100"}
		#
		start_value_percent=0
		end_value_percent=100
		#
		num_tot_elementi=$(( ${end_value} - ${start_value} ))
		diff_values_percent=$(( ${end_value_percent} - ${start_value_percent} ))
		step=$(echo "scale=2; ${num_tot_elementi} / ${diff_values_percent}" | bc -l )
		# =>
		init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
		init_value_percent=$(arrotonda "${init_value_percent_float}" )
		#
		#
		${dialogo} --title "${supertitle:-EasyBashGUI}: adjust" --scale --text "${testo_zenity}" --value ${init_value_percent} --min-value ${start_value_percent} --max-value ${end_value_percent} ${dimensione_finestra_1} ${dimensione_finestra_2} \
		2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		exit_code="${?}"
		#
		#
		value_percent=$(tr -dc '[[:digit:]]' 0< "${dir_tmp}/${file_tmp}" )
		: value_percent
		#
		final_value_temp=$(echo "scale=2; ${value_percent} * ${step}" | bc -l )
		final_value_float=$(echo "scale=2; ${start_value} + ${final_value_temp}" | bc -l )
		: final_value_float
		#
		final_value=$(arrotonda "${final_value_float}" )
		: final_value
		#
		echo "${final_value}" 1> "${dir_tmp}/${file_tmp}" 
		#
		#####################################################
		# Exit code check... 
		# ( Note:  for this function is better _do not_ use:
		#          "exit_if_user_closes_window" )
		uscita="${exit_code}"
		if [ ${uscita} -ne 0 ]
			then
			#clean_temp
			if [ ${uscita} -eq 1 ]
				then
				#
				#echo "Hai cliccato su \"Cancel\"..."
				#
				exit 1
				#
			elif [ ${uscita} -eq 255 ]
				then
				#
				#echo "Hai chiuso la finestra..."
				#
				exit 255
				#
			else
				if [ "${dialogo}" = "zenity" -a ${uscita} -eq 5 ]
					then
					# Non far niente: sembra un codice di uscita di zenity legato ai temi...
					:
					#
				else
					#
					#
					alert_message ":( ...Something went wrong..."
					echo -e "\n:( ...Something went wrong..." 1>&2
					#
					exit 1
					#
				fi
				#
			fi
			#
		fi
		# End exit code check... 
		#####################################################
		#
		OUT_STDERR="${final_value}"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "Xdialog" ]
	then
	adjust()
		{
		local FUNCT_NAME="adjust"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		reset_geometry="NO"
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		if [ "${reset_geometry}" = "YES" ]
			then
			local dimensione_finestra="${width}x${height}"
			local dimensione_finestra_1="${width}x${height}"
		fi
		# End check for user custom geometry...
		#########################################
		#
		##
		#
		testo="${1-"Please adjust parameter..."}"
		#
		start_value=${2-"0"}
		init_value=${3-"50"}
		end_value=${4-"100"}
		#
		start_value_percent=0
		end_value_percent=100
		#
		num_tot_elementi=$(( ${end_value} - ${start_value} ))
		diff_values_percent=$(( ${end_value_percent} - ${start_value_percent} ))
		step=$(echo "scale=2; ${num_tot_elementi} / ${diff_values_percent}" | bc -l )
		# =>
		init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
		init_value_percent=$(arrotonda "${init_value_percent_float}" )
		#
		#
		${dialogo} --title "${supertitle:-EasyBashGUI}: adjust" --stdout --separator "\\n" ${no_tags} ${icona_Ok} --rangebox "${testo}" ${dimensione_finestra_1} ${dimensione_finestra_2} ${start_value_percent} ${end_value_percent} ${init_value_percent} \
			2> /dev/null 1> "${dir_tmp}/${file_tmp}"
		#exit_if_user_closes_window
		exit_code="${?}"
		#
		#
		value_percent=$(tr -dc '[[:digit:]]' 0< "${dir_tmp}/${file_tmp}" )
		: value_percent
		#
		final_value_temp=$(echo "scale=2; ${value_percent} * ${step}" | bc -l )
		final_value_float=$(echo "scale=2; ${start_value} + ${final_value_temp}" | bc -l )
		: final_value_float
		#
		final_value=$(arrotonda "${final_value_float}" )
		: final_value
		#
		echo "${final_value}" 1> "${dir_tmp}/${file_tmp}" 
		#
		#####################################################
		# Exit code check... 
		# ( Note:  for this function is better _do not_ use:
		#          "exit_if_user_closes_window" )
		uscita="${exit_code}"
		if [ ${uscita} -ne 0 ]
			then
			#clean_temp
			if [ ${uscita} -eq 1 ]
				then
				#
				#echo "Hai cliccato su \"Cancel\"..."
				#
				exit 1
				#
			elif [ ${uscita} -eq 255 ]
				then
				#
				#echo "Hai chiuso la finestra..."
				#
				exit 255
				#
			else
				if [ "${dialogo}" = "zenity" -a ${uscita} -eq 5 ]
					then
					# Non far niente: sembra un codice di uscita di zenity legato ai temi...
					:
					#
				else
					#
					#
					alert_message ":( ...Something went wrong..."
					echo -e "\n:( ...Something went wrong..." 1>&2
					#
					exit 1
					#
				fi
				#
			fi
			#
		fi
		# End exit code check... 
		#####################################################
		#
		OUT_STDERR="${final_value}"
		echo "${OUT_STDERR}" 1>&2
		}
elif [ "${mode}" = "dialog" ]
	then
	adjust()
		{
		local FUNCT_NAME="adjust"
		local IFS=$' \t\n'
		#
		##clean_temp #( #clean_temp not useful because this function will write in temp file... )
		#
		#########################################
		# Begin check for user custom geometry...
		while [ "${1:-unset}" = "--width" -o "${1:-unset}" = "-w" -o "${1:-unset}" = "--height" -o "${1:-unset}" = "-h" ]
			do
			w_or_h="$(if [ "${1}" = "--width" -o "${1}" = "-w" ]
					then
					echo "width"
				elif [ "${1}" = "--height" -o "${1}" = "-h" ]
					then
					echo "height"
				fi )"
			parameter=$(echo -n "${2}" | tr -dc '[[:digit:]]' ) ; [ ${#parameter} -eq 0 ] && break
			reset_geometry="YES" && eval "local ${w_or_h}=${parameter}" && shift 2
		done
		# End check for user custom geometry...
		#########################################
		#
		##
		#
		testo="${1-"Please adjust parameter..."}"
		#
		start_value=${2-"0"}
		init_value=${3-"50"}
		end_value=${4-"100"}
		#
		start_value_percent=0
		end_value_percent=100
		#
		num_tot_elementi=$(( ${end_value} - ${start_value} ))
		diff_values_percent=$(( ${end_value_percent} - ${start_value_percent} ))
		step=$(echo "scale=2; ${num_tot_elementi} / ${diff_values_percent}" | bc -l )
		# =>
		init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
		init_value_percent=$(arrotonda "${init_value_percent_float}" )
		#
		#
		dim=10
		#
		{
		up_with_X='OA' && up_without_X='\[A'
		right_with_X='OC' && right_without_X='\[C'
		#
		down_with_X='OB' && down_without_X='\[B'
		left_with_X='OD' && left_without_X='\[D'
		#
		exit_success=0
		value_percent=${init_value_percent} && echo ${value_percent}
		#echo "INIZIO" 1> /home/cagnettav/Desktop/prova-adj.txt
		while :
			do
			read -n 3 -s key
			#
			#echo "---${key}---" 1>> /home/cagnettav/Desktop/prova-adj.txt
			#
			case ${exit_success} in 
				"$(echo -n "${key}" | grep -E "(${up_with_X}|${up_without_X}|${right_with_X}|${right_without_X})" &> /dev/null; echo ${?} )" ) 
					value_percent=$(( ${value_percent} + 1 )) ;;
				"$(echo -n "${key}" | grep -E "(${down_with_X}|${down_without_X}|${left_with_X}|${left_without_X})" &> /dev/null; echo ${?} )" )
					value_percent=$(( ${value_percent} - 1 )) ;;
				* )
					if [[ ${key} =~ .*A.* ]]
						then
						value_percent=$(( ${value_percent} + 1 ))
					elif [[ ${key} =~ .*C.* ]]
						then
						value_percent=$(( ${value_percent} + 1 ))
					elif [[ ${key} =~ .*B.* ]]
						then
						value_percent=$(( ${value_percent} - 1 ))
					elif [[ ${key} =~ .*D.* ]]
						then
						value_percent=$(( ${value_percent} - 1 ))
						#
					elif [[ ${key} =~ .*O.* ]]
						then
						continue 1
					elif [[ ${key} =~ .*\[.* ]]
						then
						continue 1
					else
						break 1
						#
					fi ;;
			esac
			#
			echo "${value_percent}"
		done
		#
		echo "${value_percent}" 1> "${dir_tmp}/${file_tmp}" 
		#sleep 1 
		} | \
		\
		${dialogo} --title "${supertitle:-EasyBashGUI}: adjust (use arrow keys)" ${progress} "${testo}" "${dim}" "${dimensione_finestra_2}" $(if [ "${dialogo}" = "whiptail --fb" ] ; then echo "${init_value_percent}"; fi )
		#exit_if_user_closes_window
		exit_code="${?}"
		#
		reset
		#
		#
		value_percent=$(tr -dc '[[:digit:]]' 0< "${dir_tmp}/${file_tmp}" )
		: value_percent
		#
		final_value_temp=$(echo "scale=2; ${value_percent} * ${step}" | bc -l )
		final_value_float=$(echo "scale=2; ${start_value} + ${final_value_temp}" | bc -l )
		: final_value_float
		#
		final_value=$(arrotonda "${final_value_float}" )
		: final_value
		#
		echo "${final_value}" 1> "${dir_tmp}/${file_tmp}" 
		#
		#####################################################
		# Exit code check... 
		# ( Note:  for this function is better _do not_ use:
		#          "exit_if_user_closes_window" )
		uscita="${exit_code}"
		if [ ${uscita} -ne 0 ]
			then
			#clean_temp
			if [ ${uscita} -eq 1 ]
				then
				#
				#echo "Hai cliccato su \"Cancel\"..."
				#
				exit 1
				#
			elif [ ${uscita} -eq 255 ]
				then
				#
				#echo "Hai chiuso la finestra..."
				#
				exit 255
				#
			else
				if [ "${dialogo}" = "zenity" -a ${uscita} -eq 5 ]
					then
					# Non far niente: sembra un codice di uscita di zenity legato ai temi...
					:
					#
				else
					#
					#
					alert_message ":( ...Something went wrong..."
					echo -e "\n:( ...Something went wrong..." 1>&2
					#
					exit 1
					#
				fi
				#
			fi
			#
		fi
		# End exit code check... 
		#####################################################
		#
		OUT_STDERR="${final_value}"
		echo "${OUT_STDERR}" 1>&2
		}
fi
# adjust()
#
##
#
[ "${easybashgui_debug_mode}" = "YES" ] && echo "[lib SOURCED]"
[ "${easybashgui_debug_mode}" = "NO" ] && : #This is user for getting exit code = 0 :-)
