ptooltips 0.2
ptooltips 0.2
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
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
Last edited by zigbert on Thu 04 Nov 2010, 17:37, edited 2 times in total.
Example code:
Code: Select all
#!/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
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
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
- Attachments
-
- tooltips.jpg
- (37.62 KiB) Downloaded 1271 times
Puppy Linux Blog - contact me for access
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).
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: Select all
#!/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'
Thanks Sigmund
Turns out ptooltips is not the right tool for what I was looking. . Still put it to good use though.
Mick
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
You almost need a mailing list or something to announce all your new creations
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Ptooltips had a short life.
Potong has showed us that tooltips ARE supported by gtkdialog.
Try his script and be amazed.
Potong has showed us that tooltips ARE supported by gtkdialog.
Try his script and be amazed.
Code: Select all
#!/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
Last edited by zigbert on Wed 05 Aug 2009, 09:28, edited 1 time in total.
Code: Select all
gtkdialog3 -d -p GUI
I was going to say it would be better to make gtkdialog do tooltips itself
I wonder what other hidden features there are...
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER