For Programmers: Free Programming Magazines  


Home > Archive > Tcl > June 2006 > Re: ANN: Cross-platform file browser, need input/code contributions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: ANN: Cross-platform file browser, need input/code contributions
George Petasis

2006-06-30, 7:03 pm

O/H Kevin Walzer _γραψε:
> I'm working on an open-source (Tcl/BSD-style license) Tk package, based
> on BWidgets and Tablelist, that will provide a file browser component
> for Tk applications. Right now the plan is to include a tree/listbox
> view (akin to Windows explorer), a two-pane listbox view (akin to any
> number of "Foo Commander" applications) and, possibly, a OS X-NeXT-style
> column browser. The package will include drag-and-drop (based on
> BWidgets), and will also support basic file operations such as moving,
> copying, renaming, and getting file properties.
>
> What will distinguish this project from other file browser
> programs/widgets is that I want it to provide "native-look-and-feel" to
> the degree allowed by the platform. This means that, where possible, the
> file browser will display platform-specific icons, rather than use
> generic icons shipped with the package or application that uses the
> package. And it will access the icons on each end user's system (thus
> avoiding copyright/licensing issues associated with redistribution of
> application icons).
>
> I develop on Mac OS X. There is currently no Tk-native solution to
> read/display Mac icons, but I am wrapping some external tools to provide
> this functionality, so that's covered. Here are the areas where I am
> looking for specific assistance, particularly with code:
>
> 1. Windows. I understand that Tcl/Tk can read and display Windows icons
> through a combination of the registry package and the ico package.
> Because I don't work on or target Windows for my own programs, I am not
> sure how to proceed here. Would someone be willing to whip up a code
> sample that returns the correct 16x16 Windows icon based on file
> extension? [file extension $file]
>
> 2. X11. There is no consistent API for accessing icons on Linux/BSD, I
> know; each desktop environment (KDE/Gnome/etc.) has its own system. My
> thought here was to ship a basic icon package with liberal licensing:
> the best candidate I've found is the BlueSphere icon package at
> http://svgicons.sourceforge.net, released under a BSD-style license.
> (See the SF project page at http://sourceforge.net/projects/svgicons/ ).
> I'm also planning to make it easy for anyone to ship other icon
> packages, just by replacing the images in a package subdirectory; this
> is useful, for instance, if someone wants to use an icon set that is
> GPL'ed rather than BSD or LGPL. Is there another approach to consider
> here? Input is definitely appreciated.
>
> Thanks in advance.
>
> --Kevin
>


Will you use tile? At least under X11 there is no other way to get a
native look and feel :-( Also, icons under X11 are easy to locate. At
least for KDE. You simply parse the kde config files so as to get the
icon directory in use. Then things are easy: you just map your icons to
kde icon names, which are plain png images that can be loaded with the
Img package. I don't think that distributing an icon set is a good idea...

Ideally, this icon-related code should be written as a (tcl only)
package and placed into tklib :-)

George
Kevin Walzer

2006-06-30, 10:00 pm

George Petasis wrote:
> O/H Kevin Walzer _γραψε:
>
> Will you use tile? At least under X11 there is no other way to get a
> native look and feel :-(


With my TkHelpBrowser package, I include a version with Tile and a
version without. So, I'll probably do likewise here. That part is pretty
easy to do.



Also, icons under X11 are easy to locate. At
> least for KDE. You simply parse the kde config files so as to get the
> icon directory in use. Then things are easy: you just map your icons to
> kde icon names, which are plain png images that can be loaded with the
> Img package.


Gnome and KDE have different naming conventions for their icon sets.
Grokking both of them isn't something I have a lot of time to do, since
I don't use either environment when I'm in X11.


I don't think that distributing an icon set is a good idea...

It's not ideal--the BlueSpere theme is a bit outdated--but I'd like to
provide a simple default solution on X11, and one that is Tcl-friendly.
There are plenty of nicer icon sets under the LGPL or GPL if people want
to adapt those for their own programs.

>
> Ideally, this icon-related code should be written as a (tcl only)
> package and placed into tklib :-)
>


It will be mostly Tcl. The Mac portion will depend on an external
executable (geticon from osxutils, a series of GPL utilities--I'm safe
in using this because my stuff will exec out to it instead of wrapping
it as a library), but everything else should be pure Tcl.


--
Kevin Walzer
Poetic Code
http://www.kevin-walzer.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com