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.
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
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??? =)
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.
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??? ;-) ;-)
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.
>
> 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)?
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.
> 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
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.
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!
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...