GtkDialog - tips
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Today I wondered why one of my <pixmap> widgets recognizes key-press-event signals while another - seemingly identical - widget doesn't.
Turns out that it makes a difference if the pixmap is packed into a scrollable or (default) not scrollable box container.
I updated my collection of <eventbox> mysteries.
Turns out that it makes a difference if the pixmap is packed into a scrollable or (default) not scrollable box container.
I updated my collection of <eventbox> mysteries.
..interesting, works as is on this system.. no need to export.export GTK2_RC_FILES
OK, I can always use the JWM TaskList menu,
..not using JWM if possible, while double checked with JWM, looks working.
Maybe should have made better mimic of window border.. ? Top gray area?
.. will add resizable="false" when update.BTW: Resizing the "fixed size" window results in strange artifacts
Also some more detailed rc file to support dark themes ( for resizable window ) .
-
- Posts: 3
- Joined: Sat 09 Sep 2017, 03:36
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>
- misko_2083
- Posts: 114
- Joined: Tue 08 Nov 2016, 13:42
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
Someone asked how to do this with yad.
To show this in a UI you need line by line output. For that add -n to pv.
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
-
- Posts: 3
- Joined: Sat 09 Sep 2017, 03:36
i have try me best to understand but apparently still cant make the progress bar in the gtkdialog moving...its work smoothly if i just want to use the pv at terminal but on the gtkdialog interface the progress bar is no movingmisko_2083 wrote: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>
With oflag=dsync dd will ask for completely synchronous output to disk. Slower but you'll have a progress bar.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
Someone asked how to do this with yad.
To show this in a UI you need line by line output. For that add -n to pv.
You can apply something similar with gtkdialog.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
Tip for a horizontal line of buttons at the bottom of a window (see image)
Instead of all the icons sharing the window equally
or force them all to the right side , I found a way to
give a button less space. In the example the help button
is small and on the left side. The other two buttons share the remaining space equally.
Instead of all the icons sharing the window equally
or force them all to the right side , I found a way to
give a button less space. In the example the help button
is small and on the left side. The other two buttons share the remaining space equally.
Code: Select all
#!/bin/sh
export TEXTSTRING="$(gettext 'How to use pho
Usage: : pho *.jpg (or whatever format). ')"
export VIEWER='
<window title="Experiment">
<vbox width-request="740">
<text><label>Experiment</label></text>
<hseparator></hseparator>
<hbox>
<button space-expand="false" space-fill="false">
<input file stock="gtk-help"></input>
<action>Xdialog --title "'$(gettext 'Help')'" --ok-label "'$(gettext 'OK')'" --backtitle "\n$TEXTSTRING \n " --msgbox "" 0 0 &</action>
</button>
<hbox space-expand="true" space-fill="true">
<button>
<input file stock="gtk-cancel"></input>
<label>Cancel</label>
</button>
<button>
<input file stock="gtk-apply"></input>
<label>Proceed</label>
<action>xmessage clicked</action>
<action type="exit">CLOSE</action>
</button>
</hbox></hbox>
</vbox>
</window>'
gtkdialog -p VIEWER --center
- Attachments
-
- screenshot-script.png
- (8.65 KiB) Downloaded 480 times
Here is final app --> pho viewer
http://murga-linux.com/puppy/viewtopic. ... 027#974027
____________________________________________________
http://murga-linux.com/puppy/viewtopic. ... 027#974027
____________________________________________________
- Attachments
-
- screenshot-pho.png
- (31.41 KiB) Downloaded 430 times
I was wondering if anyone has any idea under what conditions the gtkdialog elements of an app/script may be shown in reverse order
i.e. from bottom to top and from right to left (see pick below)
Should point out that this is with the mac version of gtkdialog , but still...
The gtkdialog dependencies appear to be ok, btw
i.e. from bottom to top and from right to left (see pick below)
Should point out that this is with the mac version of gtkdialog , but still...
The gtkdialog dependencies appear to be ok, btw
Code: Select all
gm$ otool -L /usr/local/bin/gtkdialog # otool is the dll equivalent for ox x
/usr/local/bin/gtkdialog:
/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0)
/usr/local/opt/gtk+/lib/libgdk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0)
/usr/local/opt/pango/lib/libpangocairo-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0)
/usr/local/opt/pango/lib/libpango-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0)
/usr/local/opt/atk/lib/libatk-1.0.0.dylib (compatibility version 22210.0.0, current version 22210.1.0)
/usr/local/opt/cairo/lib/libcairo.2.dylib (compatibility version 11403.0.0, current version 11403.6.0)
/usr/local/opt/gdk-pixbuf/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 3601.0.0, current version 3601.0.0)
/usr/local/opt/glib/lib/libgio-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/usr/local/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
- Attachments
-
- gtkdialog_mac.png
- (171.68 KiB) Downloaded 410 times
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
Said 'mac version' seems to exhibit the exact same problem of arm versions before jamesbond patched it... (take a close look at the screeny from your linked thread ).mavrothal wrote:I was wondering if anyone has any idea under what conditions the gtkdialog elements of an app/script may be shown in reverse order
i.e. from bottom to top and from right to left (see pick below)
Should point out that this is with the mac version of gtkdialog , but still...
The gtkdialog dependencies appear to be ok, btwCode: Select all
gm$ otool -L /usr/local/bin/gtkdialog # otool is the dll equivalent for ox x /usr/local/bin/gtkdialog: /usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0) /usr/local/opt/gtk+/lib/libgdk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0) /usr/local/opt/pango/lib/libpangocairo-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0) /usr/local/opt/pango/lib/libpango-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0) /usr/local/opt/atk/lib/libatk-1.0.0.dylib (compatibility version 22210.0.0, current version 22210.1.0) /usr/local/opt/cairo/lib/libcairo.2.dylib (compatibility version 11403.0.0, current version 11403.6.0) /usr/local/opt/gdk-pixbuf/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 3601.0.0, current version 3601.0.0) /usr/local/opt/glib/lib/libgio-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0) /usr/local/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0) /usr/local/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0) /usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0) /usr/local/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
You can try applying the untested patch attached.
NB: possibly in automaton.c (refer to patch) there are other possibilities. '__APPLE__' may work. If not replace it with '__MACH__'.
- Attachments
-
- apple_gtkdialog.patch.gz
- real gzip (lol)
- (343 Bytes) Downloaded 161 times
Puppy Linux Blog - contact me for access
This was it!01micko wrote: Said 'mac version' seems to exhibit the exact same problem of arm versions before jamesbond patched it... (take a close look at the screeny from your linked thread ).
You can try applying the untested patch attached.
NB: possibly in automaton.c (refer to patch) there are other possibilities. '__APPLE__' may work. If not replace it with '__MACH__'.
Needed some more changes to build but it worked.
Find the final gtkdialog mac binary and patch in the original post
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
-
- Posts: 5
- Joined: Mon 18 Dec 2017, 20:31
- Location: Fairmont, WV
How to calculate an suggested value for an entry widget
I am trying to calculate a suggested value for an entry field. The specific value I am looking for is the total number of bytes a storage device can hold.
A program "blockdev --getsize64 /dev/XXXX" will get the value for me. The sticky part is that I will not know the "/dev/xxxx" value until the user selects it.
The snippet below produces a list that the user selects from. The selection identifies the drive I want to determine the size of, in bytes.
I want to use the output from blockdev --getsize64 $EWF_SusPDrv to get that number.
I could really use suggestions, thoughts, hints.
Thanks in advance guys
A program "blockdev --getsize64 /dev/XXXX" will get the value for me. The sticky part is that I will not know the "/dev/xxxx" value until the user selects it.
The snippet below produces a list that the user selects from. The selection identifies the drive I want to determine the size of, in bytes.
Code: Select all
<list>
<width>150</width>
<height>80</height>
<variable>EWF_SusPDrv</variable>
<input>find /dev -type b -exec echo '{}' \; | sort </input></list>
</list>
Code: Select all
<text xalign="0" width-request="200"><label>"Number of Bytes to acquire"</label></text>
<entry width-request="100">
<default>0</default>
<variable>EWF_B</variable>
<input>0</input>
</entry>
Thanks in advance guys
Hey Slippery60, try this:
Greetings!
Code: Select all
#!/bin/sh
export MAIN='
<window>
<vbox>
<list>
<width>150</width>
<height>80</height>
<variable>EWF_SusPDrv</variable>
<input>find /dev -type b | sort </input>
<action>refresh:EWF_B</action>
</list>
<text xalign="0" width-request="200"><label>"Number of Bytes to acquire"</label></text>
<entry width-request="100">
<variable>EWF_B</variable>
<input>[ $EWF_SusPDrv ] && blockdev --getsize64 $EWF_SusPDrv || echo "N/A"</input>
</entry>
</vbox>
</window>'
gtkdialog -p MAIN
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
[b][color=green]Omnia mea mecum porto.[/color][/b]
- spiritwild
- Posts: 181
- Joined: Mon 03 Oct 2016, 10:06
question...
I'm not someone who can put all the gtk code together to make what I want. I could take a simple app like what I need and possibly edit it to my likes. Is there a simple "menu" app / code that I could mess with?
It basically just needs to be a small window with buttons that I can run programs from. Combine a few apps to one menu, so to speak.
I'm just not familiar so if theres a simple code or app I could mess around with, that would be helpful. Thanks
I'm not someone who can put all the gtk code together to make what I want. I could take a simple app like what I need and possibly edit it to my likes. Is there a simple "menu" app / code that I could mess with?
It basically just needs to be a small window with buttons that I can run programs from. Combine a few apps to one menu, so to speak.
I'm just not familiar so if theres a simple code or app I could mess around with, that would be helpful. Thanks
-
- Posts: 5
- Joined: Mon 18 Dec 2017, 20:31
- Location: Fairmont, WV
How to calculate an suggested value for an entry widget
SFR;
Thanks Dude, exactly what I needed.
Fantastic.
Thanks Dude, exactly what I needed.
Fantastic.
People on the forum have already written this...It basically just needs to be a small window with buttons that I can run programs from.
http://murga-linux.com/puppy/viewtopic.php?t=61962
http://murga-linux.com/puppy/viewtopic.php?t=76713
____________________________________________
To make a quick launcher yourself...
Put links to the desktop files in one folder,
then you can open this folder with the command
Code: Select all
rox -d /path/to/folder
Launch pmusic in a script
Launch pmusic in a script
I have found that it is difficult to launch pmusic inside a script.
Here is method that works reliably even when pmusic has an option.
First of all , choose pmusic from other apps
Now replace pmusic with 'pmusic -B' if you want background music.
Put the command in a file and make executable.
_________________________________________________________
I used this method in PTM timer
http://murga-linux.com/puppy/viewtopic.php?t=112410
_________________________
I have found that it is difficult to launch pmusic inside a script.
Here is method that works reliably even when pmusic has an option.
First of all , choose pmusic from other apps
Code: Select all
for P in mpg123 mpg321 pmusic parole vlc xine defaultaudioplayer ; do
MUSIC_APP=$(which $P) && break
done
Put the command in a file and make executable.
Code: Select all
[ $MUSIC_APP = /usr/local/bin/pmusic ] && MUSIC_APP="pmusic -B"
echo "$MUSIC_APP" \""${snd}"\" > /tmp/pmusic_launch
chmod +x /tmp/pmusic_launch
/tmp/pmusic_launch 2>/dev/null &
I used this method in PTM timer
http://murga-linux.com/puppy/viewtopic.php?t=112410
_________________________
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Re: Launch pmusic in a script
Trydon570 wrote:Here is method that works reliably even when pmusic has an option.
First of all , choose pmusic from other apps
Now replace pmusic with 'pmusic -B' if you want background music.Code: Select all
for P in mpg123 mpg321 pmusic parole vlc xine defaultaudioplayer ; do MUSIC_APP=$(which $P) && break done
Put the command in a file and make executable.
Code: Select all
[ $MUSIC_APP = /usr/local/bin/pmusic ] && MUSIC_APP="pmusic -B" echo "$MUSIC_APP" ""${snd}"" > /tmp/pmusic_launch chmod +x /tmp/pmusic_launch /tmp/pmusic_launch 2>/dev/null &
Code: Select all
for MUSIC_APP in mpg123 mpg321 pmusic parole vlc xine defaultaudioplayer ; do
which $MUSIC_APP && break
done
[ $MUSIC_APP = pmusic ] && OPTION="-B"
exec $MUSIC_APP $OPTION "$snd"
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
...which would work perfectly - unless you have unintentionally changed your IFS assignmentdon570 wrote:I hadn't thought of that. I was trying to do it all as one variable
MUSIC_APP="pmusic -B"