Printing as sheet

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
tellboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Wed Mar 06, 2013 1:31 pm

Printing as sheet

Post by tellboy » Sun Apr 07, 2013 10:04 am

When I use the following script it takes an age (seconds) for the dialogue boxes to appear:

Code: Select all

   answer page setup as sheet
   
   open printing with dialog as sheet
   
   if the result is "Cancel" then exit mouseUp
   
   print cd "barChart" from 0,0 to tRight,tBottom + 150

   close printing 
When I use the script but without the as sheet option the dialogue boxes appear almost instantly.

Am I doing something wrong or is LiveCode inefficient when calling the "as sheet" routines which are probably Cocoa based rather than the without "as sheet" which are probably Carbon based?

All the best

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Printing as sheet

Post by Dixie » Sun Apr 07, 2013 12:31 pm

hi...

Code: Select all

on mouseUp
   answer page setup as sheet
   put the result
   wait 0 millisecs with messages
   open printing with dialog as sheet
   
   if the result is "cancel" then exit mouseUp
   
   wait 0 millisecs with messages
end mouseUp
This seems to run fluidly on my Mac... using the wait to give the engine time to catch its breath..

Dixie

tellboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Wed Mar 06, 2013 1:31 pm

Re: Printing as sheet

Post by tellboy » Sun Apr 07, 2013 2:23 pm

Dixie wrote:using the wait to give the engine time to catch its breath..
Thanks for the reply, I have amended my script to :

Code: Select all

  answer page setup as sheet
   wait 0 millisecs with messages
   open printing with dialog as sheet
   if the result is "Cancel" then exit mouseUp
   wait 0 millisecs with messages
   print cd "barChart" from 0,0 to tRight,tBottom + 150
   close printing
The results are:

Page Setup shows immediately
Click OK
9 Seconds until Print Dialog Shows
Select Open PDF in Preview to save paper
8 Seconds until preview of cd opens

If I do the above without the "as sheet" it all happens instantly.

Any other ideas I could try?

Thanks

Terry

tellboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Wed Mar 06, 2013 1:31 pm

Re: Printing as sheet

Post by tellboy » Fri Mar 07, 2014 1:09 pm

A little development with this issue

Code: Select all

on printChart
  answer page setup as sheet
  answer printer as sheet
  put  the printPaperRectangle into tPrintRect
  print card from topLeft of me to bottomRight of me into tPrintRect
end printChart

I reported after the page setup dialog box comes up and the OK button was clicked there was a long wait, up to 9seconds,
before the printer dialog came up.

Normally after clicking the OK button in the page setup dialog I just sit there waiting for the printer dialog box.

I have just noticed that if I move my mouse across the screen after the page setup dialog has gone from the screen
then the printer dialog displays immediately. If I don’t move the mouse I have to wait for 9 seconds.

This is on a Mac running 10.9.2. Don’t know about windows.

Can someone verify this please?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Printing as sheet

Post by Dixie » Fri Mar 07, 2014 1:29 pm

If I don’t move the mouse I have to wait for 9 seconds.
Yes, I am getting the same as you... All is fine as soon as you move the mouse

tellboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Wed Mar 06, 2013 1:31 pm

Re: Printing as sheet

Post by tellboy » Fri Mar 07, 2014 4:36 pm

Dixie wrote:Yes, I am getting the same as you... All is fine as soon as you move the mouse
Do you think this is a bug?

Post Reply

Return to “Mac OS”