[Fxruby-users] Re: Fxruby-users digest, Vol 1 #57 - 2 msgs
Status: Inactive
Brought to you by:
lyle
From: jeroen <je...@fo...> - 2003-09-12 13:24:04
|
On Friday 12 September 2003 03:42 am, you wrote: > First off, Sorry for the double mailing to the list. I had a bit of > trouble with my email provider... > > jeroen wrote: > >The FXDirList in FOX 1.0 did have this bug under Windows; the new one in > >FOX 1.1.x however shows the list of drives as it was supposed to. > > Ah, great. My bad - will find an upgrade then, if it is available for > FXRuby. :) > > >The workaround for the old FXDirList is to prefix the drive letter in > >front of the path; if you don't, the routines which turn a path into > >a normalized absolute path will slap the default drive letter in front > >[it will also expand environment variables and simplify the path]. > > Actually, I did prefix with the drive letter. I realized afterward that > there was a bigger problem than it ignoring my path, it probably really > should show all drives, which it didn't. OTOH, this is apparently fixed > in newer versions, so I'll upgrade. AFAIK, explicitly placing the prefix worked with the old FXDirList. Anyway, its moot as the new one shows ALL the drive letters. > >As for the file types, it is as follows. On Windows, FOX uses the > >registry but continues to follow its own bindings-database; > > For someone not too familiar with the framework yet, can I find and use > this database somewhere, to build upon when starting to build my own > list if needed? If you do it from FOX, it is a matter of adding entries under the registry group FILETYPES with key,value pairs as follows: "key" is the extension. Note FOX's system can handle sub-extensions like .tar.gz and .gz. Also, you can use the entire filename as well, e.g. you can map README to a certain command. "value" is of the form: command string ';' extension string ';' bigicon [ ':' bigiconopen ] ';' miniicon [ ':' miniiconopen ] ';' mimetype So for example for a .jpg image type one would add: jpg = "/usr/local/bin/xv %s &;JPEG Image;image.xpm;mini/image.xpm;image/jpeg" Note the "%s" which is replaced by the actual filename. You can also map directory names, as in: /home/jeroen = ";Home Directory;kfm_home.xpm;mini/kfm_home.xpm;application/x-folder" In this case the "key" is a directory name. It must start with / or \. FOX allows subdirectories, so you can do something like: /include - ... which causes directories of the form <blabla>/include to have a certain icon. The icons are found by consulting the registry entry: iconpath in the group SETTINGS. Under windows, it is a ';' separated list of directories. > >it *is* > >possible to write a tool which populates this bindings database > >from the "normal" Windows associations [the native file- associations > >are splattered all over the place, and in some cases the icons have to > >be lifted out of executables]. > > Yeah, true that. Though I thought that there would be some kind of > central repository or something, since a *lot* of third party programs, > file managers and the like does manage to use the correct icons even if > they don't use the built-in Win components. Of course, they might just > have been doing a huge amount of hacking. I have looked at it a little bit, and involves quite a bit of work; nevertheless, it can be done. I have not decided yet whether we should deliver a tool to populate the FOX database from the native-stored information, or just use the native-stored information. Continuing to use the FOX database, as you see, has more flexibility in terms of the bindings, while the latter is not so flexible and makes adding our own bindings more difficult. > >On Unix, one can simply drop a text file (the FOX registry is > > human-readable text on UNIX) into $HOME/.foxrc/Desktop and have bindings > > available for all applications. > > Yeah, I've seen how the system works, and I think I can manage to build > my own associations if I have to. The thing I'd really like though was > to steal any system associations, if available, at least to provide a > start. :) That certainly seems to be an argument for building a separate tool to populate the registry. > Thanks a lot, that makes things a bit clearer... I'll probably come back > with some more in a moment, though. ;) Regards, Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 05:50 09/12/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |