The first package, TkWebView, provides a lightweight HTML viewer that
can either be used as a standalone window or embedded in another widget.
Tk is conspicuous among cross-platform GUI toolkits in lacking an
easy-to-use HTML widget. TkWebView only supports basic HTML, not tables,
CSS or other components of web browsers, but it still fills a void in
Tcl/Tk. (An ambitious project to provide a modern HTML widget for Tk,
TkHTML 3, appears to have stalled--and even when development was moving
forward, it suffered from an extremely high level of complexity that
made it nearly impossible to use in an application.) TkWebView could be
used as a help viewer, a widget to display HTML from RSS feeds, and more.
The second package, SimpleDND, provides a lightweight mechanism for
drag-and-drop within a Tk application. There are various methods to
display drag-and-drop in Tk applications, but they are either limited
(quick hacks specific to a particular application or widget), complex
(such as BWidgets' drag-and-drop mechanism), or not fully cross-platform
(TkDND is the most powerful DND extension out there, supporting
drag-and-drop between different applications, but is not supported on
the Mac). SimpleDND provides basic drag-and-drop visualization with a
few commands, and such fills a void.
Both packages are available at
http://www.codebykevin.com/opensource/xplat_oss.html. I hope some people
find them useful.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Simple dnd looks nice. Some feedback on dnd:
1) it would be more useful if it could identify the target widget when
the drop happens. Otherwise, one needs to write several identical
procs. For example, if you have two or three listboxes as
destination. Perhaps you could append the name of the target widget
to the dropcmd call.
2) If the source listbox has multiple selections enabled, it messes
with the original selection. As you move the cursor while dragging,
the user's original selection changes inadvertently.
>
> Simple dnd looks nice. Some feedback on dnd:
Thanks for the feedback.
>
> 1) it would be more useful if it could identify the target widget when
> the drop happens. Otherwise, one needs to write several identical
> procs. For example, if you have two or three listboxes as
> destination. Perhaps you could append the name of the target widget
> to the dropcmd call.
I'll think about this, although I don't consider having to write multple
proc's a fatal error. Changing this might add more complexity than I want.
>
> 2) If the source listbox has multiple selections enabled, it messes
> with the original selection. As you move the cursor while dragging,
> the user's original selection changes inadvertently.
>
That's just demo code; it's not meant to limit what simplednd can do. It
should be easy enough to work around this, customize the drag proc, etc.