Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Progress bar will not update.



Eric Schlegel wrote:


On Nov 26, 2007, at 10:32 PM, Julie Porter wrote:

Next up is to convert the text entry dialogs to the nib based equivalent. I am currently reading up on how to replace the modal dialog calls with the more modern equivalents. I probably should convert the code to the application event loop. I am a bit scared as I have a lot of processing happening adjusting the cursor during the null event process. This is a graphical editor, so the mouse needs to change shape when inside a region, The region is dynamic and when the mouse is over it the region can be clicked on and dragged. That code has worked well for years, so I really really do not want to re- write it as it looks to be several hundred lines for just the mouseover code.


Note that you can use nib-based dialogs together with the classic WaitNextEvent model, so you can continue to use your existing idle- processing code if necessary. You don't need to use RunApplicationEventLoop to use HIView-based windows.


-eric


RunAppModalLoopForWindow does the trick with implementing the various modal dialogs for things like Zoom, Find and some preferences. The only area where I am not clear is on disposing the dialog window and handlers as I can find no API calls or code examples that show what to dispose.

Specifically it is the constructors in the following sample code that I am unsure as to how the handler UUPs are destructed as these seem to be allocated inside the init function. I am terminating the window using disposeWindow. I found the call CFRelease to clean up the CF strings I am using to set and read the text fields in the dialogs.

<code>
//--------------------------------------------------------------
void RegisterForEvents(WindowRef myWindow)
{
EventTypeSpec cmdEvent; cmdEvent.eventClass = kEventClassCommand;
cmdEvent.eventKind = kEventProcessCommand;
EventHandlerUPP handlerUPP;
handlerUPP = NewEventHandlerUPP(CommandEventHandler);


   EventTargetRef target;
       target = GetWindowEventTarget(myWindow);

   void * userdata = NULL;
   InstallEventHandler(target, handlerUPP, 1,  & cmdEvent,
       userdata,NULL);
}

</code>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Progress bar will not update. (From: Julie Porter <email@hidden>)
 >Re: Progress bar will not update. (From: Eric Schlegel <email@hidden>)
 >Re: Progress bar will not update. (From: Julie Porter <email@hidden>)
 >Re: Progress bar will not update. (From: Eric Schlegel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.