Prereqs for Webkit HTMLViewer on Windows?

In the IDE on Windows, I’m doing this:

htmlSource = “Hi”

#if TargetMacOS
HTMLViewer1.LoadPage htmlSource, Nil
#else
HTMLViewer1.LoadPage htmlSource, SpecialFolder.Temporary
#endif

If I set the HTMLViewer renderer to Native, it works as expected, but if I change it to Webkit, nothing renders at all. The controls just remains invisible.

I don’t have Safari installed on my Windows PC, so I figured I’d need to compile the build from my Mac. So I did that, then ran the Windows executable on my PC, so still, no HTMLViewer visible. Isn’t the build process supposed to package Webkit along with my Windows build?

Chris,

I believe this is a known issue. See <https://xojo.com/issue/34277>

Hm, I’m not sure how to find that. Do you have a working link?

What you entered came across as this:

https://xojo.com/issue/34277

have you install the feedback program yet??

Ah, just did. When I started with RB, all the feedback was web-based.

Yep, that’s definitely the same bug. Well, that sucks. Since the Windows native renderer doesn’t match Webkit, I can’t use it.

It says the bug’s been fixed. Any idea when that fix will be released?

It is scheduled for 2014r2.1, which is currently in beta testing.

[quote=115814:@Chris Kohout]In the IDE on Windows, I’m doing this:

htmlSource = “Hi”

#if TargetMacOS
HTMLViewer1.LoadPage htmlSource, Nil
#else
HTMLViewer1.LoadPage htmlSource, SpecialFolder.Temporary
#endif

If I set the HTMLViewer renderer to Native, it works as expected, but if I change it to Webkit, nothing renders at all. The controls just remains invisible.

I don’t have Safari installed on my Windows PC, so I figured I’d need to compile the build from my Mac. So I did that, then ran the Windows executable on my PC, so still, no HTMLViewer visible. Isn’t the build process supposed to package Webkit along with my Windows build?[/quote]

The LR clearly specifies the FolderItem in the LoadPage method is a file.

This works perfectly on Mac, Windows, Native, Webkit (just tried) :

Sub Action() dim htmlSource as string = "<html><body>Hi</body></html>" HTMLViewer1.LoadPage htmlSource, SpecialFolder.Temporary.child("myfile.html") End Sub

The Xojo gods must be smiling on you. I get the same behavior.

The Xojo gods must be smiling on you. That didn’t make any difference for me.

I’m not getting the same results Michel. The HTMLViewer control is still invisible.

FYI - building on Win 8.1 with Xojo 2014r2

[quote=115836:@Jim Cramer]I’m not getting the same results Michel. The HTMLViewer control is still invisible.

FYI - building on Win 8.1 with Xojo 2014r2[/quote]

oops !

Well. I can confirm this will be solved in 2.1 :wink: Sorry.

The bug is still here in 2.

You do not need to wait for 2.1. Here is a method I tested with 2014R2 :

Sub Action() dim htmlSource as string = "<html><body>Hi</body></html>" dim f as FolderItem = SpecialFolder.Temporary.child("mypage.html") Dim t As TextOutputStream If f <> Nil Then t = TextOutputStream.Create(f) t.WriteLine(htmlSource) t.Close End If HTMLViewer1.LoadURL(f.URLPath) End Sub

To avoid accidental collision with other apps, or even with other uses of the same method, you may want to change “mypage.html” to something like str(microseconds)+"mypage.html".

While I don’t like writing files out to disk every time I want to render something, it did work for me in 2014R2. This will do until the bug is fixed.

Thanks!

You will soon have 2.1, which may very well do exactly the same thing behind the curtain. Otherwise I see no reason to use a FolderItem. The nice thing is that you now don’t need to check for platform.