Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Native Web browser widget ?

62 views
Skip to first unread message

USCode

unread,
Feb 12, 2008, 4:54:01 PM2/12/08
to
Is there a Tk extension available that provides a cross-platform native
web browser widget for use in a Tk application? By "native" I mean it
would use IE on Windows, Safari on OSX and maybe Firefox on Linux.

This Tk web browser widget could then be used within a Toplevel like any
other Tk widget. We could then use that web browser widget to display
any media the native web browser supports such as web pages, movies,
flash, etc.

Kevin Walzer

unread,
Feb 12, 2008, 5:05:22 PM2/12/08
to

In a word: no.

There are Tk extensions that can embed IE, or at least ActiveX, controls
on Windows. However, there is no Tk-based wrapper for WebKit (on Mac) or
Mozilla/Gecko.

The closest thing that currently exists is TkHTML 3
(http://tkhtml.tcl.tk), which is very nice, but is still in alpha stage.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

USCode

unread,
Feb 12, 2008, 5:29:14 PM2/12/08
to
Kevin Walzer wrote:
>
> In a word: no.
>
> There are Tk extensions that can embed IE, or at least ActiveX, controls
> on Windows. However, there is no Tk-based wrapper for WebKit (on Mac) or
> Mozilla/Gecko.
>
> The closest thing that currently exists is TkHTML 3
> (http://tkhtml.tcl.tk), which is very nice, but is still in alpha stage.
>

Thanks Kevin. Yeah, I was aware of TkHTML but didn't mention it as I
didn't believe it supported binary plugins such as Flash, media player, etc.

A Tk extension that provides a native web browser would be VERY useful
in Tcl/Tk. Any Tcl/Tk gurus out there up to the task??? =)

Donal K. Fellows

unread,
Feb 13, 2008, 8:34:04 AM2/13/08
to
USCode wrote:
> I was aware of TkHTML but didn't mention it as I didn't
> believe it supported binary plugins such as Flash, media
> player, etc.

No Flash? Sounds like a good point to me. :-)

> A Tk extension that provides a native web browser would be
> VERY useful in Tcl/Tk.

It's also very hard, as those browsers use a different event loop. Low-
level event loop merging is a task with a very high guru factor...

Donal.

USCode

unread,
Feb 13, 2008, 1:40:05 PM2/13/08
to
Donal K. Fellows wrote:
> USCode wrote:
>> I was aware of TkHTML but didn't mention it as I didn't
>> believe it supported binary plugins such as Flash, media
>> player, etc.
>
> No Flash? Sounds like a good point to me. :-)

Ha! I think you're right there!

>
>> A Tk extension that provides a native web browser would be
>> VERY useful in Tcl/Tk.
>
> It's also very hard, as those browsers use a different event loop. Low-
> level event loop merging is a task with a very high guru factor...
>

> Donal,

Are you volunteering??? ;-) ;-)

Donal K. Fellows

unread,
Feb 14, 2008, 4:12:03 AM2/14/08
to
USCode wrote:
>>> A Tk extension that provides a native web browser would be
>>> VERY useful in Tcl/Tk.
>>
>> It's also very hard, as those browsers use a different event loop. Low-
>> level event loop merging is a task with a very high guru factor...
>
> Are you volunteering??? ;-) ;-)

Not this time; it's wholly outside my practical expertise. You might try
looking at tclXtNotify.c (I think it's in the Tcl source distribution,
but if not, it's definitely in CVS) to see how it can be done; you'll
need to adapt it, but it should help.

Donal.

Kevin Walzer

unread,
Feb 14, 2008, 10:53:27 AM2/14/08
to
USCode wrote:

>
> A Tk extension that provides a native web browser would be VERY useful
> in Tcl/Tk. Any Tcl/Tk gurus out there up to the task??? =)

Don't underestimate the amount of work this would take.

Dan Kennedy has been working on TkHTML3 since 2005. His work has been
funded by Eolas, so he's been able to devote a lot of time to it, maybe
even full-time. And it's still at alpha stage.

I can't imagine that wrapping platform-specific browsers would be any
easier. And how would you do this? Would you pick one cross-platform
implementation (i.e. Webkit/KHTML or Gecko), or would you warp one on
each platform (MS/Mac/*Nix)?

Larry W. Virden

unread,
Feb 14, 2008, 12:50:03 PM2/14/08
to
On Feb 12, 4:54 pm, USCode <d...@spamon.me> wrote:
>
> This Tk web browser widget could then be used within a Toplevel like any
> other Tk widget.  We could then use that web browser widget to display
> any media the native web browser supports such as web pages, movies,
> flash, etc.

Do developers really want a single widget which is 23 meg or more in
size? That's the size of firefox on Solaris - even lynx - a plain text
web browser, with no unicode, flash, etc. support - is over 1 meg in
size.

Seems like a widget like that would really cause problems.

Why not just write code that communicates with stand alone web
browsers? In the past, netscape, firefox, etc. had command line
arguments which would open up windows, print pages, etc. And I would
have to believe that .Net type functions on Vista, etc. would allow
you to do similar things with I.E. So you get to leave the brower
technology to those companies, and just control it as if it were a
window.

There was at one time- and perhaps still is - a way to wrap a Tk frame
around an external application. If there is something specifically Tk
that you are wanting to do, perhaps something along that lines would
work.

USCode

unread,
Feb 14, 2008, 1:16:00 PM2/14/08
to
Larry W. Virden wrote:
> There was at one time- and perhaps still is - a way to wrap a Tk frame
> around an external application. If there is something specifically Tk
> that you are wanting to do, perhaps something along that lines would
> work.
Wow, that would be slick!
Does anyone know if/how that is done and if it is cross-platform???

USCode

unread,
Feb 14, 2008, 2:53:40 PM2/14/08
to
Found this but it doesn't seem to work anymore, at least on Vista ...
http://wiki.tcl.tk/13236

EL

unread,
Feb 14, 2008, 4:39:04 PM2/14/08
to
Larry W. Virden schrieb:

> Do developers really want a single widget which is 23 meg or more in
> size? That's the size of firefox on Solaris - even lynx - a plain text
> web browser, with no unicode, flash, etc. support - is over 1 meg in
> size.

No, but a good and functional HTML engine inside a Tk window sounds
sexy... imagine the things one could do with that!

One idea would be to wrap the gecko rendering engine from mozilla into a
Tk frame... lots of browsers have been created by this way, so it is
certainly possible. It would not mean to have a full installation of
firefox as part of the widget, just to have a slim third-party
dependency - namely gecko.

Just a thought.


Eckhard

Donal K. Fellows

unread,
Feb 14, 2008, 5:54:21 PM2/14/08
to

On Unix, you can (with a tiny extension) reparent the other
application inside a Tk frame. This might or might not work well. It's
not portable to Windows, where things are done differently. OTOH,
embedding COM controls (e.g. the core of IE) is fairly easy with Tcom
(IIRC). I think there's a demo of this sort of thing that comes with
Tcom itself.

Donal.

USCode

unread,
Mar 3, 2008, 1:38:49 AM3/3/08
to
Kevin Walzer wrote:
>
> Don't underestimate the amount of work this would take.
>
> Dan Kennedy has been working on TkHTML3 since 2005. His work has been
> funded by Eolas, so he's been able to devote a lot of time to it, maybe
> even full-time. And it's still at alpha stage.
>
> I can't imagine that wrapping platform-specific browsers would be any
> easier. And how would you do this? Would you pick one cross-platform
> implementation (i.e. Webkit/KHTML or Gecko), or would you warp one on
> each platform (MS/Mac/*Nix)?
>
I don't know what plans Eolas has for TkHTML3 but obviously they
had/have some pressing need as they have put their good money down.

Seems like sponsoring the Tcl/Tk browser plugin would have been money
better spent, IMHO of course. Then you can develop your Tcl/Tk
application and deploy it to the desktop and/or browser without having
to deal with the HTML/Javascript/XML/AJAX mess. Today we have Flash
which is also deployable to the desktop via AIR. Competitor JavaFX will
soon be out and there's of course Microsoft's Silverlight.

The Tcl/Tk plugin is different in it's emphasis and capabilities from
those products of course but it would be a terrific way to develop web
applications!

Larry W. Virden

unread,
Mar 3, 2008, 8:16:52 AM3/3/08
to
On Feb 14, 4:39 pm, EL <eckhardnos...@gmx.de> wrote:
> One idea would be to wrap the gecko rendering engine from mozilla into a
> Tk frame... lots of browsers have been created by this way, so it is
> certainly possible. It would not mean to have a full installation of
> firefox as part of the widget, just to have a slim third-party
> dependency - namely gecko.

Several years ago (perhaps 2000?) there was a Tcl conference paper or
tutorial by someone doing some work on this very thing. I believe it
was called TkGecko. I don't know what ever happened to this project,
but if you google the word, you will see a pointer to the usenix.org
paper, I think...

0 new messages