Hulahop Webview widget closes parent(s) when hidden
Sayamindu Dasgupta
sayamindu at gmail.com
Fri Oct 16 08:44:11 EDT 2009
Hi George,
It may be possible that WebView is crashing for you. We saw this
sometime back for the French Help activity - the latest working code
is in http://git.sugarlabs.org/projects/helpfr/repos/mainline/trees/master
Thanks,
Sayamindu
On Fri, Oct 16, 2009 at 5:04 PM, George Hunt <georgejhunt at gmail.com> wrote:
> Hi everybody,
>
> I have been trying to use the WebView widget from hulahop to display
> documentation in an Activity.
>
> I don't have enough experience to know where to start looking to fix the
> problem I'm having:
>
> The following test program shows the different widget behavior comparing
> gtk.Textview with hulahop.Webview:
>
> #!/usr/bin/env python
> #test program to show the different widget behaviors webview vs textview
> import os
> import hulahop
>
> from sugar import env
> hulahop.startup(os.path.join(env.get_profile_path(), 'gecko'))
>
> from hulahop.webview import WebView
>
> import gtk
> tvon=True
> wvon=True
> def clicked_cb(widget):
> global tvon
> if tvon :
> tvwidget.hide()
> else:
> tvwidget.show()
> tvon = not tvon
>
> def wv_clicked_cb(widget):
> global wvon
> if wvon :
> wvwidget.hide()
> else:
> wvwidget.show()
> wvon = not wvon
>
> win = gtk.Window(gtk.WINDOW_TOPLEVEL)
> #nb = gtk.Notebook()
> vb = gtk.VBox()
> vb.show()
>
> #two buttons to toggle the widgets' visibility
> tvbutton = gtk.Button('togle textview')
> tvbutton.show()
> tvbutton.connect('clicked',clicked_cb)
> vb.pack_start(tvbutton)
> wvbutton = gtk.Button('togle Webview')
> wvbutton.show()
> wvbutton.connect('clicked',wv_clicked_cb)
> vb.pack_start(wvbutton)
>
> wvwidget = WebView()
> tvwidget = gtk.TextView()
> wvwidget.load_uri('http://wiki.laptop.org/go/Guido_van_Robot')
> wvwidget.show()
> tvwidget.show()
> vb.pack_start(tvwidget)
> vb.pack_start(wvwidget)
>
> win.add(vb)
>
> win.show()
> gtk.main()
>
>
> The observed behavior, first observed in a notebook container, is that when
> the button that toggles textview visibility is clicked, the expected
> repacking of the vbox occurs. But when the webview toggle button is clicked,
> the mainwindow closes, but the mainloop does not return (I need to do <clt>C
> to get back a terminal prompt).
>
> Does anyone know if there is a property of widgets that would control this
> behavior? What's the best way to start attack this problem? Where in the
> hulahop source should I start looking?
>
> Thanks
> George
>
> _______________________________________________
> Devel mailing list
> Devel at lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
>
--
Sayamindu Dasgupta
[http://sayamindu.randomink.org/ramblings]
More information about the Devel
mailing list