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: Popup Button not behaving as expected




On Jan 29, 2005, at 11:45 PM, Jesse Carpenter wrote:

There was a time when life was simpler....but using the Appearance Manager. Well!

I created a window using GetNewCWindow()...OK

Then I created Popup Control by calling GetNewControl()...OK

OK, so you're talking about stuff from what? 15 years ago? :)

You know if you adopted modern carbon approaches, things in general might be easier ;)


Upon contentClick by the Event, I use the following code:

static void PopupControl(WindowRef pWindow, EventRecord *pEvent)
{
  Point mouse;
  ControlRef theControl;
  SInt16 part;

  DoSomeProcessing();

mouse = pEvent->where;
GlobalToLocal(&mouse);
theControl = FindControlUnderMouse(mouse, pWindow, &part);
if (HandleControlClick(theControl, mouse, pEvent->modifiers, (ControlActionUPP) -1)) {
short value = GetControlValue(theControl);
etc.
}
}


The tracking works well but the selection in the menu always returns to the top of the list. It would not show the menu selection chosen after releasing the mouse button, thus returning to a value of one.

What is the control's maximum? Did you remember to set it to the number of items in the menu? That's a common mistake. (And this mistake hasn't changed in ten years either ;)


This has worked using pre-Mac OS.

What? On the Apple IIGS ? ;)

Bryan

_______________________________________________
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: 
 >Popup Button not behaving as expected (From: "Jesse Carpenter" <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.