Re: gtk.HTML class nonexistent [was: Re: [pygtk] Computing optimum size of gtkhtml2.View]
On Fri, Aug 15, 2008 at 9:53 PM, Sven Neumann [EMAIL PROTECTED] wrote: Hi, On Fri, 2008-08-15 at 19:20 +, Luke Kenneth Casson Leighton wrote: 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. What's wrong with using gtk.Label(bhello/b, use_markup=True) ? haven't got a clue - inexperience led me to believe that didn't exist? :) will let you know tomorrow - thanks for pointing it out. i've got a long way in a short period of time, but will quite literally be covering absolutely every single feature of python-gtk2 (and python-qt4) so was bound to miss something, somewhere. if it works, it means that one of the big show-stoppers on pyjamas-desktop-gtk2 is gone. i still have quite a list of other things - the functionality of gtkhtml3's object_requested is _perfect_ for what i need for HTMLPanel() (see http://code.google.com/p/pyjamas or google webkit they're both the same except one is a python-to-javascript compiler, the other is a java-to-javascript). an HTMLPanel() you can insert Widgets into the HTML. gtkhtml3 provides exactly this functionality, passing you the classid in when you catch the signal. ... except... python-gtkhtml3 doesn't exist: i hear that gtkhtml2 and gtkhtml3 are being dropped in favour of webkit. so, i have to find out if webkit supports that type of functionality. l. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gtk.HTML class nonexistent [was: Re: [pygtk] Computing optimum size of gtkhtml2.View]
What's wrong with using gtk.Label(bhello/b, use_markup=True) ? haven't got a clue - inexperience led me to believe that didn't exist? :) ok - couldn't wait until tomorrow. i found out why it can't be used: pango markup doesn't support the full syntax of HTML that applications would expect to use. div and code - basic HTML tags - aren't supported. also, some apps use the (awful) a href= javascript:return false; click here /a trick to create a hyperlink, purely to get the cursor to change to link. then they capture click signals on the Label (yes i found out about the trick of creating an Event box around Labels :). python-gtkhtml2 was adequate to support this kind of trick, as is pywebkitgtk. Label.set_use_markup would, unfortunately, not do the trick. worth exploring, though - thanks sven. l. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gtk.HTML class nonexistent [was: Re: [pygtk] Computing optimum size of gtkhtml2.View]
Am Fri, 15 Aug 2008 19:20:10 + (UTC) schrieb Luke Kenneth Casson Leighton [EMAIL PROTECTED]: 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 bhello /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. Hey Luke, it's nice to see someone content with WebKit. You should like to see this bug: https://bugs.webkit.org/show_bug.cgi?id=17154 There is actually an unfinished patch. So if someone wants that feature you are welcome to look into it. ciao, Christian ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gtk.HTML class nonexistent [was: Re: [pygtk] Computing optimum size of gtkhtml2.View]
On Fri, 2008-08-15 at 19:20 +, Luke Kenneth Casson Leighton wrote: 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. i haven't looked at GtkHtml, but i would imagine that this has some relevance: http://library.gnome.org/devel/pango/unstable/PangoMarkupFormat.html ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list