Manipulate the NSTextview, several questions...

2008-10-07 Thread Cloud Strife
Hi everyone. I am using the NSTextview to perform some functions of my
application. I want to implement:
1. The NSTextiview has several lines of output, when the user click(or
double-click) one line of the text, I want to the NSTextview to highlight
the line which the user clicked with some light color, i.e. the light blue,
the light green and so on. Then how to?
2. Following the question 1,  I also want to know which line the user select
and hence to get the content of the line. How to?

In order to describe my purpose clearly, assuming we have a nstextview with
content as following:

Line1: Content of Line1;
Line2: Content of LIne2;

When the user click the line 1, the line 1 is highlighted by light-blue
mark.
And I can use some piece of code to know the user has selected line 1, and
retrieve the content of line 1:
Line1: Content of Line1;
as a nsstring object.

Can anyone tell me how to accomplish these tasks? Thank you very much for
any help.
Have a good day
-- 
Best regards.
___

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 [EMAIL PROTECTED]


Use the CATransition to switch one layer from another layer with Core Image effects?

2008-08-02 Thread Cloud Strife
Hi everyone.
Maybe the idea as the topic mentioned sounds a little crazy, I really want
to realize it.
For example, I created two layer with ImageA and ImageB. Now I am displaying
ImageA in LayerA to users. After the user click some button, I should
display ImageB in LayerB to the user with the Core Image transition effects
like page curl, swipe, water ripple and so on.
Can anyone give me a guidance to do that? Thank you very much for any help.
Good Luck. :-)

-- 
Best regards.
___

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 [EMAIL PROTECTED]


Unable to detect a NSRightMouseDown event using a three-button mouse?

2008-07-26 Thread Cloud Strife
Hi everyone. Maybe this issue is very odd, but I came across it indeed.
I wrote an application using an override NSView to respond events trigged by
users. Obviously, rewrite the -(void)mouseDown:(NSEvent* )theEvent is
necessary.
I want to test what button of mouse the user presses. So I want to check the
output of the [NSEvent type] value. Surprisingly, the output value is always
1, that is NSLeftMouseDown. No matter what button I pressed, the left button
or the right button, using a three-button mouse, cocoa kept reporting I
pressed the left button.

I am using a mouse shipped with Mac Pro(one key only), and a mouse made by
Microsoft(three keys, I am using it for testing :-) ). It is understandable
cocoa can only detect the left key when using the one-key mouse. But it is a
little puzzled returning a left-button-down  event when press the right
button. Maybe cocoa is angry with Microsoft Mouse?


It is really strange... Can anyone here tell me what is wrong here? Any help
is highly appreciated.
Thank you very much. Have a nice day.

-- 
Best regards.
___

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 [EMAIL PROTECTED]


Create a window with status bar at its bottom, how to do?

2008-07-20 Thread Cloud Strife
Hi everyone. I am interested to create a window with status bar at its
bottom. Hmm, you can see Xcode editor window as an example, once we open a
.m source file, the editor window has a status bar at its bottom. When click
the build and run buttom, you can see the prompt information from Xcode
showing there. It is quite a useful feature to provide notification to
users.

Then, is anyone here having the knowledge to accomplish that? I am totally
messed up with lots lots of document of NSWindow...
Any guidance is greatly appreciate! :-)

Thank you very much.


-- 
Best regards.
___

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 [EMAIL PROTECTED]


how to eliminate an annoying issue of the multi-document cocoa application?

2008-07-18 Thread Cloud Strife
Greetings everyone.
I am new to creating an new multi-doc application with Cocoa framework.
After I created such one using the Xcode built-in template. There was a
window, the new document, automatically jump out after I launched the
application. Due to the requirement of my application, this behavior is
rather annoying.  I am wondering is there any way to avoid this behavior?
In other words, I want to make the new document can only be created by
issuing the explicit command to the application, for example, by clicking
the New menu item.
If anyone knows any solution to this problem, would you please give me a
guidance? Any help is highly appreciated.

Thank you very much in advance.

-- 
Best regards.
___

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 [EMAIL PROTECTED]


how to clear the whole render tree of CALayer fast and safely?

2008-07-18 Thread Cloud Strife
Hi, everyone.Assuming there is a Core Animation render tree with many
calayers and complex levels, should I use the iteration function to remove
one layer from one layer or there just is some useful function to delete the
whole render tree neatly at once to make the app robust ?

After created and some work to the existing render tree, I want to clean it
to release the CPU and memory and GPU it occupied. Because the performance
and stability are the main keys of my application. I wrote some ugly code to
do that, as expected, the result is very bad, my application crashed ...
:-(

[self cleanWindowContentViewSubLayers:[[[_aWindow contentView] layer]
sublayers ]];


-(void) cleanWindowContentViewSubLayers:(NSArray*)_Layers{

int i, count = [_Layers count];

for(i = 0;i  count; i++){

CALayer* _oneLayer = (CALayer*)[_Layers objectAtIndex:i];

[self cleanWindowContentViewSubLayers:[_oneLayer sublayers]];

//if the _oneLayer is the leaf of the render tree, when iterating the next
level of the stack, the for statement won't execute for the _Layers == nil

//then we can delete it

[_oneLayer removeFromSuperlayer];

[_oneLayer release];

}

}

here are so many smart developers. Would any one give me a guidance to
accomplish this task?

Any discussion or help is highly welcome. :-)

Thank you in advance.



-- 
Best regards.
___

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 [EMAIL PROTECTED]


any other type of value for the fromValue property of CAAnimation?

2008-07-11 Thread Cloud Strife
Hi everyone.After explore the Core Animation for a while, I found that the
fromValue property of CAAnimation was only set to NSNumber in many samples
and tutorials, although the Apple's document says it accepts the id value.

I am wondering whether I could set  this property to NSColor or CGColor
inorder to change the layer color dynamically. For example, If I want to
change a Green layer to a red one from time to time, could anyone give me a
guidance?

Thank you very much for any help.

-- 
Best regards.
___

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 [EMAIL PROTECTED]