Denise Eatherly | 1 Nov 2004 05:02

framework class

Hi,

I am working on a little app that uses a few classes from a framework I 
built and regularly use with other apps.  Most of the classes are 
happy.  However, there is one, a subclass of NSImage that doesn't seem 
to be recognized by the new app.  I checked the framework to be sure it 
is 'public,'  though I am not getting compile errors in the code that 
defines the class or the #import <myFramework/RCLabeledImage.h> 
statement:
	RCLabeledImage *anImage = [ [ RCLabeledImage alloc ] 
initByReferencingFile:path ];
	anImage is nil after this statement
	NSLog( <at> "% <at> ", NSStringFromClass( [ RCLabeledImage class ] );
	This prints (null)

If I copy the class into the little app and change the import 
statement, everything is fine, so the class itself works if it can be 
found.

Does anyone any ideas on where to look to track down this problem?

Thanks,
Denise
Anthony Brian Arthur | 1 Nov 2004 10:52
Picon

NSController & Registering Dependent Keys

Anyone have luck with using this hook?

http://developer.apple.com/documentation/Cocoa/Conceptual/ 
KeyValueObserving/Concepts/DependentKeys.html

I have followed this example for one of my model objects, and it does  
not work at all.  Anyone know of a bug or an extra step missing from  
these docs?

Thanks,

--Brian
Ruedi Heimlicher | 1 Nov 2004 17:26
Picon
Favicon

User Comments in Cocoa

Hi
Is there a possibility to set and get User Comments in Cocoa?
There is a call in carbon (PBDTGetCommentSync)  that requires a 
'DTPBPtr' paramBlock structure where the 'desktop database reference 
number ioDTRefNum' is needed. No idea where to get this number.
Thanks
Ruedi Heimlicher
Matt Neuburg | 1 Nov 2004 17:47
Favicon
Gravatar

Re: Changing the Font size of NSTextView

On Fri, 29 Oct 2004 12:11:58 -0700, Troy Payne <troypayne@...> said:
>Hi I am using cocoa, obj-c, and I want to change the font size of my
>NSTextView with a slider, like Font Book does.  I don't need help with
>the slider part of it, just a basic way on how to change the font size
>of the contents of a NSTextView, using code, not a font panel.

With an NSTextView, you have to adjust the font for every style run
individually. Luckily in Panther this is really easy: call changeAttributes
and implement convertAttributes. Your convertAttributes will automatically
be called for each style run, so you can set the font size and return the
adjusted attributes dictionary. m.

--

-- 
matt neuburg, phd = matt@..., <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
Douglas Davidson | 1 Nov 2004 18:39
Picon
Favicon

Re: Changing the Font size of NSTextView


On Nov 1, 2004, at 8:47 AM, Matt Neuburg wrote:

>> Hi I am using cocoa, obj-c, and I want to change the font size of my
>> NSTextView with a slider, like Font Book does.  I don't need help with
>> the slider part of it, just a basic way on how to change the font size
>> of the contents of a NSTextView, using code, not a font panel.
>
> With an NSTextView, you have to adjust the font for every style run
> individually. Luckily in Panther this is really easy: call 
> changeAttributes
> and implement convertAttributes. Your convertAttributes will 
> automatically
> be called for each style run, so you can set the font size and return 
> the
> adjusted attributes dictionary. m.

There is also a superclass method setFont:, which will set the font for 
the entire text.  Be aware, though, that this does not include the 
calls to shouldChangeTextInRange:replacementString:/didChangeText that 
should be used for changes that are intended to respond to user 
actions, so you would need to do those yourself, if for example you 
wanted these changes to be undoable.  Maybe something like this:

     unsigned textLength = [[textView textStorage] length];
     if (textLength > 0 && [textView 
shouldChangeTextInRange:NSMakeRange(0, textLength) 
replacementString:nil]) {
         [textView setFont:newFont];
         [textView didChangeText];
(Continue reading)

Nicholas Riley | 1 Nov 2004 17:55
Picon

Re: User Comments in Cocoa

On Mon, Nov 01, 2004 at 05:26:33PM +0100, Ruedi Heimlicher wrote:
> Hi
> Is there a possibility to set and get User Comments in Cocoa?
> There is a call in carbon (PBDTGetCommentSync)  that requires a 
> 'DTPBPtr' paramBlock structure where the 'desktop database reference 
> number ioDTRefNum' is needed. No idea where to get this number.

That either does nothing or sets the pre-Mac OS X form of comments,
which aren't too useful to you.

The only supported way of getting/setting comments is sending Apple
Events to the Finder, and it's very slow.  See the gigantic threads on
the carbon-dev mailing list about this for more.

And please file a bug so we can get real comment setting APIs in a
future OS release.

--

-- 
Nicholas Riley <njriley@...> | <http://www.uiuc.edu/ph/www/njriley>
Amar Sagoo | 1 Nov 2004 19:58
Picon

Re: NSController & Registering Dependent Keys

I implemented something based on this example recently, and it works 
fine.
What behaviour are you seeing/not seeing?

Amar
Bob Frank | 1 Nov 2004 22:15
Picon
Favicon

MEETING: Chicago - Tuesday November 2nd 6:00 PM

Hi All,

Just a reminder, the Chicago Cocoa and WebObjects User Group (CAWUG) is  
holding our next  meeting this Tuesday, November 2nd at 6:00 PM at the  
Apple Store on Michigan Ave.

NOTE: Yes tomorrow is election day.  Please remember to go out and  
vote.  Also, because tomorrow is election day, a few regulars have  
mentioned that they won't be albe to make it this month.  I'd  
appreciate it if you'd RSVP to me if you're thinking about attending.

     Agenda:
	- Introductions & Announcements
	- WOOGNL - bindings on steroids
	- future meeting topics
	- Q & A
	- adjournment to O'Toole's

     When:	Tuesday, November 2nd, 6:00 PM
     Where:	Apple Store Michigan Avenue
		679 North Michigan Ave. (at the corner of Huron & Michigan Ave.)
		Chicago, IL 60611
		http://maps.yahoo.com/maps_result? 
ed=gYbE5Op_0Tokf_p7h61dwjbWtjC2r1YehzWw&csz=60611

- Project Wonders WOOGNL implementation
	I recently got to use WO OGNL for the first time in a custom project  
and was very impressed with it (in addition to the fact that I really  
had to learn it).  I will be talking about it tomorrow.

(Continue reading)

Denise Eatherly | 3 Nov 2004 00:36

printing pdf images

Hi,

Each image for my buttons comes from a pdf file.  The files were sent 
to me via Mail.app. When I print the mail message, all the images show 
up nice and crispy.  However, once I put the images in buttons ( or in 
NSImageViews ), and print the view,  the images look really fuzzy.  
Does anyone know how to solve this problem?

Here is the test code:

  - ( void )awakeFromNib;
{
     NSImage *buttonImage = [ [ NSImage alloc ] initByReferencingFile:[ 
[ NSBundle mainBundle ] pathForResource: <at> "cancelButton" ofType: <at> "pdf" ] 
];
// [ buttonImage setScalesWhenResized:NO ];  // this seems to have no 
effect either way
     [ aButton setImage:buttonImage ];  // set in IB to show the image 
in the center
     [ anImageView setImage:buttonImage ];  // set in IB for No Scaling
}

- ( IBAction )print:( id )sender
{
     NSPrintOperation *printOp = [NSPrintOperation 
printOperationWithView:[ window contentView ] printInfo:[ NSPrintInfo 
sharedPrintInfo ] ];
     [ printOp setShowPanels:YES ];
     [ printOp runOperationModalForWindow: window delegate:nil 
didRunSelector:NULL contextInfo:NULL ];
(Continue reading)

Grigory Entin | 3 Nov 2004 14:32
Picon
Favicon

"stuck" state of processes

Hi,

I've seen some similar questions raised a few years ago, but haven't
been able to find the answer. Probably, something has changed since
that time..

Could somebody shed some light on what are "stuck" processes reported
by Mac OS X "top"? As far as I got it, it's Mach-specific, but I can't
a more detailed "explanation"..

Some background for our particular case:
>>
The problem is that our application is experiencing *very* noticable
slowdowns due to unknown reason for some users, when it accesses a
database on disk (particularly, sqlite DB). On some Macs the operation
completes in 2-3 seconds, on others it takes 2-3 *minutes*. There's
absolutely *no* dependency on hardware specs.

According to "top" in "problematic" cases, there's plenty of free RAM
during the execution and system is 70% idle during the operation,
while our process does take about 5% CPU. And there's one "stuck"
process.

In "normal" cases, our process takes up to 80% CPU and there's no
stuck processes.

I guess the slowdown can be somehow related to stuck process reported
by top.
>>

(Continue reading)


Gmane