[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Toolbox] Disabling (not Hiding) items in dialog boxes?



Chris Nandor writes 19 May 1999:

>At 7.51 -0400 1999.05.20, Alan Fry wrote:
>>As far as I know you cannot do this. It is tempting to think that it might
>>be possible to change the current 'RGBForeColor()' to a gray and then
>>re-set the button text. However the machine will crash if you use
>>'SetDialogItemText()'. 'GetDialogItemText()' is alo broken, returning
>>garbage prepended to the string.
>
>How would you do it in C?  Is there a function missing from MacPerl's
>modules that could be added in?

Dialog items (according to Inside Macintosh) may be 'enabled' or 'disabled'
with the state noted by a flag in the 'DITL' resource. Acording to IM it
seems 'disabled' only means that the item does not respond to a mouse
click, and it has nothing to do with _appearance_.

IM then goes on to say that to _inhibit_ a control the Control Manager's
'HiliteControl()' should be used. However Dialogs.pm does not afford access
to the Control Manager, and maybe for that reason 'HiliteCntrol()' is not
amongst Dialog's listed functions.

In Controls.pm 'HiliteControl()' _is_ included, but seems to be implemented
as a QuickDraw 'InvertRect()', which is not really very satisfactory
visually.

So I think the answer to the question 'is something missing from
Dialog.pm', the answer is 'yes, -- HiliteControl()', but I doubt it wuld be
worth adding it in. I suspect that would be a major undertaking (it's a
Control Manager function not a Dialog Manager function) and the MacPerl
implementation is not very attracive anyway.

It is so easy to work around this problem with a roll-your-own grayed-out
button it really wouldn't be worth the effort in my view.

John Baxter adds:

>There is a half page (or a bit more) near the beginning of the Dialog
>Manager part of Inside Mac which boils down to:
>    If what you want to do in a dialog is hard,
>    do the job with a window instead.

Any job is nearly always more easily done with a window I think.

Alan Fry



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org