[webkit-dev] gtk.HTML class nonexistent [was: Re: [pygtk] Computing optimum size of gtkhtml2.View]

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri Aug 15 12:20:10 PDT 2008

folks, hi, just an update: i was advised kindly to look at pywebkitgtk - which i
downloaded and compiled from source, this morning. _wow_ am i dead impressed
with this project!  the demo browser example ran my javascript-only web site,
http://lkcl.net and it _nearly_ managed to run my javascript-only site i'm
developing, http://partyliveonline.com - except it segfaulted after login. 
_wow_ would i have been so impressed if it had worked first time :)  the concept
of having a standards-compliant browser, integrateable into apps using python...
_wow_ :)

anyway: i added in pywebkitgtk instead of python-gtkhtml2 and was pleased to
find that it worked absolutely perfectly to provide [a missing] gtk.HTML-like
widget.  what i was _less_ impressed with is that it suffers *exactly* the same
flaw that python-gtkhtml2 has: a widget created with pywebkitgtk *cannot* tell
you what its width and height is, and so, if you insert it into an app, and the
app size "shrinks", the HTML - even if it's one line of HTML - gets "chopped off".

there's no enforcement of HTML content "size" communicated back to the
gtk.Widget "container".

thus, sadly, pywebkitgtk is as useless as python-gtkhtml2 for doing the simple,
simple job of putting HTML as simple as " < b>hello< /b >" into an application.

also i haven't checked yet if "object_requested" is supported in pywebkitgtk or
its equivalent - i hope so, because it's absolutely essential functionality .

qt4 has support for "Rich Text" - simple things like "< b >hello< /b >" can be
detected and displayed, and the size of the box is "enforced" as a minimum width
and height onto the application.

it's _essential_ that GTK have similar such functionality.  implementing these
features "outside" of the core gtk widget set - using pygtk2 alone - registers
on the "awkward to literally impossible" scale.


p.s. for those people on the gtk-devel mailing list, information on the
context for this message can be found at: http://advogato.org/person/lkcl
and at http://lkcl.net/pyjamas-desktop - i am porting pyjamas - the
python-to-javascript compiler - to pygtk2 _and_ pyqt4 _and_ iron-python
with gtk-sharp _and_ i will be looking at qyoto, at a later date.
see http://lkcl.net/pyjamas-desktop - pygtk2.tgz for progress on the
python-gtk2 port.

On Thu, Aug 14, 2008 at 7:06 AM, Luke Kenneth Casson Leighton
<luke.leighton at googlemail.com> wrote:
> ok.  thanks sam.
> to gtk developers: i'm going to have to terminate work on
> python-desktop's gkt2 widget set until a solution is available:
> python-gtkhtml3 or other solution.  it's simply not ok to have widgets
> that force you to specify both the width and the height, and if you
> don't do so, they just... don't work.
> python-gtkhtml2 views, if you specify only the width, the height
> remains at zero: that's unacceptable.
> in gtk-sharp, Gtk.HTML works absolutely fine (iirc correctly)
> l.
> On Wed, Aug 13, 2008 at 10:15 PM, Sam Varshavchik <mrsam at courier-mta.com> wrote:
>> Luke Kenneth Casson Leighton writes:
>>> sam, hi,
>>> did you ever receive a reply - or find a solution - to this question?
>>> for http://lkcl.net/pyjamas-desktop i'm looking for the way to calculate
>>> a sensible size for gtkhtml2.Views, based on the HTML inside.  at present,
>>> exactly as you probably found, a popup dialog is created... with zero
>>> width
>>> and height.
>>> only by having set the width to a fixed pixel size is the dialog turning
>>> out to be 1 pixel high (and 218 pixels wide), and the user application
>>> chose
>>> that.
>> Nope.

More information about the webkit-dev mailing list