Re: Print Preview with different page size

2014-11-12 Thread Leonardo
Thanks. Me too I got the same conclusions.
Anyway, I export the document as PDF with different page size using my own
procedure. That works.

Regards
-- Leonardo


> Da: Graham Cox 
> Data: Thu, 13 Nov 2014 10:01:12 +1100
> A: Leonardo 
> Cc: 
> Oggetto: Re: Print Preview with different page size
> 
> 
>> On 13 Nov 2014, at 4:44 am, Leonardo  wrote:
>> 
>> Any solution?
> 
> 
> Probably not, since printers are not physically designed to accommodate odd
> mixes of paper sizes (other than initially selecting a source tray for a print
> job). The design of the code reflects that.
> 
> --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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: updating NSTextField before spinner animates

2014-11-12 Thread Graham Cox
The right solution is, as Fritz mentioned, to design your code to work 
asynchronously. But for a quick-and-dirty solution to force a text field (or 
any other UI) to show a change straight away is to include the redraw directly 
yourself. This should not be done from a thread other than main however.

[_infoField setStringValue:@"hello world!"];
[[_infoField window] displayIfNeeded];  // processes view 
updates pending

// . some lengthy code that blocks the main thread, delaying normal updates 
.


--Graham



> On 12 Nov 2014, at 7:58 pm, sqwarqDev  wrote:
> 
>> On 11 Nov 2014, at 23:01, Fritz Anderson  wrote:
> 
>> -needsDisplay schedules a view’s -drawRect: for the next pass through the 
>> runloop. You’re putting your process to sleep at the OS level, so the 
>> runloop is suspended along with everything else.
>> 
>> What you posted is evidently a minimal case, and maybe, instead of sleep(), 
>> your lengthy method is called instead. Same principle: Unless that method 
>> runs asynchronously (or simulates asynchrony by doing its work piecewise on 
>> an NSTimer, or by periodically sending -runMode:beforeDate: to the runloop), 
>> the runloop never has the chance to dispatch view updates.
> 
> 
> Thanks for this Fritz. I think I get it. I need to get a clearer idea of how 
> the run loop works. This isn't the first time I've been confused about why a 
> line doesn't appear to return the result I expect before the next line 
> executes. I suppose this is part of the difference between using traditonal 
> procedural languages and these /new-fangled/ object-oriented ones... :~)
> 
> I guess I've got some reading up to do! Thanks again.


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Print Preview with different page size

2014-11-12 Thread Graham Cox

> On 13 Nov 2014, at 4:44 am, Leonardo  wrote:
> 
> Any solution?


Probably not, since printers are not physically designed to accommodate odd 
mixes of paper sizes (other than initially selecting a source tray for a print 
job). The design of the code reflects that.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: updating NSTextField before spinner animates

2014-11-12 Thread Fritz Anderson
On 12 Nov 2014, at 2:58 AM, sqwarqDev  wrote:

> Thanks for this Fritz. I think I get it. I need to get a clearer idea of how 
> the run loop works. This isn't the first time I've been confused about why a 
> line doesn't appear to return the result I expect before the next line 
> executes. I suppose this is part of the difference between using traditonal 
> procedural languages and these /new-fangled/ object-oriented ones... :~)

For the record, this isn’t a procedural-vs-object-oriented matter. Procedural 
applications may run in an asynchronous environment and OO languages can be run 
in a synchronous environment.

— F


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: CoreData regression or performance problem, anyone?

2014-11-12 Thread Vincent Habchi
Jens,

> If you're using CoreData I'm not sure if you'll be able to fix your database 
> schema, since presumably CoreData manages it and not you. So I'm not sure how 
> you'd work around the problem. Good luck!

In fact, the Macports search engine is not, so I guess we’ll figure out a way 
to fix this correctly. But I wanted also to warn every possible user of Core 
Data that they might experience regression without any evident reason.

Cheers!
Vincent


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Print Preview with different page size

2014-11-12 Thread Leonardo
I can't succeed at printing/previewing a document containing several pages,
each one with different page size.

On the print panel, the preview page is the always fixed to the first page
size I set in the method printOperationWithSettings, using setPaperSize

NSPrintOperation *printOperation = [NSPrintOperation
printOperationWithView:mPrintView printInfo:[self printInfo]];

NSPrintInfo* printInfo = [printOperation printInfo];
[[printInfo dictionary] addEntriesFromDictionary:printSettings];
[printInfo setPaperSize:[self PrintViewFrame:1].size];


I have double checked, and on the method
- (NSRect)rectForPage:(NSInteger)pageNumber
of the printView I properly return the right rect for each page, but I can't
yet get the right pageSize when previewing nor printing the document.
Any solution?



Regards
-- Leonardo


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: CoreData regression or performance problem, anyone?

2014-11-12 Thread Jens Alfke

> On Nov 12, 2014, at 6:51 AM, Vincent Habchi  wrote:
> 
> the sqlite version installed on OS X machines has been bumped to 3.8.x in OS 
> X 10.10. This apparently had the unfortunate side (or collateral) effect of 
> plummeting performance of some requests (specifically, some Macports related 
> database operations now take forever while they were fairly quick on 10.9).

Yes, I ran into this in September and tracked down the problem. Yosemite is 
using SQLite 3.8.5. This includes the new query planner[1] that was added in 
3.8. Which is great, but comes with a caveat:

>> The [Next Generation Query Planner] is almost always better than the legacy 
>> query planner. However, there may exist legacy applications that unknowingly 
>> depend on undefined and/or suboptimal behavior in the legacy query planner, 
>> and upgrading to the NGQP on those legacy applications could cause 
>> performance regressions.

They have a checklist[2] of how to troubleshoot performance problems. One of 
the causes is indexes whose primary keys have lots of repeated values, so they 
have to be linearly scanned — in my case I had an index whose primary key was a 
boolean value. Ouch. Improving the index fixed the problem.

If you're using CoreData I'm not sure if you'll be able to fix your database 
schema, since presumably CoreData manages it and not you. So I'm not sure how 
you'd work around the problem. Good luck!

—Jens

[1] https://www.sqlite.org/queryplanner-ng.html
[2] https://www.sqlite.org/queryplanner-ng.html#howtofix

smime.p7s
Description: S/MIME cryptographic signature
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

CoreData regression or performance problem, anyone?

2014-11-12 Thread Vincent Habchi
Folks,

the sqlite version installed on OS X machines has been bumped to 3.8.x in OS X 
10.10. This apparently had the unfortunate side (or collateral) effect of 
plummeting performance of some requests (specifically, some Macports related 
database operations now take forever while they were fairly quick on 10.9).

I was just wondering if some of you, in their applications using SQLite/Core 
Data, had noticed such a severe loss of performance.

Thanks,
Vincent


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: updating NSTextField before spinner animates

2014-11-12 Thread sqwarqDev
> On 11 Nov 2014, at 23:01, Fritz Anderson  wrote:

> -needsDisplay schedules a view’s -drawRect: for the next pass through the 
> runloop. You’re putting your process to sleep at the OS level, so the runloop 
> is suspended along with everything else.
> 
> What you posted is evidently a minimal case, and maybe, instead of sleep(), 
> your lengthy method is called instead. Same principle: Unless that method 
> runs asynchronously (or simulates asynchrony by doing its work piecewise on 
> an NSTimer, or by periodically sending -runMode:beforeDate: to the runloop), 
> the runloop never has the chance to dispatch view updates.


Thanks for this Fritz. I think I get it. I need to get a clearer idea of how 
the run loop works. This isn't the first time I've been confused about why a 
line doesn't appear to return the result I expect before the next line 
executes. I suppose this is part of the difference between using traditonal 
procedural languages and these /new-fangled/ object-oriented ones... :~)

I guess I've got some reading up to do! Thanks again.



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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