New topic: 

More HTMLViewer woes...

<http://forums.realsoftware.com/viewtopic.php?t=23891>

       Page 1 of 1
   [ 8 posts ]                 Previous topic | Next topic         Author  
Message       Lazze           Post subject: More HTMLViewer woes...Posted: Mon 
Aug 11, 2008 4:31 am                        
Joined: Thu Jul 27, 2006 7:32 am
Posts: 71
Location: Esbjerg, Denmark              The HTMLViewer causes me quite some 
problems. Half the time a window is opened with a HTMLViewer, it only renders a 
blank/white page (or renders nothing?!). Refreshing it doesn't seem to help - 
closing and reopening the window a couple of  times does.
I imagine I'm encountering one of the bugs in this control. Any suggestions to 
a work-around?     
_________________
Why make it simple if it can be made complicated? 
http://www.laniesoftware.com  
                            Top               wademaxfield           Post 
subject: Re: More HTMLViewer woes...Posted: Mon Aug 11, 2008 8:21 am            
            
Joined: Wed Feb 21, 2007 6:28 pm
Posts: 264              Your request for help has too little information.

  What OS?

  What HTMLViewer call is being made?

  What URL are you going for?

---------------------------
Comments:

  HTMLViewer acts differently on different OS's.  That is because they use the 
"native" viewer whenever possible, from what I can tell.

 Windows, Linux: You can't load a page from within any HTMLViewer event.
 Mac: you can

  I solved my "it doesn't work" problems by enabling a timer in another window 
(maybe you could do it in the same window) and in that timer have the URL for 
the page be loaded.
Code:
in htmlviewer:

otherwindow.timer1.mode = timer.modemultiple
otherwindow.timer1.enabled = true

other window in timer1:

me.enabled = false
windowwiththtmlviewer.HTMLViewer.LoadURL(...)




 Doing it this way allowed it to work on all platforms.   
                            Top               Lazze           Post subject: Re: 
More HTMLViewer woes...Posted: Mon Aug 11, 2008 8:51 am                        
Joined: Thu Jul 27, 2006 7:32 am
Posts: 71
Location: Esbjerg, Denmark              I'm on Mac OSX 10.5.4 (this is the 
Macintosh board...  )

I have a HTMLViewer covering the entire window, and it loads Google maps, using 
HTMLViewer.LoadPage URL,GetTemporaryFolderItem

The problem is, I can't see any pattern in when it works and when it doesn't - 
but I do see quite a few complaints about bugs in the Mac HTMLViewer, similar 
to the one I'm encountering.     
_________________
Why make it simple if it can be made complicated? 
http://www.laniesoftware.com  
                            Top               wademaxfield           Post 
subject: Re: More HTMLViewer woes...Posted: Mon Aug 11, 2008 2:54 pm            
            
Joined: Wed Feb 21, 2007 6:28 pm
Posts: 264              On the Mac, SpecialFolder.CurrentWorkingFolder (Or 
SpecialFolder.*anything legal here*) causes an error on page load, sometimes, 
most of the time, your mileage may vary.  I have not filed a bug report, as 
Real's definition of bugs is different than mine. (That is not to say they 
won't consider that a bug.  They might, but I've given up.  In any case, you 
may not be able to wait 6 months for a fix.)

  Try GetFolderItem("") for the current working folder. I've seen that always 
work on the Mac with LoadPage(). 

  The GetFolderItem() trick also works in the debugger.  I've seen different 
releases of RB break or fix the debugger's use of 
SpecialFolder.CurrentWorkingFolder, and I've reported the breakage and got a 
"not a bug" reply.

  In Windows, LoadPage() creates  a web page in the working directory passed as 
the second parameter.  You have to manually delete it.  I delete it in the 
DocumentComplete() event (which seems to work so far).  The URL passed is the 
web page that Windows created, IIRC. In Windows, the SpecialFolders work.

  Conversely, Mac doesn't create a web page in the working directory (even if 
you have write access). 

 Linux, I'm not sure. I don't remember seeing it do that, or I would have 
deleted that file.  In Linux, the SpecialFolders work.   
                            Top               Lazze           Post subject: Re: 
More HTMLViewer woes...Posted: Mon Aug 11, 2008 3:45 pm                        
Joined: Thu Jul 27, 2006 7:32 am
Posts: 71
Location: Esbjerg, Denmark              Thanks...

Your suggestion didn't cause it to crash but it didn't cure it either. I tried 
opening the window 10 times and it rendered a blank 4 out of 10... frustrating! 
But then again - I've seen similar complaints from other RB developers, so I'm 
not surprised.     
_________________
Why make it simple if it can be made complicated? 
http://www.laniesoftware.com  
                            Top               wademaxfield           Post 
subject: Re: More HTMLViewer woes...Posted: Mon Aug 11, 2008 4:45 pm            
            
Joined: Wed Feb 21, 2007 6:28 pm
Posts: 264              Try using LoadURL and see if it is different.

  The problem is (most likely) that it is timing out on the load.  LoadPage() 
may time out faster than LoadURL()   
                            Top               wademaxfield           Post 
subject: Re: More HTMLViewer woes...Posted: Mon Aug 11, 2008 4:50 pm            
            
Joined: Wed Feb 21, 2007 6:28 pm
Posts: 264              Another thing to try is to do the HTTPSocket and to an 
http.get(url, file, timeout) and then do a LoadPage() on the local file as the 
url.

  You may be able to not specify the file and get the page as a string and then 
use the loadpage(string,folder) event to load that string in the page received 
event for httpsocket.

  I've used httpsocket in the past successfully, doing both Get and Post 
functionality.  With Get, you just craft the URL.  With Post, you fill in the 
variables before you go after the web page.   
                            Top               Rich White           Post 
subject: Re: More HTMLViewer woes...Posted: Wed Aug 26, 2009 6:46 am            
            
Joined: Fri Sep 30, 2005 4:15 pm
Posts: 6
Location: Olathe, KS              For what it's worth, I finally got the Mac 
HTMLViewer to behave itself by putting it on top of a Placard control (making 
the Placard the parent control).  This seemed to get it to draw every time the 
window is opened now.  However, another problem started happening the first 
time the window is opened.  The top of the HTMLViewer's contents was not 
drawing at the Placard's top.  This was fixed by setting both control's "top" 
to something when the window opens...  weird - but finally working ok.

By the way, the Windows HTMLViewer would get messed up after the window is 
resized when using the "Placard fix".  I worked around by doing this in the 
"Resized" event:
HTMLViewer1.Visible=false
HTMLViewer1.Visible=true

("HTMLViewer1.Refresh" did not seem to work)   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 8 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to