FROM : Stephan Ruggiero
DATE : Wed Apr 06 18:47:51 2005
The problem is that I want to initialize the GUI every time the user
activates
the plugin.
Something like this:
->>click on plugin<<-
1. initiate variables
2. set up GUI according to variables
The only method that allows me to influence button states etc and is
_not_ called twice is mainViewDidLoad.
Now mainViewDidLoad is only called once (after the first activation of
the plugin) and even before (!) willSelect
If the user switches to another plugin and then comes back to mine,
mainViewDidLoad is not invoked, so I do not have the chance to access
the GUI again.
willSelect and didSelect are called properly every time, but these
methods do not
have any effect on the GUI elements - no idea why. Maybe there are some
bad connections in IB that would solve this???
Any help would be greatly appreciated...
Am 06.04.2005 um 18:08 schrieb Dave Camp:
> Perhaps I don't understand what the problem is.
>
> mainViewDidLoad is called once when your nib is loaded and it's
> contents transferred to the system preferences window. This would be
> the replacement for awakeFromNib.
>
> willSelect/didSelect is called before/after each time the user has
> clicks on your preference pane.
>
> Can you describe the problem that you are trying to solve?
>
> Dave
>
>
> On Apr 6, 2005, at 12:41 AM, Stephan Ruggiero wrote:
>
>> Hi,
>>
>> thank you very much for the suggestions - but I still run into
> trouble.
>> This is what I did:
>>
>> -(void)willSelect {
>> NSLog(@"willSelect");
>> // have some variables initiated, set up some NSDictionary...
>> // no changes to TextViews or other interface content
>> }
>>
>> -(void)didSelect {
>> NSLog(@"didSelect");
>> // set the state of some interface content according to the
>> variables' contents
>> }
>>
>> -(void)didUnselect {
>> // release the variables
>> }
>>
>> Now this is what happens:
>> - Start the SystemPreferences app
>> - Select the plugin
>> - willSelect is called, everything is fine till now
>> - didSelect is called, but the changes to the view are not made
>> - didUnselect works as expected
>>
>> I tried to replace <didSelect> with <mainViewDidLoad> or
>> <awakeFromNib>, but these are always called first and only if the
>> plugin is selected for the first time after starting the SysPref app
>> (not after deselecting and reselecting).
>>
>> Maybe there is still something I am missing?
>>
>> Thank you!
>>
>> Best regards,
>>
>> Stephan
>>
>> Am 05.04.2005 um 19:24 schrieb Douglas Norton:
>>
>>>
>>> On 5 Apr 2005, at 16:53, Dave Camp wrote:
>>>
>>>> On Apr 5, 2005, at 2:09 AM, Stephan Ruggiero wrote:
>>>>
>>>>> I am writing a preferences pane plugin that has a main window for
>>>>> the System Preferences app. and 2 separate panels the user can
>>>>> open.
>>>>>
>>>>> The principal cocoa class (a subclass to NSPreferencesPane) is
>>>>> instantiated in the IB and has a -(void)awakeFromNib call to
>>>>> initiate some stuff when the plugin is selected.
>>>>> Now my problem is that the awakeFromNib is called twice! I read
>>>>> about this problem here, but no solution given seem to apply to my
>>>>> situation, as I am not writing a standalone app, just a plugin.
>>>>
>>>> That may not be a good place to put that code for a preference pane.
>
>>>> I would suggest looking at mainViewDidLoad, didSelect, and
>>>> didUnselect.
>>>>
>>>
>>> or willSelect as this is called before your pane is displayed.
>>>
>>> Douglas
>>>
>>
>>
>>
> ---
> There's an old proverb that says just about whatever you want it to.
DATE : Wed Apr 06 18:47:51 2005
The problem is that I want to initialize the GUI every time the user
activates
the plugin.
Something like this:
->>click on plugin<<-
1. initiate variables
2. set up GUI according to variables
The only method that allows me to influence button states etc and is
_not_ called twice is mainViewDidLoad.
Now mainViewDidLoad is only called once (after the first activation of
the plugin) and even before (!) willSelect
If the user switches to another plugin and then comes back to mine,
mainViewDidLoad is not invoked, so I do not have the chance to access
the GUI again.
willSelect and didSelect are called properly every time, but these
methods do not
have any effect on the GUI elements - no idea why. Maybe there are some
bad connections in IB that would solve this???
Any help would be greatly appreciated...
Am 06.04.2005 um 18:08 schrieb Dave Camp:
> Perhaps I don't understand what the problem is.
>
> mainViewDidLoad is called once when your nib is loaded and it's
> contents transferred to the system preferences window. This would be
> the replacement for awakeFromNib.
>
> willSelect/didSelect is called before/after each time the user has
> clicks on your preference pane.
>
> Can you describe the problem that you are trying to solve?
>
> Dave
>
>
> On Apr 6, 2005, at 12:41 AM, Stephan Ruggiero wrote:
>
>> Hi,
>>
>> thank you very much for the suggestions - but I still run into
> trouble.
>> This is what I did:
>>
>> -(void)willSelect {
>> NSLog(@"willSelect");
>> // have some variables initiated, set up some NSDictionary...
>> // no changes to TextViews or other interface content
>> }
>>
>> -(void)didSelect {
>> NSLog(@"didSelect");
>> // set the state of some interface content according to the
>> variables' contents
>> }
>>
>> -(void)didUnselect {
>> // release the variables
>> }
>>
>> Now this is what happens:
>> - Start the SystemPreferences app
>> - Select the plugin
>> - willSelect is called, everything is fine till now
>> - didSelect is called, but the changes to the view are not made
>> - didUnselect works as expected
>>
>> I tried to replace <didSelect> with <mainViewDidLoad> or
>> <awakeFromNib>, but these are always called first and only if the
>> plugin is selected for the first time after starting the SysPref app
>> (not after deselecting and reselecting).
>>
>> Maybe there is still something I am missing?
>>
>> Thank you!
>>
>> Best regards,
>>
>> Stephan
>>
>> Am 05.04.2005 um 19:24 schrieb Douglas Norton:
>>
>>>
>>> On 5 Apr 2005, at 16:53, Dave Camp wrote:
>>>
>>>> On Apr 5, 2005, at 2:09 AM, Stephan Ruggiero wrote:
>>>>
>>>>> I am writing a preferences pane plugin that has a main window for
>>>>> the System Preferences app. and 2 separate panels the user can
>>>>> open.
>>>>>
>>>>> The principal cocoa class (a subclass to NSPreferencesPane) is
>>>>> instantiated in the IB and has a -(void)awakeFromNib call to
>>>>> initiate some stuff when the plugin is selected.
>>>>> Now my problem is that the awakeFromNib is called twice! I read
>>>>> about this problem here, but no solution given seem to apply to my
>>>>> situation, as I am not writing a standalone app, just a plugin.
>>>>
>>>> That may not be a good place to put that code for a preference pane.
>
>>>> I would suggest looking at mainViewDidLoad, didSelect, and
>>>> didUnselect.
>>>>
>>>
>>> or willSelect as this is called before your pane is displayed.
>>>
>>> Douglas
>>>
>>
>>
>>
> ---
> There's an old proverb that says just about whatever you want it to.
| Related mails | Author | Date |
|---|---|---|
| Stephan Ruggiero | Apr 5, 11:09 | |
| Dave Camp | Apr 5, 17:53 | |
| Douglas Norton | Apr 5, 19:24 | |
| Stephan Ruggiero | Apr 6, 09:41 | |
| Stephan Ruggiero | Apr 6, 18:47 | |
| Dave Camp | Apr 6, 19:14 |






Cocoa mail archive

