Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!efi!tim From: tim@efi.com (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: How to hilite(255) the OK button in SF dialogs? Message-ID: <1990Jul17.183511.950@efi.com> Date: 17 Jul 90 18:35:11 GMT References: <2418@speedy.mcnc.org> Organization: Electronics For Imaging, Inc. Lines: 24 In article <2418@speedy.mcnc.org> kk@mcnc.org.UUCP (Krzysztof Kozminski) writes: >The subject says it almost all: I want to make the OK button inactive >in the standard file dialogs, in which I have sevaral additional >items. Some values of these items make it illegal to save or open a >selected file. Due to other considerations, I cannot just remove the >file name from the list, so I tried to hilite the Open/Save button to >255 from the dialog hook, but the SF package promptly reactivates it >with the resulting wild blinking. So for now I just hide the button >and display a short explanation at the bottom of the dialog, but I >would like to do it more elegantly, i.e., keep the button where it is, >only inactive. Any hints how to tell the SF package to keep off the >hiliting status of the default button? You're almost there. Hide the real OK button and trap return and enter in your event filter. Then put up a button called Open or Save in the same place as the ordinary button, and control it yourself as desired. If you want it enabled, then use the dialog item hook to turn clicks on it into clicks on the hidden button. Note that disabling can be confusing to the user, and if you can provide (as you seem to be doing already) a brief explanation of why a particular file can't be opened, you should. Even better is to use the file filter to exclude files you can't open, but this may not be general enough for all applications.