Thread: [Fxruby-users] Re: Fxruby-users digest, Vol 1 #57 - 2 msgs
Status: Inactive
Brought to you by:
lyle
From: <kun...@ho...> - 2003-09-12 08:43:30
|
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. >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? >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. >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. :) Thanks a lot, that makes things a bit clearer... I'll probably come back with some more in a moment, though. ;) -- Kristoffer -- Sent using: Mozilla Thunderbird 0.2 (20030901) http://www.mozilla.org/projects/thunderbird/ |
From: jeroen <je...@fo...> - 2003-09-12 05:04:03
|
> Message: 1 > Date: Thu, 11 Sep 2003 17:01:17 +0200 > From: =?ISO-8859-1?Q?Kristoffer_Lund=E9n?= <kun...@ho...> > To: fxr...@li... > Subject: [Fxruby-users] Default associations in FXFileList and FXDirList > Reply-To: fxr...@li... > > Hello! > > I am toying a bit with FXFileList and also FXDirList - pretty easy to > get running, but I wonder about the associations to the files, and their > icons. > > I've tried ot google a bit, and I've went through this list and searched > the original FOX documentation - I'm sure it is there somewhere, but I > must be looking in the wrong place then... > > Are there any good way to import the default icons, or has anyone > aldready done the job of creating something that imitates the usual > options? Seems a bit silly to manually tie mp3 to this icon etc when the > system already does that somewhere else - that information is apparently > available as other applications can get at it. Any ideas and tips are > welcome, otherwise I guess I'll have to do that work and share it > instead. ;-) > > Also, I am having a bit of trouble with FXDirList - no matter what I set > directory to, it always starts at 'C:\' - am I doing something wrong? > All I do is create it, then set the directory, which works with FXFileList. > > I am trying this out on an Win XP box, with ruby 1.8.0 and FXRuby 1.0.22 > (I think). Got it all in that package that the Pragmatic Programmers put > together for Windows. However, I will not only be on this platform, so > if there are any Windows specific issues, I'd be thankful if that was > noted. :) > > -- Kristoffer Kristoffer, 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. 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]. As for the file types, it is as follows. On Windows, FOX uses the registry but continues to follow its own bindings-database; 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]. 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. - Jeroen +----------------------------------------------------------------------------+ | Copyright (C) 20:20 09/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |
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. | +----------------------------------------------------------------------------+ |
From: Sander J. <sx...@cf...> - 2003-09-12 17:53:43
|
In the past I created a little app which did that actually. Anyone intere= sted=20 can download it here: http://sxj.raafje.com/software.html Note that is not finished yet (doesn't extract icons yet etc). But should= do=20 some basic stuff. I lost interest since I'm not working on windows anymor= e. =09Sander > > Yeah, I've seen how the system works, and I think I can manage to bui= ld > > my own associations if I have to. The thing I'd really like though wa= s > > 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. > |
From: <kun...@ho...> - 2003-09-13 08:31:34
|
Sander Jansen wrote: > In the past I created a little app which did that actually. Anyone interested > can download it here: http://sxj.raafje.com/software.html > Note that is not finished yet (doesn't extract icons yet etc). But should do > some basic stuff. I lost interest since I'm not working on windows anymore. > Looks interesting. Sadly, I'm in the middle of moving to a new town, but I'll have a look when online again. Maybe that'll solve some of the tedious work of populating such a list. :) -- Kristoffer -- Sent using: Mozilla Thunderbird 0.2 (20030901) http://www.mozilla.org/projects/thunderbird/ |
From: <kun...@ho...> - 2003-09-12 16:26:16
|
jeroen wrote: >>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. > That sounds really useful and powerful. :) > "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. > Thanks, great explanation. Although I don't seem to have any of these registry entries (according to search at least...) where should they be added? Or should the application create them? > 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. > I'd definitely would want a tool to populate my own db with, which I then could edit. Or, if it was built into the toolkit itself, it could first read directly from the defaults, then anything in the local db would override if pointing to the same. Either way, I do not like the non-flexible solution. Thanks again, -- Kristoffer -- Sent using: Mozilla Thunderbird 0.2 (20030901) http://www.mozilla.org/projects/thunderbird/ |