Hulahop Webview widget closes parent(s) when hidden
George Hunt
georgejhunt at gmail.com
Fri Oct 16 07:34:59 EDT 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20091016/b1fc9967/attachment.html>
More information about the Devel
mailing list