Posted: Wed 10 Aug 2011, 08:18
Wouldn't a checkbox normally be used in that situation?
READ-ONLY Archive
https://oldforum.puppylinux.com/
I think I was missing this bit:disciple wrote:Maybe there's something I'm missing about what you're asking
8-bit's example does not use gtk-options. Unless I'm misunderstanding what "gtk-options" means, of course.zigbert wrote:using gtk-options
The GTK+ property is "reorderable".zigbert wrote:...moving items inside a <tree> widget...using gtk-options.
Hi seasideseaside wrote:I remember struggling with trying to move an item up and down a list and constantly ending up with placing it as a subheading instead.
Code: Select all
#!/bin/sh
# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
GTKDIALOG=gtkdialog
function funcpixCreate() {
for f in 0 1 2 3; do
echo '<pixmap>
<variable>pix'$1$f'</variable>
<input file>pix'$f'.svg</input>
</pixmap>'
done
}
function funcbtnCreate() {
echo '<button>
<input file stock="'$1'"></input>
<action>'$2':tmr0</action>
<action>'$2':tmr1</action>
<action>'$2':tmr2</action>
<action>'$2':tmr3</action>
</button>'
}
function functmrCreate() {
echo '<variable>tmr'$1'</variable>
<action>funcpixRandomise</action>
<action>refresh:pix'$1'0</action>
<action>refresh:pix'$1'1</action>
<action>refresh:pix'$1'2</action>
<action>refresh:pix'$1'3</action>
</timer>'
}
function funcimageCreate() {
local -a colours=("a00000" "00a000" "0000a0" "ffffff")
echo '
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="0" y="0" height="64" width="64" fill="#'${colours[$1]}'"/>
</svg>' > image$1.svg
}; export -f funcimageCreate
function funcpixRandomise() {
local rand=
for f in 0 1 2 3; do
rand=$(($RANDOM % 4))
ln -sf image$rand.svg pix$f.svg
done
}; export -f funcpixRandomise
if [ ! -f image0.svg ]; then funcimageCreate 0; fi
if [ ! -f image1.svg ]; then funcimageCreate 1; fi
if [ ! -f image2.svg ]; then funcimageCreate 2; fi
if [ ! -f image3.svg ]; then funcimageCreate 3; fi
funcpixRandomise
export MAIN_DIALOG='
<window title="tmrTimer" resizable="false">
<vbox>
<frame timer widget>
<vbox border-width="20">
<hbox>
<timer>
'"$(functmrCreate 0)"'
'"$(funcpixCreate 0)"'
</hbox>
<hbox>
<timer interval="2">
'"$(functmrCreate 1)"'
'"$(funcpixCreate 1)"'
</hbox>
<hbox>
<timer milliseconds="true" visible="false">
'"$(functmrCreate 2)"'
'"$(funcpixCreate 2)"'
</hbox>
<hbox>
<timer milliseconds="true" interval="500" visible="false">
'"$(functmrCreate 3)"'
'"$(funcpixCreate 3)"'
</hbox>
</vbox>
</frame>
<hbox>
'"$(funcbtnCreate gtk-no disable)"'
'"$(funcbtnCreate gtk-yes enable)"'
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG
Code: Select all
widget_timer.o: In function `widget_timer_timer_callback':
/root/gtkdialog/src/widget_timer.c:379: undefined reference to `gtk_widget_get_sensitive'
widget_timer.o: In function `widget_timer_envvar_construct':
/root/gtkdialog/src/widget_timer.c:137: undefined reference to `gtk_widget_get_sensitive'
collect2: ld returned 1 exit status
make[3]: *** [gtkdialog] Error 1
make[3]: Leaving directory `/root/gtkdialog/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/gtkdialog/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/gtkdialog'
make: *** [all] Error 2
Working ok in Slacko-312.37I tried to compile the latest but it seems to have a problem, I don't really know much about this so it could be me.
01micko wrote:Working ok in Slacko-312.37I tried to compile the latest but it seems to have a problem, I don't really know much about this so it could be me.
Don't you use quirky-NOP Geoffrey? gtk+ version is old in that.
Ah, that's cool.thunor wrote:The GTK+ property is "reorderable".zigbert wrote:...moving items inside a <tree> widget...using gtk-options.
Regards,
Thunor
Hi GeoffreyGeoffrey wrote:Code: Select all
... /root/gtkdialog/src/widget_timer.c:379: undefined reference to `gtk_widget_get_sensitive' ...
Can anyone confirm?seaside wrote:Just wanted to add that using the "#!/usr/sbin/gtkdialog3" event form requires that gtkdialog3 is symlinked to gtkdialog, otherwise it errs. I ran into this earlier using the "event driven" form of gtkdialog - no matter from a file or on the command line.potong wrote:sunburnt:
Here's a program written in two ways to show the different options.
Secondly --event-driven=filenameCode: Select all
#!/usr/sbin/gtkdialog3 -e display(){ echo "Display: ${!1}"; } ...............
Potong, thanks for supplying all this great information on Gtkdialog. It is immensely helpful.
Regards,
s
Well it's fixed now The "gtkdialog" binary name was hardcoded.disciple wrote:In other words, if the executable is named something other than "gtkdialog", then you need to create a link to it named "gtkdialog", to be able to use the event-driven option.