Hi
I saw FWH\sample use TWindow way, how to use WebView into Resource Dialog
Webview class into Resource Dialog?
- richard-service
- Posts: 808
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Has thanked: 2 times
- Contact:
Webview class into Resource Dialog?
Best Regards,
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: Webview class into Resource Dialog?
Dear Richard,
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
local oDlg, oWebView
DEFINE DIALOG oDlg SIZE 500, 400
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ), .T. )
return nil
- richard-service
- Posts: 808
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Has thanked: 2 times
- Contact:
Re: Webview class into Resource Dialog?
Dear Antonio,Antonio Linares wrote:Dear Richard,
Code: Select all | Expand
#include "FiveWin.ch" function Main() local oDlg, oWebView DEFINE DIALOG oDlg SIZE 500, 400 ACTIVATE DIALOG oDlg CENTERED ; ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ), .T. ) return nil
Thanks for your help.
I open my Main Window and call TestWebview() function below:
Code: Select all | Expand
FUNCTION TestWebView()
LOCAL oDlg, oWebView
DEFINE DIALOG oDlg RESOURCE "TestWebView"
ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ) , .T. )
return nil
Best Regards,
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: Webview class into Resource Dialog?
Dear Richard,
Yes, I just confirmed what you said
No idea why this is happening, sorry
Yes, I just confirmed what you said
No idea why this is happening, sorry
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: Webview class into Resource Dialog?
It seems as WebView is closing the whole app
I don't know how we can avoid this behavior.
I don't know how we can avoid this behavior.
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: Webview class into Resource Dialog?
In this example, we can check that when the dialog that holds the WebView closes, it closes the main Window but the app properly exits:
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd ;
ON CLICK Test()
MsgInfo( "ok" )
return nil
function Test()
local oDlg, oWebView
DEFINE DIALOG oDlg SIZE 500, 400
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ), .T. )
return nil