Hi.
I want to have option to click an object in a gtkdialog gui to execute the default browser calling a specific website.
I know, I could use just a button and its <action></action> section.
But I would like to have just a text object to click, to execute the default browser calling a specific website.
Is this somehow possible by a text object or am I hooked to use <eventbox></eventbox> wrapping around the text object?
Thanks.
A text object to click to call any action... (Solved)
- LazY Puppy
- Posts: 1934
- Joined: Fri 21 Nov 2014, 18:14
- Location: Germany
A text object to click to call any action... (Solved)
Last edited by LazY Puppy on Fri 15 Apr 2016, 00:21, edited 1 time in total.
RSH
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
I made a clickable text like this for my adobe flash updater.
Link markup text
Eventbox action
Link markup text
Code: Select all
LINK2="<b><u><span color='"'blue'"'>http://www.murga-linux.com/puppy/viewtopic.php?t=84267</span></u></b>"
Code: Select all
<eventbox tooltip-text=" Flash Player PETs Forum Thread " hover-selection="true" homogeneous="true">
<text wrap="false" justify="2" use-markup="true"><label>"'$LINK2'"</label></text>
<action signal="button-press-event">defaultbrowser http://www.murga-linux.com/puppy/viewtopic.php?t=84267 &</action>
</eventbox>
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Yes, it's possible if you set the selectable attribute. But it comes at a price: The mouse cursor will change to a beam cursor, which is kind of strange for a link, the text cursor will appear in the text when clicked and lastly you may want to make sure that the text doesn't get the focus at startup. All things considered an eventbox may be the better choice.
Code: Select all
#!/bin/sh
LNK='http://www.murga-linux.com/puppy/viewtopic.php?p=836007#836007'
function linkstyle { echo -en "<span underline='single' color='blue'>$1</span>" ;}
export -f linkstyle
echo -n '<vbox>
<hbox>
<text>
<label>"For more info about press events"</label>
</text>
<text selectable="true" use-markup="true">
<input>linkstyle "click here"</input>
<action signal="button-press-event">defaultbrowser '$LNK'</action>
</text>
</hbox>
<button has-focus="true"></button>
</vbox>'|gtkdialog -s
- Attachments
-
- Screenshot.png
- (3.1 KiB) Downloaded 359 times
- LazY Puppy
- Posts: 1934
- Joined: Fri 21 Nov 2014, 18:14
- Location: Germany
Thanks for the replies.
I will build this wrapping the text object by eventbox.
I will build this wrapping the text object by eventbox.
RSH
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
I didn't know. This thread has been added to our gtkdialog - tips and tricksMochiMoppel wrote:Yes, it's possible if you set the selectable attribute...Code: Select all
<text selectable="true" use-markup="true"> <input>linkstyle "click here"</input> <action signal="button-press-event">defaultbrowser '$LNK'</action> </text>
Thanks for sharing