Well, I would try with the button that launches the window.smokey01 wrote:The combobox will keep the list contained within the height of screen where the comboboxtext over shoots the screen and looks quite untidy.seaside wrote:smokey01 ,
You might consider List -This would not be a dropdown, but would prevent the choice items from dropping below the window.Code: Select all
<list vscrollbar-policy="0">
Cheers,
s
I am considering a tree widget as it is quite neat which I guess is similar to the list widget. The only problem with tree and list widgets they take up a lot of real estate. My issue with the combobox is people can edit the selected data which can break things.
See attached for a sneak preview of what I'm working on. It will be in the August newsletter.
That window would have a list widget (or any other widget, buttons, notebook...) and make it close when it loses the focus.
This is a quick hack with xdotool.
Code: Select all
#!/bin/sh
eval $(xdotool getmouselocation --shell)
[ -z $GTKDIALOG ] && GTKDIALOG=gtkdialog
TMPDIR=/tmp/gtkdialog/examples/"`basename $0`"
mkdir -p "$TMPDIR"
printf "First item\nSecond item\nThird item\nSmokey item\nWiak's Vodka\nNice Weather\nPuppy Linux\nLast Item" > "$TMPDIR"/inputfile
MAIN_DIALOG='
<window window_position="2" skip_taskbar_hint="true" decorated="false">
<vbox>
<list vscrollbar-policy="0">
<variable>LIST</variable>
<width>350</width>
<height>150</height>
<input file>'"$TMPDIR"'/inputfile</input>
<output file>'"$TMPDIR"'/outputfile</output>
<action>echo "The chosen item is "$LIST""</action>
</list>
</vbox>
</window>
'
export MAIN_DIALOG
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --class smokey --space-expand=true --space-fill=true --program=MAIN_DIALOG 2>/dev/null & gtkdiag_pid=$! ;;
esac
until win_id=$(xdotool search --onlyvisible --class smokey 2>/dev/null); do
sleep .1
done
xdotool windowmove $win_id $X $Y
xdotool search --onlyvisible --class smokey behave %@ blur windowkill & xdo_pid=$!
wait $gtkdiag_pid
kill $xdo_pid
exit 0
The trick is to position the window as close to the button as possible.