• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Window's kAXMinimizedAttribute Can Only Be Set True
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window's kAXMinimizedAttribute Can Only Be Set True


  • Subject: Re: Window's kAXMinimizedAttribute Can Only Be Set True
  • From: Michael Kamprath <email@hidden>
  • Date: Wed, 04 Sep 2002 08:22:47 -0700

on 9/4/02 8:10 AM, Eric Schlegel at email@hidden wrote:

>
> On Tuesday, September 3, 2002, at 08:07 PM, Michael Kamprath wrote:
>
>> I am consistently getting error -1700 (errAECoercionFail) when I try
>> to set
>> a Carbon application's window UI element's kAXMinimizedAttribute
>> attribute
>> to kCFBooleanTrue. Why would Apple Event coercion be involved with
>> this in
>> any way?
>
> Probably because internally, we use the AppleEvent Manager's coercion
> facilities to extract parameters from Carbon events if the type doesn't
> match. Can you post the code that you're using to set the attribute?
>
> -eric

Sure, here it is:

void
XAXWindowElement::SetMinimized( bool inIsMinimized ) const throw (AXError)
{
try
{
if ( inIsMinimized )
{
this->SetAttributeValue( kAXMinimizedAttribute, kCFBooleanTrue );
}
else
{
this->SetAttributeValue( kAXMinimizedAttribute, kCFBooleanFalse );
}
}
catch ( AXError err )
{
//didn't work
}
}

XAXWindowElement is sub-classed from XAXUIElement, and here is the relevant
methods from that class:

void
XAXUIElement::SetAttributeValue( CFStringRef inAttributeKey, CFTypeRef
inValue ) const throw (AXError)
{
AXError theErr;

theErr = AXUIElementSetAttributeValue( (*this), inAttributeKey, inValue );
if (theErr != noErr ) throw theErr;
}

CFTypeRef
XAXUIElement::CopyAttributeValue( CFStringRef inAttributeKey ) const throw
(AXError)
{
CFTypeRef theValue = NULL;
AXError theErr;

theErr = ::AXUIElementCopyAttributeValue( (*this), inAttributeKey,
&theValue );
if (theErr != noErr ) throw theErr;

return theValue;
}

My XAXUIElement class is just a wrapper around a AXUIElementRef, whose value
is accessed by a type-cast operator:

XAXUIElement::operator AXUIElementRef() const
{
return this->mElementRef;
}


Now, I know the AXUIElementRef is valid as other calls to
XAXUIElement::CopyAttributeValue work as I can get the window name and even
*get* the value of kAXMinimizedAttribute, but setting kAXMinimizedAttribute
tields the -1700 error.

Michael F. Kamprath
email@hidden

Keyboard Maestro - Conduct Your Mac Like a Pro!
Download a free copy today at: www.KeyboardMaestro.com
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Window's kAXMinimizedAttribute Can Only Be Set True
      • From: Eric Schlegel <email@hidden>
References: 
 >Re: Window's kAXMinimizedAttribute Can Only Be Set True (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Re: Window's kAXMinimizedAttribute Can Only Be Set True
  • Next by Date: Re: Window's kAXMinimizedAttribute Can Only Be Set True
  • Previous by thread: Re: Window's kAXMinimizedAttribute Can Only Be Set True
  • Next by thread: Re: Window's kAXMinimizedAttribute Can Only Be Set True
  • Index(es):
    • Date
    • Thread