Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 01 Oct 2014, 20:43
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
ptooltips 0.2
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
zigbert


Joined: 29 Mar 2006
Posts: 5729
Location: Valåmoen, Norway

PostPosted: Thu 30 Jul 2009, 09:56    Post_subject:  ptooltips 0.2
Sub_title: 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

Edited_times_total
Back to top
View user's profile Send_private_message Visit_website 
trio


Joined: 21 Dec 2008
Posts: 1788
Location: अनुमोदना

PostPosted: Thu 30 Jul 2009, 10:02    Post_subject:  

Hmm,

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

_________________
PET Maker|WbarCC|My Website
Back to top
View user's profile Send_private_message 
zigbert


Joined: 29 Mar 2006
Posts: 5729
Location: Valåmoen, Norway

PostPosted: 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
View user's profile Send_private_message Visit_website 
01micko


Joined: 11 Oct 2008
Posts: 7805
Location: qld

PostPosted: 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! Smile

Mick
tooltips.jpg
 Description   
 Filesize   37.62 KB
 Viewed   1029 Time(s)

tooltips.jpg


_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
zigbert


Joined: 29 Mar 2006
Posts: 5729
Location: Valåmoen, Norway

PostPosted: 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
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: 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
View user's profile Send_private_message Visit_website 
01micko


Joined: 11 Oct 2008
Posts: 7805
Location: qld

PostPosted: Fri 31 Jul 2009, 20:31    Post_subject:  

Thanks Sigmund

Turns out ptooltips is not the right tool for what I was looking. Smile . Still put it to good use though.

Mick

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
zigbert


Joined: 29 Mar 2006
Posts: 5729
Location: Valåmoen, Norway

PostPosted: Sat 01 Aug 2009, 11:59    Post_subject:  

Version 0.2

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

_________________
Stardust resources
Back to top
View user's profile Send_private_message Visit_website 
disciple

Joined: 20 May 2006
Posts: 6439
Location: Auckland, New Zealand

PostPosted: Mon 03 Aug 2009, 02:39    Post_subject:  

You almost need a mailing list or something to announce all your new creations Smile
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
zigbert


Joined: 29 Mar 2006
Posts: 5729
Location: Valåmoen, Norway

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

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
disciple

Joined: 20 May 2006
Posts: 6439
Location: Auckland, New Zealand

PostPosted: 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 Smile
I wonder what other hidden features there are...

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
zigbert


Joined: 29 Mar 2006
Posts: 5729
Location: Valåmoen, Norway

PostPosted: Wed 05 Aug 2009, 05:28    Post_subject:  

Quote:
Plus this as well.

Thank you

_________________
Stardust resources
Back to top
View user's profile Send_private_message Visit_website 
trio


Joined: 21 Dec 2008
Posts: 1788
Location: अनुमोदना

PostPosted: 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 .......

_________________
PET Maker|WbarCC|My Website
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: 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
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0895s ][ Queries: 12 (0.0162s) ][ GZIP on ]