intfiction.org

The Interactive Fiction Community Forum
It is currently Thu May 23, 2013 7:35 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Jul 02, 2011 3:07 pm 
Offline

Joined: Sat Jul 02, 2011 1:42 pm
Posts: 10
Greetings,
This is my first post and it's a problem that is driving me nuts, so thanks in advance if anyone can help.
I have created a project with two side windows using Glimmer, one for graphics and one for text
I can implement hyperlinks using Emily's Basic Hyperlinks in the main window just fine (I have just been using the link to execute "go north" for test purposes.)
I can create a hyperlink in the subwindow. When I click on the subwindow hyperlink, however, nothing happens.The text is hyperlinked but executes nothing. It looks like a window focus issue, that clicking on the link in the sub-window shifts focus and so Inform doesn't execute the go north command.
Anyone know what my problem is and is there any i7 source code examples of hyperlinked text in a subwindow that I could be referred to?
Thanks

Update:
If it helps, even when I use Emily's Basic Hyperlinks in the main window, clicking on the hyperlink execute "go north" but the game does not return to the command prompt (">") until I type in a new command. So it seems I must be ignorant on some basic point of window control/focus with hyperlink commands


Top
 Profile Send private message  
 
PostPosted: Sat Jul 02, 2011 8:55 pm 
Offline

Joined: Wed Oct 27, 2010 6:15 pm
Posts: 239
I think what you need is in Section 2.5 of the Flexible Windows documentation:
Jon Ingold wrote:
Opening a new window is an activity that gets called for the pending window. This activity is the "constructing something" activity, and it's used to set background colours, neatly arranged unpositioned new windows, and apply the minimum width rules. New rules can be written before and after this activity. These rules may refer to "the pending g-window"; note that before, this window will not yet be in existence on the screen but its properties can be changed, and after it should be present on the screen.

Should you want to make changes to the styles for the windows, this is also the place to do it (see the Glk spec for more information on this). During the before phase, set the stylehint you want. During the after phase, remove it again, so that it doesn't affect other newly created windows. (See background colour rules for an example of this).

For example: windows containing hyperlinks need to be "hyperlink-activated" before each click. To do this, use the following phrases:
Code:
After constructing the conversation-window:
   expect links in conversation-window.
To expect links in (g - a g-window):
   (- glk_request_hyperlink_event({g}.ref_number); -).

After constructing is a good entry point for this, as it's after the window has appeared but before anything's been drawn inside it.

Then after a link has been handled, you'll need to call this phrase again to reset hyperlink-watching.


Top
 Profile Send private message  
 
PostPosted: Sun Jul 03, 2011 12:39 am 
Offline

Joined: Thu Oct 22, 2009 4:31 pm
Posts: 1137
Actually, Flexible Windows now does all of that management for you automatically, as long as you don't include Basic Hyperlinks in your project. (You don't need Basic Hyperlinks, because FW provides the same hyperlink functionality for all windows, including the status window and any new windows you might create.) See section 6.2 (I believe) of the FW docs for more info.

--Erik

_________________
Glimmr: Advanced Graphics for I7
blog | download | bug-tracker


Top
 Profile Send private message  
 
PostPosted: Sun Jul 03, 2011 5:47 am 
Offline

Joined: Sat Jul 02, 2011 1:42 pm
Posts: 10
This brings me to a second problem I held off on.
I have been using short's hyperlinks despite reading the Flexible Windows documentation because of an error that is produced every time I try to use Flexible Windows.
Tagging the hyperlink in the text is causing this error and this is stymieing me since it is listed in the documentation this way. Here's a stripped version of the code -- this is the whole program for test purposes.

Code:
Include Flexible Windows by Jon Ingold.

The subtext-window is a text-buffer g-window spawned by the main-window.
The measurement of the subtext-window is 40.
 The position of the subtext-window is g-placeright.

When play begins:
   open up the subtext-window;

When play begins:
   move focus to subtext-window, clearing the window;
   say "[set link 1]go north[end link];"
   return to main screen;
   
Start is a room.  "This is a cool starting room with a [set link 2]Hyperlink[end link]."
Finish is north of start.


This produces the error message:
Problem. In the line '"This is a cool starting room with a [set link 2]Hyperlink[end link]."' , I was expecting that 'set link 2' would be something to 'say', but it didn't look like any form of 'say' that I know. So I tried to read 'set link 2' as a value of some kind (because it's legal to say values), but couldn't make sense of it that way either.

BTW - I added the second link just to see if writing the first one in a When play begins rule was the problem. Both produce the error message

Thanks again -- this error seems to go directly against the extension doc syntax in 6.2 so I'm stumped.


Top
 Profile Send private message  
 
PostPosted: Sun Jul 03, 2011 6:27 am 
Offline

Joined: Thu Oct 22, 2009 4:31 pm
Posts: 1137
Sorry about that. This is an issue with the v11 Flexible Hyperlinks docs--the syntax is simply "link 1" rather than"set link 1" as in Basic Hyperlinks. A simple global search-and-replace for set link/link will fix it. Version 12 of FW (on the extensions site) fixes this documentation error.

--Erik

_________________
Glimmr: Advanced Graphics for I7
blog | download | bug-tracker


Top
 Profile Send private message  
 
PostPosted: Sun Jul 03, 2011 6:37 am 
Offline

Joined: Sat Jul 02, 2011 1:42 pm
Posts: 10
AWESOME! Documentation errors happen, I'm just ecstatic that it works -- compiles fine, now I can use subwindow hyperlinks -- my command prompt shows up again, everything. Thanks Erik.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group