<div dir="ltr">Do you need your activity run in old Sugar versions?<div style>Because hulahop is deprecated, and new Browse use webkit.</div><div style><br></div><div style>Gonzalo</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, May 16, 2013 at 11:40 AM, Frank Cancio <span dir="ltr"><<a href="mailto:frank@gsc.uy" target="_blank">frank@gsc.uy</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I have Flash activity in which all user interaction is done through<br>
Flash. Basically what I did was create a hulahop.webview.WebView<br>
instance and make it load a HTML (see code at the end) that load a<br>
.swf file in full screen. So far so good, the problem come when I try<br>
close the entire activity from inside Flash UI (with a close button).<br>
<br>
One solution I saw was try to enable the "window.close();" JavaScript<br>
sentence and then from the Flash app "execute it". I create a simple<br>
HTML file with just a button and a "window.close();" in the onclick<br>
event and make it work using the Browse activity. For that, I changed<br>
the gecko profile used by the Browse activity (setting the variable<br>
"dom.allow_scripts_to_close_windows" to true). That made possible<br>
close the entire Browse activity using the "window.close();"<br>
JavaScript sentence.  I did the same with my activity but nothing,<br>
even I made it using the same profile that worked for the Browse<br>
activity, but the "window.close();" JavaScript sentence don't work in<br>
my activity.<br>
<br>
I think that the problem is related to the way my activity manager the<br>
hulahop.webview.WebView instance. I know Python but I'm a completely<br>
newbie in GTK, Sugar and hulahop, and  is hard to me find out the<br>
problem. I write to this list hoping that someone with the enough<br>
experience in those tech could take few minutes and help me.<br>
<br>
Thanks in advance<br>
Frank<br>
<br>
hulahop.startup(os.path.join(env.get_profile_path(), 'gecko'))<br>
from hulahop.webview import WebView<br>
<br>
HTML = os.getcwd()+'/index.html'<br>
<br>
class SierratestActivity(activity.Activity):<br>
        def __init__(self, handle):<br>
                activity.Activity.__init__(self, handle, False)<br>
<br>
                canvas = gtk.HBox()<br>
                self.set_canvas(canvas)<br>
<br>
                self.browser = WebBrowser()<br>
<br>
                canvas.pack_start(self.browser.getBrowser(),True,True,0)<br>
                self.connect("destroy", self.destroy)<br>
                self.show_all()<br>
<br>
        def destroy(self, widget=None):<br>
                sys.exit(0)<br>
<br>
<br>
class WebBrowser():<br>
        def __init__(self):<br>
                self.browser = None<br>
<br>
        def getBrowser(self):<br>
                self.browser = WebView()<br>
                self.browser.load_uri(HTML)<br>
<br>
<br>
<br>
return self.browser<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.laptop.org">Devel@lists.laptop.org</a><br>
<a href="http://lists.laptop.org/listinfo/devel" target="_blank">http://lists.laptop.org/listinfo/devel</a><br>
</blockquote></div><br></div>