Hello,
I'm trying to create a simple html editor. My base idea is to have the untitled file named "untitled.html", and when the user presses the "Run" button, the untitled html file gets saved, and a separate window opens showing the html file. My idea works, because I can open my html file in my browser, and it shows. But the html view won't show it. Is it because html views can only open a url that's on the web? Or am I missing something else? Here's the code:
While WaitEvent()
Print CurrentEvent.ToString() '// This is for debugging
Select EventID()
Case EVENT_WINDOWCLOSE
Select EventSource()
Case window '// The editor window
End
Case render '// The render window
End
End Select
Case EVENT_GADGETACTION
Select EventSource()
Case RunButton '// If the user presses the Run button
Local stream:TStream = WriteFile(AppDir + "untitled.html") '// Prepare our file for writing
WriteLine stream, GadgetText(EditorText) '// The HTML code
HtmlViewGo htmlview, AppDir + "untitled.html" '<-- This is the problem, htmlview won't show this file
EndSelect
End Select
Wend
|