Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   url in a gui window (https://forums.graalonline.com/forums/showthread.php?t=62514)

prozac424242 11-27-2005 02:41 AM

url in a gui window
 
How do I put an url in a gui text window?
I am using the GuiMLTextProfile
and in the text="<a href=http://url.here>link here</a>";
the link can be clicked on
but no web page opens.
I searched these forums and the wiki but could not find an answer.

What I found on the wiki on page http://wiki.graal.us/GScript#GuiMLTextCtrl: and am using is this
PHP Code:

<a href=urltext </a> - when the user clicks on 'text' then 
  a web browser is opened 
for the specified url 

but no web browser pops up when i click the link...

Raeiphon 11-27-2005 04:34 AM

Are you sure this isnt a technical problem conserning your browser?

I know firefox has a long warmup time, and sometimes flags in other programs arent picked up by it.

napo_p2p 11-27-2005 06:16 AM

Quoted from the very same part of the page you linked to:
Quote:

onURL(url) when clicked on url
;)

prozac424242 11-28-2005 06:32 AM

The onURL(url) command
has insufficient documentation for it to be useful (as is the case with much of the wiki).
I could find no example of it in use.
I understand that the http://website.address.com goes betweek the parentheses, but where does the text for what you want the user click on go?

napo_p2p 11-28-2005 07:14 AM

Look what happens when you try:
PHP Code:

function onURL(url) {
  
openURL(temp.url);



Lance 11-28-2005 07:50 AM

Please post GS2-specific questions in the GS2 subforum. Redirects will be left for now for convenience.

prozac424242 11-28-2005 03:37 PM

Well nano, I tried it, and I see that nothing happens.
no link shows up in the text place regardless of where I add that code.

PHP Code:

        new GuiMLTextCtrl("Welcome_Text") {

          
profile "GuiMLTextProfile";
             function 
onURL(url) {openURL(temp.url);}
          
position "15 25";
          
extent "500 50";
          
text "<img src=orb6.gif id=1><shadow:1:1><shadowcolor:000000>Welcome to Sanstrata Classic, " @player.nick;
           } 

that block of code is of course within a GuiWindowCtrl. The welcome message shows up, I see the welcome message, but there is no link.
I tried putting the function in the text string too, but all that does is convert the function to display text. I tried putting it where the @player.nick is but that does not show anything either.

What am I doing wrong here?

Riot 11-28-2005 11:16 PM

First off, I do not see a URL in what you posted. URLs are defined using the standard HTML <a href> tag or the Torque script <a:url>, also do not include the http://.

Try using a catch event instead.
HTML Code:

thiso.catchevent(name, "onURL", "urlClicked");
Then add to somewhere in the code:
HTML Code:

function urlClicked(obj, url) openURL(url);


All times are GMT +2. The time now is 09:39 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.