[Iup-users] iup.webbrowser Lua
Brought to you by:
scuri
From: 阳光 <su...@su...> - 2013-06-08 03:38:06
|
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 |