RE: How to know user clicks [print] button in cocoa PDE
RE: How to know user clicks [print] button in cocoa PDE
- Subject: RE: How to know user clicks [print] button in cocoa PDE
- From: "Jeff Chen" <email@hidden>
- Date: Fri, 15 Sep 2006 11:24:01 +0800
Hi,
Your dialog is shown after [Print] button is pressed, isn't it? I have realized similiar function as you, but my dialog is carbon dialog, and it didn't have the problem as you described.
Best Regards
Jeff Chen
-----Original Message-----
From: nishino tetsuya [mailto:email@hidden]
Sent: Friday, September 15, 2006 2:01 AM
To: email@hidden; email@hidden;
email@hidden; email@hidden
Subject: RE: How to know user clicks [print] button in cocoa PDE
Hi,
Thank you for your help.
Unfortunately, this issue still has not be resoleved with the code.
Also, this issue happens to ony the three buttons
in the top left (Close, Minimize & Maximize) on the window (TextEdit and
Safari.)
and OSX 10.3.
I hope that I will find a solution in the future.
Thank you very much,
Tetsu
From: "Jeff Chen" <email@hidden>
To: "nishino tetsuya" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>
Subject: RE: How to know user clicks [print] button in cocoa PDE
Date: Thu, 14 Sep 2006 10:09:15 +0800
Hi,
Now I understand your requirements. I'm afraid there's something unsuitable
with your code to show window and close window.
Following is my sample code:
When the "OK" button is pressed on the window:
SelectWindow(a WindowRef);
ShowWindow(a WindowRef);
RunAppModalLoopForWindow(a WindowRef);
HideWindow(a WindowRef);
When the "OK" button is pressed on the window:
ClearKeyboardFocus(a WindowRef);
QuitAppModalLoopForWindow(a WindowRef);
Would you try following solution?
Best Regards
Jeff Chen
-----Original Message-----
From: nishino tetsuya [mailto:email@hidden]
Sent: Thursday, September 14, 2006 1:58 AM
To: email@hidden; email@hidden;
email@hidden; email@hidden
Subject: RE: How to know user clicks [print] button in cocoa PDE
Hello,
When the "Print" button is pressed, I will show the window with the
follwong codes:
ShowWindow(a WindowRef)
RunAppModalLoopForWindow(a WindowRef)
HideWindow(a WindowRef)
When the "OK" button is pressed on the window, I will close the window
with:
QuitAppModalLoopForWindow(a WindowRef)
Mac OSX 10.4 Developer Release notes states the followings
Implementation Changes: Carbon/Cocoa Window Interaction
Several changes have been made to the Window Manager and Control Manager to
improve behavior when both Carbon and Cocoa windows are present in the same
process:
- automatic release of focus on click from Cocoa windows
I personally think that Apple changed their code to deal with this issue,
but
we have to do it manually on 10.3 when I only switch cocoa to carbon
window.
Thanks,
Tetsu
From: "Jeff Chen" <email@hidden>
To: "nishino tetsuya" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>
Subject: RE: How to know user clicks [print] button in cocoa PDE
Date: Wed, 13 Sep 2006 14:01:14 +0800
Hi
How do you close your cocoa window?
I think your cocoa dialog should be run modally,isn't it? Then when you
close the cocoa dialog, you can't simply use [NSWindow close], you must
quit modal status for the dialog.
Your code should be following:
[NSApp stopModal];
[YourCustomCocoaWindow close];
Best Regards
Jeff Chen
-----Original Message-----
From: printing-bounces+jeff-sdcc.chen=email@hidden
[mailto:printing-bounces+jeff-sdcc.chen=email@hidden
m]On Behalf Of nishino tetsuya
Sent: Tuesday, September 12, 2006 7:46 AM
To: email@hidden; email@hidden; cocoa-dev@lists.
apple.com
Subject: RE: How to know user clicks [print] button in cocoa PDE
Hi,
I don't have idea for your problem, but can I ask you question.
I am having the following problem:
I made PDE in 10.3.8. When you open a document with Safari and click
"Print" button,
the PDE will show a dialog (Cocoa). Then, as soon as you click "OK" button
on the dialog it will be
closed. However, the window for the Safari document no longer has focus
(the three buttons
in the top left (Close, Minimize & Maximize) become grayed-out and
disabled.).
All you can do is to quit Safari comletely from "Safari" menu.
Is there any way to manually change focus from Cocoa window to Carbon
window?
In 10.4, the OS takes care of this.
Thanks,
Tetsu Nishino
From: "Yu, Min" <email@hidden>
To: "email@hidden" <email@hidden>,
"email@hidden" <email@hidden>
Subject: How to know user clicks [print] button in cocoa PDE
Date: Fri, 8 Sep 2006 10:09:13 +0800
Hi All,
I met with a problem when I made PDE with cocoa:
I can't catch the event that user presses [Print] button, in carbon PDE, I
can get the ControlRef of [Print] button and install event handler to it.
However, in cocoa, I can only get the NSButton * pointer of [Print] button,
but I can't install event handler to NSControl in cocoa. I can only use
the event in NSResponder. But NSResponder doesn't provide the event that
handles the clicking of [Print] Button.
Who knows how I can catch the event that user clicks [print] Button in
cocoa? Or who knows how to install event handler to a special NSControl in
cocoa?
Best Regards
Jeff Chen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden