Posted: Mon 28 Aug 2017, 10:52
That means the solution is to combine a <chooser> in mode 0 (select file) with an <entry> holding the filename. Thank you.
READ-ONLY Archive
https://oldforum.puppylinux.com/
Code: Select all
echo /usr/share/backgrounds > /tmp/savepath
echo "default.svg" > /tmp/savefile
echo '
<vbox>
<entry visible="false">
<variable>SAVEPATH</variable>
<input file>/tmp/savepath</input>
</entry>
<entry>
<variable>SAVEFILE</variable>
<input file>/tmp/savefile</input>
</entry>
<chooser action="0" create-folders="true" >
<width>600</width>
<height>400</height>
<variable>SAVE_CHOOSER</variable>
<default>'$(cat /tmp/savepath)'</default>
<action signal="button-release-event" condition="command_is_true([[ -f \"$SAVE_CHOOSER\" ]] && echo true)">basename "$SAVE_CHOOSER" > /tmp/savefile</action>
<action signal="button-release-event" condition="command_is_true([[ -d \"$SAVE_CHOOSER\" ]] && echo true)">dirname "$SAVE_CHOOSER" > /tmp/savepath</action>
<action signal="button-release-event">refresh:SAVEFILE</action>
<action signal="button-release-event">refresh:SAVEPATH</action>
</chooser>
<hbox>
<button cancel></button>
<button>
<label>Save</label>
<input file stock="gtk-save"></input>
<action>gxmessage "savefile: $SAVEPATH"/"$SAVEFILE"</action>
</button>
</hbox>
</vbox>
' | gtkdialog -s
Code: Select all
echo '
<vbox width-request="300">
<hbox>
<button space-expand="false" space-fill="false">
<label>"Action"</label>
<input file stock="gtk-help"></input>
<action>xmessage here</action>
</button>
<button space-expand="false" space-fill="false">
<input file stock="gtk-preferences"></input>
<action>xmessage here</action>
</button>
<text space-expand="true" space-fill="true">
<label>""</label>
</text>
<button cancel></button>
</hbox>
</vbox>' | gtkdialog -s
Yes.smokey01 wrote:Is it possible to change the background colour of the <edit> widget?
Thanks.MochiMoppel wrote:Yes.smokey01 wrote:Is it possible to change the background colour of the <edit> widget?
Code: Select all
#!/bin/bash
GTKDIALOG=gtkdialog
export MAIN_DIALOG='
<window title="welcome" width-request="480" height-request="320">
<vbox>
<frame>
<text>
<label> Welcome </label>
</text>
<pixmap>
<input file> /home/livernote/Desktop/L.jpg </input>
</pixmap>
</frame>
<frame Label from command>
<text>
<label>This is a static text.</label>
<input>date</input>
<variable>DATE</variable>
</text>
<hbox>
<button>
<label>refresh</label>
<action type="refresh">DATE</action>
</button>
<button>
<label>Continue</label>
<action>
<input file> /home/livernote/Desktop/my </input>
</action>
</button>
</hbox>
</frame>
</vbox>
</window>
'
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG --center ;;
esac
------------
Code: Select all
#!/bin/bash
GTKDIALOG=gtkdialog
export MAIN_DIALOG='
<window title="welcome" width-request="480" height-request="320">
<hbox>
<vbox space-expand="true" space-fill="true">
<button>
<label>1</label>
<action>echo "Button 1"</action>
</button>
<button>
<label>2</label>
<action>echo "Button 2"</action>
</button>
</vbox>
</hbox>
</window>
'
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG --center ;;
esac
------------
Code: Select all
#!/bin/bash
export SUB_DIALOG='
<window>
<vbox>
<text><label>SUB_DIALOG</label></text>
<button>
<label>Close</label>
<action>closewindow:SUB_DIALOG</action>
</button>
</vbox>
<variable>SUB_DIALOG</variable>
</window>'
export MAIN_DIALOG='
<window>
<vbox>
<text><label>MAIN_DIALOG</label></text>
<button>
<label>Continue</label>
<action>launch:SUB_DIALOG</action>
</button>
</vbox>
</window>'
gtkdialog -cp MAIN_DIALOG
..interesting, works as is on this system.. no need to export.export GTK2_RC_FILES
OK, I can always use the JWM TaskList menu,
.. will add resizable="false" when update.BTW: Resizing the "fixed size" window results in strange artifacts
Code: Select all
<frame Progress>
<text>
<label>Duplication process is happening.</label>
</text>
<progressbar>
<input>dd if=/dev/sda of=/dev/sdb</input>
<action>launch:END_DIALOG</action>
</progressbar>
</frame>
This is a way to show the progress bar with dd and pv in terminal.livernote1 wrote:Guys help needed, been working with this progress bar if using the example like give in page page 1 it is working fine but after i change the action it seem the program is running on the background only the progress bar is just silence
Code: Select all
<frame Progress> <text> <label>Duplication process is happening.</label> </text> <progressbar> <input>dd if=/dev/sda of=/dev/sdb</input> <action>launch:END_DIALOG</action> </progressbar> </frame>
Code: Select all
USB="/dev/sdb"
ISO_IMAGE="/path/to/ubuntu-15.04-desktop-amd64.iso"
SIZE=$(du -h -B1 "$ISO_IMAGE" | awk '{print $1}')
dd if="$ISO_IMAGE" | pv -s "$SIZE" | dd of="$USB" bs=4M oflag=dsync
Code: Select all
USB="/dev/sdb"
ISO_IMAGE="/path/to/ubuntu-15.04-desktop-amd64.iso"
SIZE=$(du -h -B1 "$ISO_IMAGE" | awk '{print $1}')
(dd if="$ISO_IMAGE" | pv -n -s "$SIZE" | dd of="$USB" bs=4M oflag=dsync) 2>&1 | \
yad --center --borders=6 --title="Image writer" --text="$(echo -e "Writing $(basename "$ISO_IMAGE"):")"\
--width=300 --progress --no-buttons --auto-close --image=system-run --window-icon=drive-removable-media-usb