How to create a tailbox with gtkdialog?
From "impossible" to three possibilties
The yad code by sfs is working, as are gtklogfileviewer and the Xdialog tailbox.
With yad I cannot get the scrolling-in-reverse. Would have to create a log file and that does not auto-scroll in real time.
The reason why I wanted this to succeed in gtkdialog is I also need to add a custom button to this window. So far, I haven't found how to do this in xdialog.
(yes, I'm a totlal noob in coding) When I want a button "pizza" in gtkdialog, poof! it's there, opening a window "pizzeria" and smelling good
So I'm not against using xdialog. The tailbox is in fact really fast! It's just that I find it hard to understand its iron logic.
Thank you both, Mike and MochiMoppel!
Bert
The yad code by sfs is working, as are gtklogfileviewer and the Xdialog tailbox.
With yad I cannot get the scrolling-in-reverse. Would have to create a log file and that does not auto-scroll in real time.
The reason why I wanted this to succeed in gtkdialog is I also need to add a custom button to this window. So far, I haven't found how to do this in xdialog.
(yes, I'm a totlal noob in coding) When I want a button "pizza" in gtkdialog, poof! it's there, opening a window "pizzeria" and smelling good
So I'm not against using xdialog. The tailbox is in fact really fast! It's just that I find it hard to understand its iron logic.
Thank you both, Mike and MochiMoppel!
Bert
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
How to create a tailbox with gtkdialog?
And this also works as "one-liner" ( without temporary file )MochiMoppel wrote:Unless you insist on gtkdialog, Xdialog is reliable, small and fast:Bert wrote:Is there a working example of such a "rolling" display someone could point me to?Code: Select all
xev >> /tmp/xev.log & Xdialog --tailbox "/tmp/xev.log" 30 100
Code: Select all
xev | Xdialog --tailbox "/tmp/xev.log" 30 100
+1mikeb wrote:....why reject good alternative tools for the job....
dialog is older so give it a try:
Code: Select all
xev | dialog --tailbox "/tmp/xev.log" 30 100
or
Code: Select all
rxvt -e xev | dialog --tailbox "/tmp/xev.log" 30 100
EDIT
forget it please
Last edited by L18L on Sun 23 Feb 2014, 12:51, edited 1 time in total.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Re: How to create a tailbox with gtkdialog?
Very unlikelyL18L wrote:And this also works as "one-liner" ( without temporary file )Code: Select all
xev | Xdialog --tailbox "/tmp/xev.log" 30 100
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: How to create a tailbox with gtkdialog?
Yes you are right.MochiMoppel wrote:Very unlikelyL18L wrote:And this also works as "one-liner" ( without temporary file )Code: Select all
xev | Xdialog --tailbox "/tmp/xev.log" 30 100
It worked only because the temporary file still existed
Just came home from a family reunion and read the new replies...
To stay with my silly example above: I can rename a button to "pizza", but there is no explanation anywhere telling me how to let this button open a new window "pizzeria", instead of doing one of the stock actions (close/cancel, etc..)
I'm deviating from the subject a bit, but I presume brokenman must have had similar questions when he started this thread.
Yes, I know. The question is: can I either define a new function to this button OR define an "extra-button"? I've really searched through all the xdialog documentation and tried every example, but it is not at all clear another button than the stock "exit/OK/Cancel/Help/Print" can be created.Mikeb wrote:gtklogfileviewer /tmp/pburn-log Close -center 0 600 350 "Pburn Log"
'Close' is the button name....
To stay with my silly example above: I can rename a button to "pizza", but there is no explanation anywhere telling me how to let this button open a new window "pizzeria", instead of doing one of the stock actions (close/cancel, etc..)
I'm deviating from the subject a bit, but I presume brokenman must have had similar questions when he started this thread.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
NoBert wrote:The question is: can I either define a new function to this button.
All you can do is add the buttons you already mentioned and a checkbox, but all have predefined functions and return values.OR define an "extra-button"?
And you could call your pizza cheesecake and it would still be a pizza...I can rename a button to "pizza", but there is no explanation anywhere telling me how to let this button open a new window "pizzeria.
And you could call your pizza cheesecake and it would still be a pizza...
Thank you MochiMoppel
Think I've solved it: by simplifying my script, omitting a warning dialog and using the return value of the Cancel button. ( if [ $? -eq "1" ]; then...action)
Simple, a bit crude maybe, but effective
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Wait! Here comes your pizza. Thunor provided the ingredients, zigbert the topping and I mixed it all together. It scrolls - sort of. Newest entries at the top, not the tail, so it's a headbox. I don't know if there is a way to turn this into a veritable tailbox. And don't try this with highspeed logs like in the previous xev example. Gtkdialog will choke, unlike Xdialog.
Code: Select all
#!/bin/sh
(for (( c=1; c<=180; c++ ));do
echo `date` >> /tmp/date.log
sleep 1
done)&
export DIALOG_MAIN='
<window width-request="300">
<vbox>
<vbox>
<tree headers-visible="false" >
<variable>txtOutput</variable>
<height>150</height>
<input>tac /tmp/date.log</input>
</tree>
</vbox>
<hbox homogeneous="true">
<button width-request="90">
<label>Pizza</label>
<input file stock="gtk-cdrom"></input>
<action>xmessage "PIZZA!!!"</action>
</button>
<button use-stock="true" label="gtk-ok" width-request="90">
<action>exit:Exit</action>
</button>
</hbox>
<timer interval="1" visible="false">
<action>refresh:txtOutput</action>
</timer>
</vbox>
</window>
'
gtkdialog --program=DIALOG_MAIN
Very nice!
(... and creative use of gtk-stock-icons )
I tried it with a wget logfile as input. It didn't choke gtkdialog, but was seriously lagging, so of little use for that purpose. It also had a jerky refreshing, not the smooth scrolling the xdialog tailbox and the gtklogfileviewer have.
Tried "pizza.sh" with the timer and/or "sleep" removed: it then just statically displays the last process.
And I wasn't able either to turn it into a scrolling tailbox.
( a tailbox seems easier for human brains than a headbox..? )
Thanks for your help!
(... and creative use of gtk-stock-icons )
I tried it with a wget logfile as input. It didn't choke gtkdialog, but was seriously lagging, so of little use for that purpose. It also had a jerky refreshing, not the smooth scrolling the xdialog tailbox and the gtklogfileviewer have.
Tried "pizza.sh" with the timer and/or "sleep" removed: it then just statically displays the last process.
And I wasn't able either to turn it into a scrolling tailbox.
( a tailbox seems easier for human brains than a headbox..? )
Thanks for your help!
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]