ptooltips 0.2

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

ptooltips 0.2

#1 Post by zigbert »

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)

Image

Sigmund Berglund
Last edited by zigbert on Thu 04 Nov 2010, 17:37, edited 2 times in total.

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#2 Post by trio »

Hmm,

So, this is what you up to :lol: Asking about a command to tell the cursor location

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

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

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#4 Post by 01micko »

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
Attachments
tooltips.jpg
(37.62 KiB) Downloaded 1271 times
Puppy Linux Blog - contact me for access

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

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: 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' 

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#6 Post by BarryK »

zigbert,
Just to let you know, your Ptooltips is a great innovation and this is definitely going to be in 4.3beta!
[url]https://bkhome.org/news/[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#7 Post by 01micko »

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

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#8 Post by zigbert »

Version 0.2

After using it 1 day, I have upgraded to a less irritating edition. :)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#9 Post by disciple »

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

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#10 Post by zigbert »

Ptooltips had a short life.
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.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#11 Post by disciple »

Code: Select all

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...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#12 Post by zigbert »

Plus this as well.
Thank you

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#13 Post by trio »

HOLY WOW!!!!!

Please anybody can find a really complete guide of gtk-dialog!!!! Many hidden features there may be .......

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#14 Post by vovchik »

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

Post Reply