[futurebasic] Re: [FB] Working with Menus

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2009 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Tue, 15 Dec 2009 18:19:31 +1300
Max Taylor wrote:

>>> Using CarbonEvents all of my Menu Key "Commands" work correctly but the mouse will not pull down the menus. They just sit there.
>> 
>> That's a puzzle; I don't even know how to produce that effect deliberately. Do you have any CE handlers installed on the menus themselves? 
> 
> Not sure if they should be installed on the menu as the target of maybe the application or just what for sure.

It is highly unusual to install any handler on the menu itself. A typical CE application has a handler for {_kEventClassCommand, _kEventCommandProcess} that deals with all HI Commands (whether from menu items or from buttons). The menus and buttons then "just work" with no monitoring or interference by the programmer.


>> See FB_5_4_2_Examples > FBShell, which shows the CarbonEvent way to update menus, by installing handlers for {_kEventClassCommand, _kEventCommandUpdateStatus} on the application and the windows.
> 
> I need to get the window ID from a click in a window without using FindWindow as you said it should not be used with OS 10 and still be able to determine where the click occurred.

I think that you should have a handler for {_kEventClassWindow, _kEventWindowHandleContentClick} installed on each window.


> New Question.
> 
> If you had only one window defined within IB can you use that as the template for as many windows as one would want to open? An example would be selecting "New" to open a window in your application and then selecting it again maybe 5 or more times to open multiple windows instead of creating the 5 or more windows in IB.

Yes. FB_5_4_2_Examples > FBShell does that.

Robert P.