Author |
Message |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Thu 30 Jul 2009, 09:56 Post subject:
ptooltips 0.2 Subject description: Gtkdialog now supports tooltips |
|
Ptooltips
With this simple script you can add tooltips to your gtkdialog (or any other code).
syntax: ptooltips "your tooltip text"
It uses yaf-splash for gui, and getcurpos to return mouse position. Yaf-splash is already in your Puppy, while getcurpos (2kb) only exist in the upcoming Puppy 4.3 and Puppy 5.
Download
username: puppy
password: linux
ptooltips-0.2 (1 kb)
Sigmund Berglund
_________________ Stardust resources
Last edited by zigbert on Thu 04 Nov 2010, 13:37; edited 2 times in total
|
Back to top
|
|
 |
trio

Joined: 21 Dec 2008 Posts: 2083 Location: अनुमोदना
|
Posted: Thu 30 Jul 2009, 10:02 Post subject:
|
|
Hmm,
So, this is what you up to Asking about a command to tell the cursor location
_________________ My apps
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Thu 30 Jul 2009, 11:58 Post subject:
|
|
Example code:
Code: | #!/bin/bash
export test_app="
<button>
<input file stock=\"gtk-yes\"></input>
<action signal=\"enter\">ptooltips \"Let's test tooltips\" &</action>
<action signal=\"leave\">ptooltips -end &</action>
</button>"
gtkdialog3 --program=test_app |
_________________ Stardust resources
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8670 Location: qld
|
Posted: Thu 30 Jul 2009, 23:41 Post subject:
|
|
Hello Sigmund
Well I got it to work with pcdlite ... but.... how can I force it to display more lines? It is a limitation of ptooltips? If so, how can I hack it?
I like it!
Mick
Description |
|
Filesize |
37.62 KB |
Viewed |
1186 Time(s) |

|
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Fri 31 Jul 2009, 16:20 Post subject:
|
|
Hello Mick
This is how you solve it.
Be aware that a tooltips containing many lines, might get out of screen area. The tooltips-placement-function doesn't like more than 3-4 lines (I think).
Code: | #!/bin/bash
export TXT="Are
you
sure?"
export script='
<vbox>
<text><label>Are you sure?</label></text>
<hbox>
<button no></button>
<button yes>
<action signal="enter">ptooltips "$TXT" &</action>
<action signal="leave">ptooltips -end &</action>
<action>EXIT:sure</action>
</button>
</hbox>
</vbox>
</window>'
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog3 --program=script); do
eval $STATEMENTS
done
IFS=$I
[ $EXIT = sure ] && gxmessage 'You are sure' |
_________________ Stardust resources
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8526 Location: Perth, Western Australia
|
Posted: Fri 31 Jul 2009, 17:23 Post subject:
|
|
zigbert,
Just to let you know, your Ptooltips is a great innovation and this is definitely going to be in 4.3beta!
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8670 Location: qld
|
Posted: Fri 31 Jul 2009, 20:31 Post subject:
|
|
Thanks Sigmund
Turns out ptooltips is not the right tool for what I was looking. . Still put it to good use though.
Mick
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Sat 01 Aug 2009, 11:59 Post subject:
|
|
Version 0.2
After using it 1 day, I have upgraded to a less irritating edition.
_________________ Stardust resources
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6781 Location: Auckland, New Zealand
|
Posted: Mon 03 Aug 2009, 02:39 Post subject:
|
|
You almost need a mailing list or something to announce all your new creations
_________________ If you have or know of a good gtkdialog application, please post a link here
Classic Puppy quotes
ROOT FOREVER
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Wed 05 Aug 2009, 03:02 Post subject:
|
|
Ptooltips had a short life.
Potong has showed us that tooltips ARE supported by gtkdialog.
Try his script and be amazed.
Code: | #!/bin/bash
a_function()
{
echo "you pressed ${1}"
}
b_function()
{
echo "you pressed ${1}=${!1}"
}
# variables to be exported
export BUTTON1="_plain tooltip" BUTTON2="_markup tooltip"
# functions can be exported too!
export -f a_function b_function
export GUI="
<window title=\"Tooltip Test\" window-position=\"1\">
<vbox>
<button use-underline=\"true\" label=\"$BUTTON1\" tooltip-text=\" press alt p \" xalign=\"0.3\" yalign=\"0.7\" width-request=\"100\" height-request=\"200\">
<action signal=\"clicked\">a_function BUTTON1</action>
</button>
<button use-underline=\"true\" tooltip-markup=\"<span background='yellow'><b> press alt m </b></span>\">
<label>$BUTTON2</label>
<action signal=\"map-event\">echo \"this button was mapped before it was clicked\"</action>
<action signal=\"clicked\">b_function BUTTON2</action>
</button>
<button use-underline=\"true\" has_focus=\"true\" use-stock=\"true\" label=\"gtk-cancel\" tooltip-text=\" press alt c or enter to close \"></button>
<frame frames can only have text Sad>
<text use-underline=\"true\" use-markup=\"true\" label=\"<span foreground='blue'><b>N.B.</b> _labels <i>can have tooltips</i> <u>too!...but no actions Sad)</u></span>\" tooltip-text=\" press alt l\">
</text>
</frame>
</vbox>
</window>
"
gtkdialog3 -d -p GUI |
_________________ Stardust resources
Last edited by zigbert on Wed 05 Aug 2009, 05:28; edited 1 time in total
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6781 Location: Auckland, New Zealand
|
Posted: Wed 05 Aug 2009, 03:49 Post subject:
|
|
Code: | gtkdialog3 -d -p GUI |
Plus this as well.
I was going to say it would be better to make gtkdialog do tooltips itself
I wonder what other hidden features there are...
_________________ If you have or know of a good gtkdialog application, please post a link here
Classic Puppy quotes
ROOT FOREVER
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Wed 05 Aug 2009, 05:28 Post subject:
|
|
Quote: | Plus this as well. |
Thank you
_________________ Stardust resources
|
Back to top
|
|
 |
trio

Joined: 21 Dec 2008 Posts: 2083 Location: अनुमोदना
|
Posted: Wed 05 Aug 2009, 09:03 Post subject:
|
|
HOLY WOW!!!!!
Please anybody can find a really complete guide of gtk-dialog!!!! Many hidden features there may be .......
_________________ My apps
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1447 Location: Ukraine
|
Posted: Wed 05 Aug 2009, 15:49 Post subject:
|
|
Dear trio,
I posted a French;language guide to gtkdialog with a lot of nice examples. Please search the forum and you will find it, with me as author of the post.
With kind regards,
vovchik
|
Back to top
|
|
 |
|