|
From: | Riccardo Mottola |
Subject: | simulating user action to initialize a panel |
Date: | Fri, 20 Nov 2009 01:44:06 +0100 |
User-agent: | Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.23) Gecko/20090906 SeaMonkey/1.1.18 |
Hi, I have the following problem:I have an accessory view where some controls modify or send messages to other controls. For example selecting an item makes another disabled or moving a slider writes its current value inside a textfield.
I created all items, now I want after loading to "touch" all items so that the respective relationships get updated.
For a slider it is easy: a performClick message will simulate the user clicking on it and the value will be displayed.
My problem is now a NSPopUpMenu: depending on the selection other items get selected or no.
I don't know how to create the event! I tried to set the selected item, but it does not trigger any event. I tried selecting forcily another item and then the intended item back again, but that doesn't work either (and it would be not what I want anyway, it would be suboptimal, I do not want to hard-code the default item of the menu). Perform click "opens" the menu, but does not select. Two clicks do not help either..
How could I accomplish what I need? Of course I could instantiate the view "hardwired" so that everything is set with the correct state and default, but that is I think very inflexible.
Riccardo
[Prev in Thread] | Current Thread | [Next in Thread] |