Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3679

Using HTMLViewer on MacOS and WebView2 on Windows

$
0
0

Hi all,

I have an app that displays some HTML content. On MacOS, I use a DesktopHTMLViewer and all is well. On Windows, I want to avoid the huge filesize overhead of the HTMLViewer and want to use MBS WebView2 instead.

I have two windows: wnd_HTMLMac and wnd_HTMLWin, wnd_HTMLMac uses the HTMLViewer while wnd_HTMLWin uses WebView2:

Sub Pressed() Handles Pressed
  #If TargetMacOS Then
     wnd_HTMLMac.ShowModal Self
#ElseIf TargetWindows Then
     wnd_HTMLWin.ShowModal Self
#EndIf
End Sub

The problem is when I compile for Windows, the Chromium runtime files are still included because it’s the same project file as the Mac version. The majority of the code is shared between the Mac version and the Windows version.

How can I tell the Xojo compiler to only include wnd_HTMLMac on the MacOS compile and only include wnd_HTMLWin on the Windows compile? I don’t want to have to maintain two different project files because that would be a nightmare to make changes to logic that is shared between the platforms, and also to keep track of version numbers and such.

Thanks in advance.

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3679

Trending Articles