MochiMoppel wrote:It does exactly what you asked for ("I want the frame to hide if no checkfile exist and show if it does"). It is hiding the frame.smokey01 wrote:That's great MochiMoppel but it's hiding the image and not the frame.
Geoffrey's trick does it and I have no idea why. I haven't found any explanation of a window tag attribute resizable , not in this tutorial and not in the gtkdialog reference though the GtkWindow Manual lists the “resizableI want the GUI to shrink when there's no image
GtkDialog - tips
-
- Posts: 807
- Joined: Mon 12 Oct 2009, 17:11
Hi guys
The timeout=TIMEOUT command seems to have the bizarre behaviour of wiping out the text in msgbox or text. Can someone confirm, please?
Thanks
The timeout=TIMEOUT command seems to have the bizarre behaviour of wiping out the text in msgbox or text. Can someone confirm, please?
Thanks
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
This is yad?, could you give an example of how the text is read.B.K. Johnson wrote:Hi guys
The timeout=TIMEOUT command seems to have the bizarre behaviour of wiping out the text in msgbox or text. Can someone confirm, please?
Thanks
Maybe it would be better to move the discussion to the YAD - Tips
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
-
- Posts: 807
- Joined: Mon 12 Oct 2009, 17:11
Sure Geoffery
This is a slight modification of your earlier post.
The text is not displayed.
Remove the timeout and it is shown.
This is a slight modification of your earlier post.
Code: Select all
#!/bin/bash
yad --title="Yad Message Box" --width=200 --height=150 --fixed --text-align="center" --skip-taskbar --window-icon="gtk-dialog-info" \
--text="<big><b>
This is a Yad message box
</b></big>" --no-buttons --timeout="3"
Remove the timeout and it is shown.
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
@B.K. Johnson,
See http://murga-linux.com/puppy/viewtopic. ... 499#918499
See http://murga-linux.com/puppy/viewtopic. ... 499#918499
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Back to topic and to the confusing "resizable" attribute. It turns out that I used it before for the exact purpose it was invented. It removes the "Resize" item from the window menu and prevents user resizing.
With its surprising side effects I can now solve a problem that puzzled me for a long time.
I've created a tiny image viewer with the pixmap widget. Pretty much like Viewnior it uses one dialog window to read images one after another. The problem is that while the dialog window will automatically expand when reading an image bigger than the previous image (that's good!), it will not shrink when the following image is smaller. This puts ugly empty space around the image (see screenshot).
With resizable="false" the window will expand as well, but it will also shrink, adapting window size always to the size of the image. Very neat.
With its surprising side effects I can now solve a problem that puzzled me for a long time.
I've created a tiny image viewer with the pixmap widget. Pretty much like Viewnior it uses one dialog window to read images one after another. The problem is that while the dialog window will automatically expand when reading an image bigger than the previous image (that's good!), it will not shrink when the following image is smaller. This puts ugly empty space around the image (see screenshot).
With resizable="false" the window will expand as well, but it will also shrink, adapting window size always to the size of the image. Very neat.
- Attachments
-
- window_resizable_true_false.png
- (106.77 KiB) Downloaded 720 times
[SOLVED]
Fixed by @MochiMoppel - thank you - http://www.murga-linux.com/puppy/viewto ... 479#922479
Last edited by peebee on Thu 08 Sep 2016, 15:45, edited 1 time in total.
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
-
- Posts: 807
- Joined: Mon 12 Oct 2009, 17:11
-
- Posts: 807
- Joined: Mon 12 Oct 2009, 17:11
Request for gtkdialog lint(er), formatter/pretty printer
I chose to place this request here rather than under REQUESTS. No ruffled feathers, I hope.
Is there a lint(er) a.k.a. code formatting tool; a.k.a. pretty-printer (to screen) for gtkdialog code?
I would not want one that automatically lints as I type. I think I would find that really distracting. I'd rather use a linter that processes my code after I’ve finished my work.
Is there a lint(er) a.k.a. code formatting tool; a.k.a. pretty-printer (to screen) for gtkdialog code?
I would not want one that automatically lints as I type. I think I would find that really distracting. I'd rather use a linter that processes my code after I’ve finished my work.
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Needs an eventbox to work:torm wrote:<action signal="type">activity</action>
if "button-release-event" is the event
does GtkStatusbar widget support that?
Code: Select all
#! /bin/sh
echo '
<window width-request="200">
<eventbox>
<statusbar>
<input>echo "Click me!"</input>
</statusbar>
<action signal="button-press-event">beep</action>
<action signal="button-release-event">beep -f100</action>
</eventbox>
</window>'|gtkdialog -s
Alhamdulillah..
Finally, I can make button align to left. Try this code:
But, how to make the button's width tobe same?
Edit:
we can smooth it by relief="2" in button tag.
Finally, I can make button align to left. Try this code:
Code: Select all
#!/bin/sh
export gui='
<window>
<vbox>
<hbox space-fill="true" space-expand="true">
<button space-fill="false" space-expand="false">
<input file>/root/puppy-reference/midi-icons/archive48.png</input>
<label>another okay</label>
</button>
<text xalign="0">
<label>""</label>
</text>
</hbox>
<hbox space-fill="true" space-expand="true">
<button xalign="0" space-fill="false" space-expand="false">
<input file>/root/puppy-reference/midi-icons/chat48.png</input>
<label>okay</label>
</button>
<text>
<label>""</label>
</text>
</hbox>
<hbox space-fill="true" space-expand="true">
<button space-fill="false" space-expand="false">
<input file>/root/puppy-reference/midi-icons/connect48.png</input>
<label>okay again</label>
</button>
<text>
<label>""</label>
</text>
</hbox>
<hbox space-fill="true" space-expand="true">
<button space-fill="false" space-expand="false">
<input file>/root/puppy-reference/midi-icons/save48.png</input>
<label>loooong and over again okay</label>
</button>
<text>
<label>""</label>
</text>
</hbox>
</vbox>
</window>'
gtkdialog -p gui
Edit:
we can smooth it by relief="2" in button tag.
- Attachments
-
- alignlefttextbutton.png
- left align
- (13.44 KiB) Downloaded 513 times
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
First 2 button same width, no space-fill attributes, no vertical expansion,recobayu wrote:But, how to make the button's width tobe same?
Third button unchanged for comparison. It would be nice if icons+labels could also be left aligned, but that might be impossible without space padding the labels.
Code: Select all
#! /bin/sh
export gui='
<window>
<vbox>
<hbox>
<button space-expand="false" width-request="200">
<input file>/root/puppy-reference/midi-icons/archive48.png</input>
<label>another okay</label>
</button>
<text space-expand="true" label=""></text>
</hbox>
<hbox>
<button space-expand="false" width-request="200">
<input file>/root/puppy-reference/midi-icons/chat48.png</input>
<label>okay</label>
</button>
<text space-expand="true" label=""></text>
</hbox>
<hbox space-fill="true" space-expand="true">
<button space-fill="false" space-expand="false">
<input file>/root/puppy-reference/midi-icons/save48.png</input>
<label>loooong and over again okay</label>
</button>
<text>
<label>""</label>
</text>
</hbox>
</vbox>
</window>'
gtkdialog -p gui
- Attachments
-
- left-aligned_buttons.png
- (12.8 KiB) Downloaded 517 times
Thank you Mochi, but your icon and text are not left aligned anymore (first button and second). I want to make the button same width and left aligned. If it is not possible, I think relief="2" is the solution.
Last edited by recobayu on Fri 09 Sep 2016, 06:28, edited 1 time in total.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
What do you mean by "not anymore". Icons and text in your examples were also not left aligned. Only buttons are left aligned. As I said, that's something that may be impossible.recobayu wrote:Thank you Mochi, but your icon and text are not left aligned anymore (first button and second).
That's what they are now. The buttons (not the button icons+texts !) are same widths and aligned to left window edge.I want to make the button same width and left aligned.
@recobayu , just a suggestion, why don't you move the text outside the button, so you can have all buttons left-aligned and same size, and text labels left-aligned and merged with background color?
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
Thank You, Step. If I do that, the clickable area is just on the icon. But with label inside button, its easier to hover and click. Here is my exploration:step wrote:@recobayu , just a suggestion, why don't you move the text outside the button, so you can have all buttons left-aligned and same size, and text labels left-aligned and merged with background color?
http://murga-linux.com/puppy/viewtopic. ... 659#922659
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
...which is the same as your earlier code, the code you wanted to change, only without button reliefs. IMHO this makes it worse. You camouflage the fact that the buttons and therefore the click area are all of different size and the user has no clue anymore where to click. Keeping the cursor on the right side (to drag the slider) and then moving a little left to hit a button becomes a hit & miss game.recobayu wrote: Here is my exploration:
http://murga-linux.com/puppy/viewtopic. ... 659#922659
You are trying again to mimic the tree widget using buttons. Stay with the tree.
A simple solution to make strikethrough text.
Code: Select all
#!/bin/sh
#
STRIKE="$(readlink -e "$0")"
sleep 0.3
[ `pidof "$(basename "$STRIKE")" -o %PPID | wc -w` -gt 1 ] && exit 1
touch /tmp/strikethrough
export DIALOG='
<window title="StrikeThrough" icon-name="gtk-strikethrough">
<vbox>
<edit wrap-mode="3">
<variable>EDIT</variable>
<height>150</height>
<width>500</width>
</edit>
<vbox>
<edit file-monitor="true" auto-refresh="true" wrap-mode="3" editable="false">
<height>150</height>
<input file>/tmp/strikethrough</input>
</edit>
</vbox>
<hbox homogeneous="true">
<hbox>
<button cancel></button>
<button>
<label>Create</label>
<input file stock="gtk-ok"></input>
<action>`echo "$EDIT" | sed "s/./&\xCC\xB6/g" > /tmp/strikethrough`</action>
</button>
</hbox>
</hbox>
</vbox>
</window>'
gtkdialog --program=DIALOG
- Attachments
-
- strikethrough.jpg
- (37.4 KiB) Downloaded 322 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
Geoffrey
Thanks for this one - interesting!
I have put your code in the new post about Text managing
Thanks for this one - interesting!
I have put your code in the new post about Text managing