Hi everyone,
I have a question for "iup.webbrowser":
This is a simple web browser with "iup.webbrowser", it can show a link "Hello
Lua" and click the link can goto "http://www.lua.org". Now, I wish abort the
navigation.
IUP Guide give a Callbacks function:
-----------------------------------------------------------------------
NAVIGATE_CB: action generated when the browser requests a navigation to another
page. It is called before navigation occurs. Can be called multiple times when
a frame set loads its frames, or when a page loads also other pages.
Returns: IUP_IGNORE will abort navigation (since 3.4).
-----------------------------------------------------------------------
This is my code (WINXP, lua for windows 5.1.4-46 and IUP 3.5), "NAVIGATE_CB"
can catch the navigation's requests but can not abort it. what is wrong?
-----------------------------------------------------------------------
require('iuplua')
require('iupluaweb')
local MyWeb = iup.webbrowser{}
function MyWeb:navigate_cb(url)
iup.Message('', url)
return IUP_IGNORE
end
MyWeb.HTML = [[
<HTML>
<BODY>
<A HREF="http://www.lua.org">Hello Lua</A>
</BODY>
</HTML>
]]
local MainForm = iup.dialog{
title = 'HELLO',
size = 'HALFxHALF',
MyWeb,
}
MainForm:show()
iup.MainLoop()
-----------------------------------------------------------------------
Thank you very much.
Best Regards
Sunus Yang
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users