Re: wxEuphoria: how can I INTERCEPT html link clicks?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Okay, I got it now... grin

From wxHtmlWindow docs:

[quote=wxWidgets] Called when user clicks on hypertext link. Default behaviour is to emit a wxHtmlLinkEvent and, if the event was not processed or skipped, call LoadPage and do nothing else. Overloading this method is deprecated; intercept the event instead. [/quote]

So we must do this instead:

procedure on_link_click( atom this, atom event_type, atom id, atom event ) 
 
    atom link 
    sequence href, target 
     
    link = get_link_event_info( event )  -- wxHtmlLinkInfo object 
    href = get_link_href( link )         -- clicked url href 
    target = get_link_target( link )     -- target frame, unused 
     
    -- if the event was not processed or skipped, 
    -- call load_html_page and do nothing else 
     
    load_html_page( html, href ) 
     
end procedure 
set_event_handler( html, get_id(html), wxEVT_COMMAND_HTML_LINK_CLICKED, routine_id("on_link_click") ) 


I had to update wxEuphoria to support this. I've made some other addtions/revisions as well. I'll try to push out a new version ASAP. I guess one release per month wouldn't be too bad... getlost

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu