[fxruby-users] FXFileList & default icons

Jeroen van der Zijp jeroen.vanderzijp at tbe.com
Wed Sep 1 10:30:58 EDT 2004


On Wednesday 01 September 2004 11:07 am, Juraj Sujan wrote:
> jeroen <jeroen at fox-toolkit.org> wrote:
> 
> > 
> > They're just fallback icons, used in case no bindings
> > have
> > been found in the registry.
> > 
> > 
> > In principle, you can (1) load your file associations
> > under the [FILETYPES] section.  For example:
> > 
> > 	[FILETYPES]
> > 	bmp = "/usr/local/bin/xv %s &;Bitmap
> > Image;image.xpm;mini/image.xpm;image/x-bmp"
> > 
> > Or (2) replace the bindings programmatically using
> > FXFileDict::replace().
> > A subsequent lookup of the binding will then use the new
> > binding, and
> > moreover, when the application quits the binding will be
> > logged into
> > the registry.
> > 
> > FXFileList will ONLY use the hard-wired icons if no
> > bindings have been
> > found.  We want to make sure programs still work when no
> > bindings 
> > are available.
> > 
> > 
> 
> yes, I know about the associations and of course, I want to
> use my own icons for certain filetypes. But consider this
> example situation:
> 
> There is one directory and two files displayed in list (one
> png and one jpg image). I will define the association for
> png filetype. Then it will display my own icon for png file
> but hard-wired icon for directory and for jpg file (as it is
> unassociated). But I would like to override ALSO these two
> icons with my own. In other words, I would like to display
> my own fallback icons EVEN for files without associations. 
> 
> So, here is my question again: How to do it ? Could it be
> done with associations ? I don't think so.

Yes, that situation is covered in the implementation already; you can ALSO 
create default fallbacks, for executables, directories, and normal files:

[FILETYPES]
defaultfilebinding = "/usr/local/bin/adie %s &;Document;document.xpm;mini/document.xpm"
defaultexecbinding = ";Application;exec.xpm;mini/exec.xpm;application/x-executable-file"
defaultdirbinding = ";Folder;folder.xpm:folder_open.xpm;mini/folder.xpm:mini/folder_open.xpm;application/x-folder"

If you have that, then these bindings will be used when no other bindings are 
available.  The hard-wired icons are ONLY there to make sure the program works,
come hell or high water.  Normally, you'd have a populated .foxrc/Desktop file
and you'll never see them...


I usually have one directory binding like:

/home/jeroen = ";Home Directory;kfm_home.xpm;mini/kfm_home.xpm;application/x-folder"

And maybe:

/mnt/zip = ";Zip Drive;zip_mount.xpm;mini/zip_mount.xpm;application/x-folder"
/mnt/cdrom = ";CDROM Drive;cdrom_mount.xpm;mini/cdrom_mount.xpm;application/x-folder"
/mnt/floppy = ";Floppy Drive;3floppy_mount.xpm;mini/3floppy_mount.xpm;application/x-folder"

Finally, the setting:

[SETTINGS]
iconpath = /home/jeroen/ICONS:/usr/share/icons


The iconpath determines where it looks for the icons; its just like
a UNIX path, directory names separated by ":".



	- Jeroen


More information about the fxruby-users mailing list