Re: Tracking Multiple Touches For Appropriate Label

2009-12-10 Thread Chunk 1978
i'm receiving memory leaks when using this code on device with
instruments.  the code seems fine to me so i don't understand the
leaks.  leaking objects are GSEvent and GeneralBlock-16.  you can
download my small sample project i've created using the above code at
this address:  http://tinyurl.com/yg8nh5s



On Tue, Dec 8, 2009 at 7:04 PM, Chunk 1978  wrote:
> i'm very grateful for your help.  thanks so much for posting such a
> complete solution.  i'm certain there will be others like myself who
> will find your code extremely helpful.  thanks again.
>
> On Tue, Dec 8, 2009 at 5:24 PM, mmalc Crawford  wrote:
>>
>> On Dec 8, 2009, at 12:33 pm, mmalc Crawford wrote:
>> Get the logic right...
>>
>>> - (void)setUpTouchHandling {
>>>
>>>    touchToLabelMapping = CFDictionaryCreateMutable (kCFAllocatorDefault, 5, 
>>> &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
>>>    availableLabels = [[NSMutableArray alloc] initWithObjects:touchLabel1, 
>>> touchLabel2, touchLabel3, touchLabel4, touchLabel5, nil];
>>> }
>>>
>> - (void)setUpTouchHandling {
>>
>>    touchToLabelMapping = CFDictionaryCreateMutable (kCFAllocatorDefault, 5, 
>> &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
>>    availableLabels = [[NSMutableArray alloc] initWithObjects:touchLabel1, 
>> touchLabel2, touchLabel3, touchLabel4, touchLabel5, nil];
>>    setUp = YES;
>> }
>>
>>
>> ... and improve the user experience accordingly:
>>
>>> - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
>>>
>>>    for (UITouch *touch in touches) {
>>>        if (touch.view == self) {
>>>            UILabel *label = (UILabel 
>>> *)CFDictionaryGetValue(touchToLabelMapping, touch);
>>>            label.text = @"{0, 0}";
>>>            CFDictionaryRemoveValue (touchToLabelMapping, touch);
>>>            [availableLabels addObject:label];
>>>        }
>>>    }
>>> }
>>>
>> - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
>>
>>    for (UITouch *touch in touches) {
>>        if (touch.view == self) {
>>
>>            UILabel *label = (UILabel 
>> *)CFDictionaryGetValue(touchToLabelMapping, touch);
>>            label.text = @"{0, 0}";
>>            CFDictionaryRemoveValue (touchToLabelMapping, touch);
>>            [availableLabels insertObject:label atIndex:0];
>>        }
>>    }
>> }
>>
>>
>> (I'm using setUpTouchHandling so that this will work however you configure 
>> your view or view controller -- ideally you choose a more appropriate 
>> initialisation locus.)
>>
>> mmalc
>>
>>
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/chunk1978%40gmail.com
>>
>> This email sent to chunk1...@gmail.com
>>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


TexfieldCell becomes see through for Borderless Window

2009-12-10 Thread Symadept
Hi,

>From the example of RoundTransparentWindow, I made my Application window to
show only the Parts drawn and the transparent parts are cleared. This works
fine. But once I create a custom TableView and click its TextfieldCell to
edit, the Cell becomes see through. Can anybody help me what would be my
mistake with this CustomWindow and CustomView? Without the Window and View
customization, my TableView works fine.

I am pasting the link for my sample here.
http://www.4shared.com/file/169581867/8e45268d/TransparentTable.html

Regards
Mustafa Shaik
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Quastion about types in a NSPasteBoard

2009-12-10 Thread Gustavo Pizano
Hello.

 I have implemented a drag and drop, and I just wanted to check what I had in 
the NSPasteBoard on drop... 

I checked the types from the NSPasteBoard, and the type I declared when 
dragging is in the second place of the returning array. in first place it's. 
something like:

dyn.ah62d4rv4gu8zuz4xkvw0q2pzrv4fq3pwsvy0g2pqnrka

can somebody explain me what's that? can I  safely take the 2 type  in the 
array  so I can pass it to my AbstractFactory and avoid a bunch of code lines.?

Thanks

Gustavo


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Quastion about types in a NSPasteBoard

2009-12-10 Thread Graham Cox

On 10/12/2009, at 9:26 PM, Gustavo Pizano wrote:

> I have implemented a drag and drop, and I just wanted to check what I had in 
> the NSPasteBoard on drop... 
> 
> I checked the types from the NSPasteBoard, and the type I declared when 
> dragging is in the second place of the returning array. in first place it's. 
> something like:
> 
> dyn.ah62d4rv4gu8zuz4xkvw0q2pzrv4fq3pwsvy0g2pqnrka
> 
> can somebody explain me what's that? can I  safely take the 2 type  in the 
> array  so I can pass it to my AbstractFactory and avoid a bunch of code 
> lines.?


Who can say, without knowing how you've implemented your AbstractFactory?

I'd say what you should do is follow the recommended approach for receiving 
data from a pasteboard, and request the types you're interested in in the order 
you want them. That way your code will be unaware of any private data the 
system has added to pasteboard and so you don't need to care about it.

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/PasteboardGuide106/Introduction/Introduction.html

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Detecting lack of user input system wide.

2009-12-10 Thread Kenny Carruthers
Hello,

What is the correct way to detect that there has been no keyboard or mouse
input by the user over a given period of time? Ideally, I'd like my
application to stop a timer if there is no activity at all from the user in
any application. Think of a time tracking app that stops tracking time after
5 minutes.

Sorry if this is actually easy to find (or in the archives) but I can't seem
to figure out the right Google search keywords to return a decent answer.

Sincerely,
Kenny
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Quastion about types in a NSPasteBoard

2009-12-10 Thread Gustavo Pizano
Hello Graham.

In fact the AbstractFactory has nothing to do with the NSPasteBoard. Im reading 
the NSPasteBoard in the NSViewController after it's view has recevied the 
performDropOperation:

so this is what Im doing:
NSPasteBoard pb = [sender draggingPasteboard]
NSArray * types = [pb types];
if([types containsObject:DefaultHorizontal]){
...
...
}
else if (  ){
}
else if (){
}

So depending on what I have dragged, Im asking the AbstractFactory to create an 
specific object. In the AbstractFactory Im not touching pb. ...
I jsut wanted to see from where is it coming, so I could just do something 
like..

CustomObject a = [ createObjectWithName:[[types 
objectAtIndex:1] description]]; 
or something like that instead of doing all those if-else clauses.

Gustavo


On Dec 10, 2009, at 11:39 AM, Graham Cox wrote:

> 
> On 10/12/2009, at 9:26 PM, Gustavo Pizano wrote:
> 
>> I have implemented a drag and drop, and I just wanted to check what I had in 
>> the NSPasteBoard on drop... 
>> 
>> I checked the types from the NSPasteBoard, and the type I declared when 
>> dragging is in the second place of the returning array. in first place it's. 
>> something like:
>> 
>> dyn.ah62d4rv4gu8zuz4xkvw0q2pzrv4fq3pwsvy0g2pqnrka
>> 
>> can somebody explain me what's that? can I  safely take the 2 type  in the 
>> array  so I can pass it to my AbstractFactory and avoid a bunch of code 
>> lines.?
> 
> 
> Who can say, without knowing how you've implemented your AbstractFactory?
> 
> I'd say what you should do is follow the recommended approach for receiving 
> data from a pasteboard, and request the types you're interested in in the 
> order you want them. That way your code will be unaware of any private data 
> the system has added to pasteboard and so you don't need to care about it.
> 
> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/PasteboardGuide106/Introduction/Introduction.html
> 
> --Graham
> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Additional action when a view's value changes (Cocoa Bindings)

2009-12-10 Thread Christian Ziegler
I think mmalc got me right. Sorry again for my initial mail which was a little 
confusing. When I wrote the mail I confused Cocoa Bindings with target/action, 
because what I've been doing is, I just connected the selector of one view 
TextField)  to the takeIntegerFrom IBAction of another one (Stepper) and vice 
versa. Actually I'm pretty sure I read this in a book.

Anyways, obviously this is bad practice and I've been doing it "right", I was 
just wondering whether there is a more convenient way since I got 4 pairs of 
Steppers/TextFields in my app. My action method looks kind of like 

if (sender == firstStepper) {...}
else if (sender == secondStepper) {...}
...

In the target controller I don't have IBOutlets for those steppers and 
textfields. Those are in another (mediating) controller. Question is whether 
there is another way to do this instead of defining outlets also in the target 
controller. I guess assigning tags to each stepper/textfield and defining an 
enum for them would be an option?

Cheers,
Chris 

On 10.12.2009, at 02:41, mmalc Crawford wrote:

> 
> On Dec 9, 2009, at 5:47 am, Christian Ziegler wrote:
> 
>> Sorry I got to correct myself, it's not Cocoa Bindings, but direct 
>> target/action. So I connected the takeIntegerValue action of both views to 
>> each other in contrast to connecting it to a controller.
>> 
> Don't do that.
> Both should invoke an action in a controller, which may then update views and 
> models appropriately.
> 
> You should read 
> 
>  and in particular "The Model-View-Controller Design Pattern" 
> 
>  which is crucial for all Cocoa development.
> 
> mmalc
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/chris.ziegler%40me.com
> 
> This email sent to chris.zieg...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Quastion about types in a NSPasteBoard

2009-12-10 Thread Graham Cox

On 10/12/2009, at 10:26 PM, Gustavo Pizano wrote:

> In fact the AbstractFactory has nothing to do with the NSPasteBoard. Im 
> reading the NSPasteBoard in the NSViewController after it's view has recevied 
> the performDropOperation:

Yes, but my point was that AbstractFactory is your code, and yours alone, so 
whether it will directly accept objects returned from the pasteboard's methods 
is known only to you, so it's not a question anybody else can answer.


>   NSArray * types = [pb types];
>   if([types containsObject:DefaultHorizontal]){


You shouldn't be looking for what types the pasteboard has like this. You 
should be asking it whether it has the types you want, in the order you want 
them,  using -availableTypeFromArray:

Given those types something will have to map those to the classes your abstract 
factory makes. A bunch of if...else clauses is one way, but there smarter ways, 
like having a dictionary that maps type -> class.

e.g.

NSString* myType = [pb availableTypeFromArray:[NSArray 
arrayWithObjects:@"first_choice", @"second_choice", nil]];
Class theClass = [classMapDictionary objectForKey:myType];

if( theClass )
{
id object = [[theClass alloc] init];
}


If you are targeting 10.6 or later, the pasteboard supports multiple objects 
and there are new APIs to get them. But for 10.5 and earlier, the pasteboard 
can only hold one object, albeit in a different number of representations. If 
the data is private to your app, you can get around that by passing an array of 
objects in some fashion, but for data passed between apps, you're pretty much 
stuck with the standard types unless yours and the other app agree on some 
common protocol.

But to get back to your original post - anything you see on the pasteboard you 
don't recognise is none of your business - it's probably data private to the 
app where the drag started.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Quastion about types in a NSPasteBoard

2009-12-10 Thread Gustavo Pizano
Graham hi.
On Dec 10, 2009, at 1:08 PM, Graham Cox wrote:

> NSString* myType = [pb availableTypeFromArray:[NSArray 
> arrayWithObjects:@"first_choice", @"second_choice", nil]];
> Class   theClass = [classMapDictionary objectForKey:myType];
> 
> if( theClass )
> {
>id object = [[theClass alloc] init];
> }


I was thinking in something like this whe getting the type from the pasteboard. 
but didn't know... I guess I will ask in the Obj-c list about this..

then also Im gonna change the way I get the types form the pb as you suggested. 

Im developing for 10.6 and on... but so far Im placing only one Data type in 
the PB,.. who knows if I may need to put more in a future... 


Ok Im gonna leave that weirdo type alone... hehe

Thanks for the help, as always very useful.

Gustavo

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSCell's mouse tracking method never called

2009-12-10 Thread Martin Cote
On Wed, Dec 9, 2009 at 11:59 PM, Graham Cox  wrote:
>
> Are you expecting this method to be invoked by your tracking handler? 
> Normally it's called by a mouseDown in the table.

No, I was hoping it would get called by a mouseDown.

>
> You need to show some code.

Before diving in the code, I would like to understand some more
details about the PhotoSearch sample project.  I noticed that the
NSOutlineView's trackMouse method is only called when you
click-and-drag inside the tracking areas of the cell (in this case,
the info button).  In other words, clicking anywhere else in the cell
won't trigger the trackMouse method.

Why does it happen this way?  I'm starting to think that the
trackMouse method is related to the NSTrackingAreas... but I'm surely
wrong.

Martin
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Additional action when a view's value changes (Cocoa Bindings)

2009-12-10 Thread Graham Cox

On 10/12/2009, at 10:45 PM, Christian Ziegler wrote:

> In the target controller I don't have IBOutlets for those steppers and 
> textfields. Those are in another (mediating) controller. Question is whether 
> there is another way to do this instead of defining outlets also in the 
> target controller. I guess assigning tags to each stepper/textfield and 
> defining an enum for them would be an option?

In general I've found it's a false economy to avoid outlets for all controls - 
you'll want them sooner or later so may as well give everything an outlet just 
as a matter of habit.

The target controller should be the controller with these outlets. It's OK to 
have multiple tiers of controllers, but make sure each one has a clearly 
defined role. Sounds like you have not defined a clear role for each controller 
and each is doing part of the job of the other. Multiple controllers would 
usually be arranged in series, not in parallel. 

Don't use tags to identify controls - that's not what they are for and there 
are far more elegant ways to handle this.

To avoid the problem of keeping a stepper and a textfield in synch, you 
generally want to include the relevant property of your data model within the 
complete feedback loop that is created:
 stepper -> controller(s) -> data model -> change notification -> 
controller(s) --> text field
   text field-^ 
|-> stepper

If you organise things this way then anyone else that changes that property of 
the data model also will cause your UI to update correctly (Undo, for example, 
or a different UI on the same property). This is precisely what bindings does, 
but you can do the same using target/action as well though it's a bit more 
work. e.g. You can set up the controller to observe the property changes using 
KVO (or some other means, such as notifications or a direct protocol of your 
own devising) and then respond to those changes by setting the relevant 
controls' values through their outlets. For new code, bindings is the way to go 
- it uses KVO internally and is the least work to set up.

--Graham

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Additional action when a view's value changes (Cocoa Bindings)

2009-12-10 Thread Graham Cox

On 10/12/2009, at 11:26 PM, Graham Cox wrote:

> In general I've found it's a false economy to avoid outlets for all controls 
> - you'll want them sooner or later so may as well give everything an outlet 
> just as a matter of habit.

I should qualify that - if you end up using bindings you don't need to define 
outlets, but for any other approach you'll want them.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Question about touchesBegan

2009-12-10 Thread Eric E. Dolecki
I'll elaborate a little more. I have a main view with some source buttons
(UIButton) at the top. When I click one, I bring up a radio style tuner bar
in a subview (animates up from the bottom). I am using touches to move the
"pointer" in that subView. Works great, however because the subView is
detecting touches for the whole subView - it prevents touches on those
buttons in the main view. Do I simply need to architect this in another way?
Say create a subview of just the UIButtons at the top of all subViews?

- Eric

On Thu, Dec 10, 2009 at 2:12 AM, Alexander Spohr  wrote:

> Um, have to follow up to myself...
>
> Am 10.12.2009 um 08:02 schrieb Alexander Spohr:
>
> > Am 10.12.2009 um 04:34 schrieb Eric E. Dolecki:
> >
> >> Well - I wonder if it's possible to enable touches in a sub view but not
> for
> >> the entire view - just part of it.
> >>
> >> I have a view with buttons in it. I call up a sub view that requires
> touches
> >> for swiping... I want the buttons in the view below to still register
> touch
> >> events for that entire view.
> >
> > Usually the superview of the buttons would handle swipes.
> > If you have buttons put them on top (as a subview) of your swipe
> receiver.
> >
> > Or - as was pointed out - let the controller catch all touches.
>
> If your swipe view and buttons are in the same hierarchy
>
> - (void)bringSubviewToFront:(UIView *)view
> - (void)sendSubviewToBack:(UIView *)view
>
> should help.
>
> But as these are in the docs of UIView I am sure you already found them. ;)
>
>atze
>
>


-- 
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Question about touchesBegan

2009-12-10 Thread Eric E. Dolecki
What I am trying to do now is when I create the subView with the tuner bar,
I am setting it's view's bounds to something much smaller than the whole
screen and then animating it up. I think this approach might work.

On Thu, Dec 10, 2009 at 8:29 AM, Eric E. Dolecki  wrote:

> I'll elaborate a little more. I have a main view with some source buttons
> (UIButton) at the top. When I click one, I bring up a radio style tuner bar
> in a subview (animates up from the bottom). I am using touches to move the
> "pointer" in that subView. Works great, however because the subView is
> detecting touches for the whole subView - it prevents touches on those
> buttons in the main view. Do I simply need to architect this in another way?
> Say create a subview of just the UIButtons at the top of all subViews?
>
> - Eric
>
> On Thu, Dec 10, 2009 at 2:12 AM, Alexander Spohr  wrote:
>
>> Um, have to follow up to myself...
>>
>> Am 10.12.2009 um 08:02 schrieb Alexander Spohr:
>>
>> > Am 10.12.2009 um 04:34 schrieb Eric E. Dolecki:
>> >
>> >> Well - I wonder if it's possible to enable touches in a sub view but
>> not for
>> >> the entire view - just part of it.
>> >>
>> >> I have a view with buttons in it. I call up a sub view that requires
>> touches
>> >> for swiping... I want the buttons in the view below to still register
>> touch
>> >> events for that entire view.
>> >
>> > Usually the superview of the buttons would handle swipes.
>> > If you have buttons put them on top (as a subview) of your swipe
>> receiver.
>> >
>> > Or - as was pointed out - let the controller catch all touches.
>>
>> If your swipe view and buttons are in the same hierarchy
>>
>> - (void)bringSubviewToFront:(UIView *)view
>> - (void)sendSubviewToBack:(UIView *)view
>>
>> should help.
>>
>> But as these are in the docs of UIView I am sure you already found them.
>> ;)
>>
>>atze
>>
>>
>
>
> --
> http://ericd.net
> Interactive design and development
>



-- 
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Question about touchesBegan

2009-12-10 Thread Alexander Spohr

Am 10.12.2009 um 14:46 schrieb Eric E. Dolecki:

> What I am trying to do now is when I create the subView with the tuner bar, I 
> am setting it's view's bounds to something much smaller than the whole screen 
> and then animating it up. I think this approach might work.

I thought you did that already...
If not - it helps.

atze

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Question about touchesBegan

2009-12-10 Thread Eric E. Dolecki
Yup - setting the bounds is working. So I can have touches in my main view
and also in the sub view. Coming from Flash AS3, this stuff seems so
complicated in comparison.

On Thu, Dec 10, 2009 at 8:57 AM, Alexander Spohr  wrote:

>
> Am 10.12.2009 um 14:46 schrieb Eric E. Dolecki:
>
> > What I am trying to do now is when I create the subView with the tuner
> bar, I am setting it's view's bounds to something much smaller than the
> whole screen and then animating it up. I think this approach might work.
>
> I thought you did that already...
> If not - it helps.
>
>atze
>
>


-- 
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Bug with IB?

2009-12-10 Thread Eric E. Dolecki
If I create a UILabel in IB in a view & I place 1/2 of the label out of the
view at the top, I can't seem to drag the view window around by the title
bar where the label is. I know that having the control 1/2 out of the view
isn't normal, but shouldn't the view window move around regardless of where
I click on the window's title bar?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Using CATransition for large views

2009-12-10 Thread PCWiz
I'm using CATransition to swap views with [[view animator] 
replaceSubview:oldView with:newView]

The issue here is that when swapping between views with a large amount of 
content (e.g. a collection view with hundreds of items) there is a very 
noticeable 1-2 second delay before the animation starts.

This doesn't seem to be an issue with CATransition itself, as using 
replaceSubview:with: without the animator proxy still has the same issue. Is 
there another way in which I could still use CATransition, but be able to swap 
large views fast and smooth?

Thanks___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Bug with IB?

2009-12-10 Thread Henry McGilton (Boulevardier)

On Dec 10, 2009, at 6:24 AM, Eric E. Dolecki wrote:

> If I create a UILabel in IB in a view & I place 1/2 of the label out of the
> view at the top, I can't seem to drag the view window around by the title
> bar where the label is. I know that having the control 1/2 out of the view
> isn't normal, but shouldn't the view window move around regardless of where
> I click on the window's title bar?


Not necessarily --- if you just happen to click in the little IB icon in the 
window
title bar, you'll start a drag of that icon . . .

I just tried your experiment --- that is, place a UILabel halfway up out of the 
view
(essentially 'under' the title bar), and I'm able to drag the window/view around
with no problem at all *providing* I start the drag outside of the little IB 
icon . . .

Cheers,
. . . . . . . .Henry


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Bug with IB?

2009-12-10 Thread Eric E. Dolecki
Hmm - my View window is sized down to something like 200px tall. Maybe I
should QT capture it.

On Thu, Dec 10, 2009 at 10:57 AM, Henry McGilton (Boulevardier) <
appledevelo...@trilithon.com> wrote:

>
> On Dec 10, 2009, at 6:24 AM, Eric E. Dolecki wrote:
>
> > If I create a UILabel in IB in a view & I place 1/2 of the label out of
> the
> > view at the top, I can't seem to drag the view window around by the title
> > bar where the label is. I know that having the control 1/2 out of the
> view
> > isn't normal, but shouldn't the view window move around regardless of
> where
> > I click on the window's title bar?
>
>
> Not necessarily --- if you just happen to click in the little IB icon in
> the window
> title bar, you'll start a drag of that icon . . .
>
> I just tried your experiment --- that is, place a UILabel halfway up out of
> the view
> (essentially 'under' the title bar), and I'm able to drag the window/view
> around
> with no problem at all *providing* I start the drag outside of the little
> IB icon . . .
>
>Cheers,
>. . . . . . . .Henry
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/edolecki%40gmail.com
>
> This email sent to edole...@gmail.com
>



-- 
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Finding process path from Cocoa?

2009-12-10 Thread Sean McBride
On 12/9/09 2:49 PM, Laurent Daudelin said:

>I guess that with Carbon not being ported to 64bits,
>NSRunningApplication was needed. It just makes life a little harder if
>you have to support both 10.5 (which doesn't have NSRunningApplication
>but has Process Manager) and 10.6 (which has NSRunningApplication but
>doesn't support Process Manager in 64bits)...

The Process Manager isn't even part of Carbon.framework, it's in
ApplicationServices.h framework.  It's lineage is pre-OS X of course.

I think the idea of NSRunningApplication was more to fill holes in the
Cocoa APIs and minimize 'impedance mismatch'.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Manfred Schwind
> Be careful, though: Some MacOS versions have a bug where .strings files had 
> to be UTF16 to actually work. I don't think Apple has fixed that yet.

Do you have more specific information about that?
I consequently always used UTF-8 for all my .strings files in every project I 
ever worked on (for many years; I think I started with 10.1 or so) and never 
had a single problem with that.
What exactly does not work when not using UTF-16?
Maybe UTF-16 and UTF-8 both work, but - of course - no other encoding like ISO 
Latin or Mac Roman etc.?

Regards,
Mani
--
http://mani.de - friendly software

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Henry McGilton (Boulevardier)

On Dec 10, 2009, at 8:42 AM, Manfred Schwind wrote:

>> Be careful, though: Some MacOS versions have a bug where .strings files had 
>> to be UTF16 to actually work. I don't think Apple has fixed that yet.
> 
> Do you have more specific information about that?
> I consequently always used UTF-8 for all my .strings files in every project I 
> ever worked on (for many years; I think I started with 10.1 or so) and never 
> had a single problem with that.
> What exactly does not work when not using UTF-16?
> Maybe UTF-16 and UTF-8 both work, but - of course - no other encoding like 
> ISO Latin or Mac Roman etc.?


There is a very much in passing comment in  'Internationalising Programming 
Topics'  guide for Cocoa.

Note: It is recommended that you save strings files using the UTF-16 
encoding,
which is the default encoding for standard strings files. It is 
possible to create strings
files using other property-list formats, including binary property-list 
formats and XML
formats that use the UTF-8 encoding, but doing so is not recommended . 
. .

Cheers,
. . . . . . . .Henry

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Manfred Schwind
>>> Be careful, though: Some MacOS versions have a bug where .strings files had 
>>> to be UTF16 to actually work. I don't think Apple has fixed that yet.
>> 
>> Do you have more specific information about that?
>> I consequently always used UTF-8 for all my .strings files in every project 
>> I ever worked on (for many years; I think I started with 10.1 or so) and 
>> never had a single problem with that.
>> What exactly does not work when not using UTF-16?
>> Maybe UTF-16 and UTF-8 both work, but - of course - no other encoding like 
>> ISO Latin or Mac Roman etc.?
> 
> There is a very much in passing comment in  'Internationalising Programming 
> Topics'  guide for Cocoa.
> 
> Note: It is recommended that you save strings files using the UTF-16 
> encoding,
> which is the default encoding for standard strings files. It is 
> possible to create strings
> files using other property-list formats, including binary 
> property-list formats and XML
> formats that use the UTF-8 encoding, but doing so is not recommended 
> . . .

Ah - wait! I am using UTF-8 for the files in the Xcode Project. This makes it 
much easier to handle them in SCM systems etc. But Xcode automatically converts 
the strings files into UTF-16 when copying them into the final App bundle. I'm 
not sure this was always the case, though.

Regards,
Mani
--
http://mani.de - friendly software

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Problem with missing symbol

2009-12-10 Thread Emmanuel Pinault
Hi,

I am trying for some specific reason to access a private attribute and make it 
public for my need with the following code

in the .h

#import 

@interface NSStatusItem (hack)
- (NSRect)hackFrame;
@end


in the .m


import "NSStatusItem+hack.h"

@implementation NSStatusItem(hack)

- (NSRect)hackFrame
{
  return [_fWindow frame];
}

@end

void Init_nsstatusitem() { }


When compiling with the following I get


 gcc-4.2 -o NSStatusItem.bundle -bundle -framework AppKit NSStatusItem+hack.m
Undefined symbols:
  "_OBJC_IVAR_$_NSStatusItem._fWindow", referenced from:
  -[NSStatusItem(hack) hackFrame] in ccGpP6n1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


This use to work in 10.5 .. I am using 10.6 and this is not linking due to 
missing symbol.  What I do not get, is that the _fWindow is still an attribute 
in the NSSStatusItem...

any idea?

Thanks

Emmanuel___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Kyle Sluder
On Dec 10, 2009, at 9:46 AM, Emmanuel Pinault   
wrote:


This use to work in 10.5 .. I am using 10.6 and this is not linking  
due to missing symbol.  What I do not get, is that the _fWindow is  
still an attribute in the NSSStatusItem...


It's not an attribute, it's an instance variable. Private instance  
variables are no longer exported, so you can't use them from  
categories compiled in another library.


You might be able to use the ObjC runtime methods to get at the ivar,  
but I suspect the "official" solution is going to be "don't mess  
around with private ivars!"


--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Douglas Davidson


On Dec 10, 2009, at 8:42 AM, Manfred Schwind wrote:

Be careful, though: Some MacOS versions have a bug where .strings  
files had to be UTF16 to actually work. I don't think Apple has  
fixed that yet.


Do you have more specific information about that?
I consequently always used UTF-8 for all my .strings files in every  
project I ever worked on (for many years; I think I started with  
10.1 or so) and never had a single problem with that.

What exactly does not work when not using UTF-16?
Maybe UTF-16 and UTF-8 both work, but - of course - no other  
encoding like ISO Latin or Mac Roman etc.?


The .strings files are actually a special case of plist files.  There  
are three supported formats:  first, the special .strings file format,  
which is UTF-16 plain text consisting of lines of


"key" = "value";

pairs with optional comments; second, the XML plist format; third, the  
binary plist format.  The .strings file format is the recommended  
format for .strings files.  If you use this format, you should use  
UTF-16 with a BOM.  If you use the XML plist format, the encoding  
specification is as per XML, but almost always one would use UTF-8.   
If you use the XML or binary plist format, the contents must be a  
dictionary of strings.


Douglas Davidson


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Emmanuel Pinault

On Dec 10, 2009, at 9:53 AM, Kyle Sluder wrote:

> On Dec 10, 2009, at 9:46 AM, Emmanuel Pinault  wrote:
> 
>> This use to work in 10.5 .. I am using 10.6 and this is not linking due to 
>> missing symbol.  What I do not get, is that the _fWindow is still an 
>> attribute in the NSSStatusItem...
> 
> It's not an attribute, it's an instance variable. Private instance variables 
> are no longer exported, so you can't use them from categories compiled in 
> another library.

That explains. I must have missed that in the newer version of Obj-C

> 
> You might be able to use the ObjC runtime methods to get at the ivar, but I 
> suspect the "official" solution is going to be "don't mess around with 
> private ivars!"

How would you suggest I get the Frame information from the window then?

> 
> --Kyle Sluder

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread lbland

On Dec 10, 2009, at 1:15 PM, Emmanuel Pinault wrote:

> How would you suggest I get the Frame information from the window then?

hi-

Don't know what you're up to, but this NSWindow method:

+frameRectForContentRect:styleMask:

has been around for a long time.

also, this one:

- frameRectForContentRect:(NSRect)windowContent

thanks!-

-lance

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Emmanuel Pinault

On Dec 10, 2009, at 10:24 AM, lbland wrote:

> 
> On Dec 10, 2009, at 1:15 PM, Emmanuel Pinault wrote:
> 
>> How would you suggest I get the Frame information from the window then?
> 
> hi-
> 
> Don't know what you're up to, but this NSWindow method:
> 
> +frameRectForContentRect:styleMask:
> 
> has been around for a long time.
> 
> also, this one:
> 
> - frameRectForContentRect:(NSRect)windowContent
> 
> thanks!-

I am trying to create a small item in the status bar, which when I click, I can 
show at a glance a small calendar... kind of like how Gnome does it. Really 
convenient and better than loading the full dashboard at times.. Anyway I using 
rubycocoa and this is the code I am trying to have to work.

The hackFrame method was returning the result of a the [ _fWindow Frame] 
method.   But if  I cannot access the _fWindow since it is private, not sure 
how else I can

I will look at those methods then. But this is what I am up to (using RubyCocoa)

statusbar = NSStatusBar.systemStatusBar
@item = statusbar.statusItemWithLength(NSVariableStatusItemLength)
image = NSImage.alloc.initWithContentsOfFile("cal.png")
@item.setImage(image)
@item.setAction :clicked

calendarController = 
CalendarController.alloc.initWithPosition(@item.hackFrame)<== I need the 
frame here 

> 
> -lance
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Emmanuel Pinault

> I am trying to create a small item in the status bar, which when I click, I 
> can show at a glance a small calendar... kind of like how Gnome does it. 
> Really convenient and better than loading the full dashboard at times.. 
> Anyway I using rubycocoa and this is the code I am trying to have to work.
> 

I should clarify that all I am trying to do is to get the initial position of 
the new item on the status bar to position a small window (like a contextual 
menu) right under that icon when clicking on it.

> IThe hackFrame method was returning the result of a the [ _fWindow Frame] 
> method.   But if  I cannot access the _fWindow since it is private, not sure 
> how else I can
> 
> I will look at those methods then. But this is what I am up to (using 
> RubyCocoa)
> 
>statusbar = NSStatusBar.systemStatusBar
>@item = statusbar.statusItemWithLength(NSVariableStatusItemLength)
>image = NSImage.alloc.initWithContentsOfFile("cal.png")
>@item.setImage(image)
>@item.setAction :clicked
> 
>calendarController = 
> CalendarController.alloc.initWithPosition(@item.hackFrame)<== I need the 
> frame here 
> 
>> 
>> -lance
>> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Detecting lack of user input system wide.

2009-12-10 Thread David M. Cotter
dunno about cocoa, but in Carbon land you can do InstallEventLoopIdleTimer().  
I expect there is an equivalent in cocoa

On Dec 10, 2009, at 1:10 AM, Kenny Carruthers wrote:

> Hello,
> 
> What is the correct way to detect that there has been no keyboard or mouse
> input by the user over a given period of time? Ideally, I'd like my
> application to stop a timer if there is no activity at all from the user in
> any application. Think of a time tracking app that stops tracking time after
> 5 minutes.
> 
> Sorry if this is actually easy to find (or in the archives) but I can't seem
> to figure out the right Google search keywords to return a decent answer.
> 
> Sincerely,
> Kenny

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Suspend the execution of background thread on modal window launch

2009-12-10 Thread Arun
Hi All,

I have an application in which i perform several activities in background.
In the UI, if the user presses cancel, i will open a modal window which
prompts for confirmation of cancel/resume. At this point of time i need to
suspend all my background thread. Is it possible?

Thanks
Arun KA
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Lee Ann Rucker


On Dec 10, 2009, at 10:39 AM, Emmanuel Pinault wrote:



I am trying to create a small item in the status bar, which when I  
click, I can show at a glance a small calendar... kind of like how  
Gnome does it. Really convenient and better than loading the full  
dashboard at times.. Anyway I using rubycocoa and this is the code  
I am trying to have to work.




I should clarify that all I am trying to do is to get the initial  
position of the new item on the status bar to position a small  
window (like a contextual menu) right under that icon when clicking  
on it.



Have you tried using [NSStatusItem setView:]?



IThe hackFrame method was returning the result of a the [ _fWindow  
Frame] method.   But if  I cannot access the _fWindow since it is  
private, not sure how else I can


I will look at those methods then. But this is what I am up to  
(using RubyCocoa)


  statusbar = NSStatusBar.systemStatusBar
  @item = statusbar.statusItemWithLength(NSVariableStatusItemLength)
  image = NSImage.alloc.initWithContentsOfFile("cal.png")
  @item.setImage(image)
  @item.setAction :clicked

  calendarController =  
CalendarController.alloc.initWithPosition(@item.hackFrame)<== I  
need the frame here




-lance





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com

This email sent to lruc...@vmware.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [iPhone] UINavigationController and UINavigationBar

2009-12-10 Thread Thomas Engelmeier

Am 09.12.2009 um 02:02 schrieb Duccio:

> Yes, I know, but no backgroundImage property :-) And Apple documentations 
> says, for example: "It is permissible to modify the barStyle or translucent 
> properties of the navigation bar but you must never change its frame,bounds, 
> or alpha values directly." so very restrictive...

Well, setting the frame or bounds simply will not work. Enjoy the case when 
UINavigationBar for some reason out of your control believes it is in a 
different UIInterfaceOrientation and you need some way to convince it to use 
the tall / small variant. 

Regards,
Tom_E___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


xpath variable in NSXMLNode

2009-12-10 Thread Rainer Standke

Hello,

I'd like to use a variable in an XPath query like this, where the  
variable would be $xPathVar1:


NSArray *nodes = [document nodesForXPath:@".//d...@class = 'filmo']/ol/ 
li/a/text() = $xPathVar1" error:&err];


Is this possible? How would I declare and set the variable?

Thanks,

Rainer
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Leopard for development / testing.

2009-12-10 Thread Evadne Wu
Hi Dan,

If you already have a copy of OS X, you have everything necessary.  Pop 
the DVD in and look for Developer Utilities.  Apple bundles them for free with 
every copy of OS X.  If you’re talking about private betas you’ll need to 
become an ADC member.

ev

On Dec 10, 2009, at 12:37 PM, Dan Ribe wrote:

> Hi All,
> 
> I want to get a copy of Leopard for development/testing purpose. Can anyone
> please let me know.
> 
> - Is there anyway to download it from apple's site ?
> - Does apple provides Leopard copy for Development/Testing for free or I
> have to pay for that ?
> - If apple provides free copy of Leopard for development/testing purpose
> then what I need to do to get one ?
> 
> Please excuse me as my question is not related to cocoa but I thought
> someone will be able to answer it in this list. Thanks for your help !
> 
> Cheers
> -Dan
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/ev%40monoceroi.com
> 
> This email sent to e...@monoceroi.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


.h file won't load

2009-12-10 Thread Charlie Dickman
I'm developing an app that has the Appkit.framework in the Frameworks project 
folder. I am trying to use the NSString Application Kit Additions which 
document that they are defined in the  NSStringDrawing.h file in 
Appkit.framework yet when I #import NSStringDrawing.h or 
Appkit/NSStringDrawing.h the compiler reports that no such file can be found.

Looking in the Appkit/headers folder it definitely is there. What do I have to 
do to get the compiler to recognize it?

Charlie Dickman
3tothe...@comcast.net___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: .h file won't load

2009-12-10 Thread Luke the Hiesterman
The NSStringDrawing.h header is include in AppKit.h, so you should just be able 
to include AppKit like this:

#include 

Were you forgetting the < and > ?

Luke

On Dec 10, 2009, at 11:51 AM, Charlie Dickman wrote:

> I'm developing an app that has the Appkit.framework in the Frameworks project 
> folder. I am trying to use the NSString Application Kit Additions which 
> document that they are defined in the  NSStringDrawing.h file in 
> Appkit.framework yet when I #import NSStringDrawing.h or 
> Appkit/NSStringDrawing.h the compiler reports that no such file can be found.
> 
> Looking in the Appkit/headers folder it definitely is there. What do I have 
> to do to get the compiler to recognize it?
> 
> Charlie Dickman
> 3tothe...@comcast.net___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
> 
> This email sent to luket...@apple.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Emmanuel Pinault

> 
> Have you tried using [NSStatusItem setView:]?
> 


setView is for custom view.. Because if I dont  do a setView, the view Method 
return nil so far.  And looking at the doc it mentions that it is for custom 
view.

I am looking at something similar called MAAAttachedWindow class made by 
someone else. Seems like the way around is to actually use a custom view in a 
way. The developer seem to use the NSScreen and some other logic to figure out 
based  on where you click (so on the status item in the bar) and get the exact 
point of the click. Then he calculate where his custom view and window should 
be displayed. 

Thanks 

Emmanuel___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


dynamically create/remove IB elements and instance vars?

2009-12-10 Thread Patrick J. Collins
Hi,

I just wrote a basic little cocoa app to test my knowledge after going through
Apple's Currency Converter tutorial...

I made two text fields, and when you click a button, it combines the two words
together and displays them in a label.

I would like to expand on this and make it a little more interesting and
challenging, but I don't know how to do what I am thinking-- which is:

Create a button which will insert a new label/text field.  This action also
needs to dynamically generate an instance variable in my model file for the
text of the new textfield, as well as generate an IBOutlet in my controller.

...  I know how to do this immediately with javascript-- but.. objective-c and
xcode...  no clue!

Any suggestions?

Patrick J. Collins
http://collinatorstudios.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with missing symbol

2009-12-10 Thread Lee Ann Rucker


On Dec 10, 2009, at 1:24 PM, Emmanuel Pinault wrote:





Have you tried using [NSStatusItem setView:]?




setView is for custom view.. Because if I dont  do a setView, the  
view Method return nil so far.  And looking at the doc it mentions  
that it is for custom view.


I am looking at something similar called MAAAttachedWindow class  
made by someone else. Seems like the way around is to actually use a  
custom view in a way. The developer seem to use the NSScreen and  
some other logic to figure out based  on where you click (so on the  
status item in the bar) and get the exact point of the click. Then  
he calculate where his custom view and window should be displayed.



Right. "Custom view" just means a view where you put your own UI; it  
doesn't have to be a subclass of NSView.  It would be a lot easier  
than creating a window - which contains an NSView, if it's Cocoa - and  
working out where to show it; all that work is done for you.





Thanks

Emmanuel


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: dynamically create/remove IB elements and instance vars?

2009-12-10 Thread Quincey Morris
On Dec 10, 2009, at 14:21, Patrick J. Collins wrote:

> I would like to expand on this and make it a little more interesting and
> challenging, but I don't know how to do what I am thinking-- which is:
> 
> Create a button which will insert a new label/text field.  This action also
> needs to dynamically generate an instance variable in my model file for the
> text of the new textfield, as well as generate an IBOutlet in my controller.

But why? In the exact terms you've used, this is not a pattern you're likely to 
use in any practical application. Although Objective-C is in many senses a 
dynamic language, this particular kind of dynamism is not usual in most 
applications.

If there's only one "new" label, then you might as well go ahead and design it 
into your code and your interface to begin with (even if it's hidden 
initially). If there might be an arbitrary number of new labels to show in the 
interface, you might use an NSArray or NSDictionary instance variable to hold 
the values, and a NSTableView to display them.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


String attributes in the iPhone SDK

2009-12-10 Thread Charlie Dickman
I use the following code to determine the height and width of a string in the 
Snow Leopard version of an app

NSMutableDictionary *textAttributes = [[[NSMutableDictionary alloc] 
init] autorelease];
[textAttributes setObject: [NSFont fontWithName: @"Garamond Bold" size: 
24]
  forKey: 
NSFontAttributeName];
[textAttributes setObject: [NSColor blackColor]
  forKey: 
NSForegroundColorAttributeName];


NSString *text = [NSString stringWithFormat: @"%d", h];
NSSize textSize = [faceText sizeWithAttributes: 
faceTextAttributes];

x -= faceTextSize.width / 2.;
y -= faceTextSize.height / 2.;

I'm tearing my hair out trying to figure out how to accomplish the same thing 
in the iPhone SDK. Can anybody help me?

Charlie Dickman
3tothe...@comcast.net



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: String attributes in the iPhone SDK

2009-12-10 Thread Greg Parker
On Dec 10, 2009, at 3:44 PM, Charlie Dickman wrote:
> I use the following code to determine the height and width of a string in the 
> Snow Leopard version of an app
> 
>   NSMutableDictionary *textAttributes = [[[NSMutableDictionary alloc] 
> init] autorelease];
>   [textAttributes setObject: [NSFont fontWithName: @"Garamond Bold" size: 
> 24]
> forKey: 
> NSFontAttributeName];
>   [textAttributes setObject: [NSColor blackColor]
> forKey: 
> NSForegroundColorAttributeName];
> 
>   
>   NSString *text = [NSString stringWithFormat: @"%d", h];
>   NSSize textSize = [faceText sizeWithAttributes: 
> faceTextAttributes];
>   
>   x -= faceTextSize.width / 2.;
>   y -= faceTextSize.height / 2.;
> 
> I'm tearing my hair out trying to figure out how to accomplish the same thing 
> in the iPhone SDK. Can anybody help me?

First, get a UIFont representing the font you want.
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIFont_Class/Reference/Reference.html

Then measure the string with -[NSString sizeWithFont:] or some variant thereof.
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/NSString_UIKit_Additions/Reference/Reference.html


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Sending action from Switch type NSButton?

2009-12-10 Thread Laurent Daudelin
Not sure I am missing something but isn't it possible to send an action from a 
switch type NSButton each time it's toggled?




-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Sending action from Switch type NSButton?

2009-12-10 Thread Brent Smith
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSControl_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/controlTextDidChange:

I believe its the controlTextDidChange delegate method.

On Dec 10, 2009, at 4:09 PM, Laurent Daudelin wrote:

> Not sure I am missing something but isn't it possible to send an action from 
> a switch type NSButton each time it's toggled?
> 
> 
> 
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://nemesys.dyndns.org
> Logiciels Nemesys Software
> laurent.daude...@gmail.com
> Photo Gallery Store: 
> http://laurentdaudelin.shutterbugstorefront.com/g/galleries
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/liarepmi%40hack3r.com
> 
> This email sent to liare...@hack3r.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSCell's mouse tracking method never called

2009-12-10 Thread Martin Cote
On Wed, Dec 9, 2009 at 11:50 PM, Martin Cote  wrote:
> Hello,
>
> I'm trying to track the mouse in my custom NSCell subclass, which is
> used to display the content of a NSTableView.  For that matter, I
> override the following method:
>
> - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame
> ofView:(NSView *)controlView untilMouseUp:(BOOL)flag;
>
> The problem is that this method is never called for some reason that eludes 
> me.

I found what the problem was.  The hitTestForEvent:inRect:ofView:
method had to be overridden to return NSCellHitTrackableArea.

Problem solved.

Martin Cote
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Binding an Array of Dictionaries

2009-12-10 Thread Gerriet M. Denkmann
I have a window with an NSTableView which is bound to an NSArrayController 
which has as content an NSMutableArray called "theArrayOfDictionaries".
Works fine.

"theArrayOfDictionaries" contains NSMutableDictionaries.
So I added another NSTableView to my window, bound to an 
NSDictionaryController, which has it's content bound to 
NSArrayController.selection.

But the documentation says about selection: "proxy object representing the 
receiver’s selection".
And it's no surprise that I get an exception: "Cannot create NSDictionary from 
object [...] of class _NSControllerObjectProxy"

Well, everything behaves as documented - no reason to complain.

But: how to I populate my NSDictionaryController with the NSMutableDictionary 
currently selected in my NSArrayController?
And also: make sure that any changes done in this current dictionary (the 
NSTableViews will be editable) get back into "theArrayOfDictionaries"?


Kind regards,

Gerriet.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[ myWorkSpace openURL: myurl ] is leaking. Why??

2009-12-10 Thread Parimal Das
Hi all,

This is a very simple code.  And it is always leaking.

-(void)awakeFromNib {

NSAutoreleasePool* pool =  [ [NSAutoreleasePool alloc ] init ];

NSWorkspace* ws = [NSWorkspace sharedWorkspace];

NSString* tempUrl = @"http://www.google.com";;

NSURL* myurl = [NSURL URLWithString:tempUrl];

   * [ws openURL:myurl]; * *// Here NSCFDictionary is leaking 64 bytes
twice. (shown by instruments)*

[pool release];

}

leaks shows:
Process 1605: 8513 nodes malloced for 1063 KB
Process 1605: 2 leaks for 128 total leaked bytes.
Leak: 0x13b9b0  size=64instance of 'NSCFDictionary', type ObjC,
implemented in Foundation
0xa0618740 0x01001080 0x 0x @.a.
0x 0x0003 0x0001 0x 
0x 0x0014 0xa1b1c1d3 0x 
0x 0x 0x 0x 
Leak: 0x141220  size=64instance of 'NSCFDictionary', type ObjC,
implemented in Foundation
0xa0618740 0x01001080 0x 0x @.a.
0x 0x0003 0x0001 0x 
0x 0x0014 0xa1b1c1d3 0x 
0x 0x 0x 0x 

I must be missing something here.
Can anyone point what is wrong here.

Advanced thanks.
-Parimal Das
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com