Display a Red frame on the screen

2011-04-08 Thread eveningnick eveningnick
Hello
I have two monitors attached to the computer, and when i click in
System Preferences/Displays Preferences on the display image
(Display arrangement tab), the screen of the clicked scematic
monitor's image monitor is being surrounded by a red frame.

How could i do something like this from my application? I don't need
the red frame around the whole screen, but i would like to have some
area on the screen. Is it possible to do using some kind of API?
Thanks!
___

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 arch...@mail-archive.com


Re: Display a Red frame on the screen

2011-04-08 Thread David Duncan
On Apr 8, 2011, at 3:39 AM, eveningnick eveningnick wrote:

 Hello
 I have two monitors attached to the computer, and when i click in
 System Preferences/Displays Preferences on the display image
 (Display arrangement tab), the screen of the clicked scematic
 monitor's image monitor is being surrounded by a red frame.
 
 How could i do something like this from my application? I don't need
 the red frame around the whole screen, but i would like to have some
 area on the screen. Is it possible to do using some kind of API?


You can use NSScreen to get a list of available screens and then just create an 
NSWindow on whatever screens you want. You probably want a borderless window 
(which is a flag you can pass when you create the window) so that the window 
doesn't have content by default.
--
David Duncan

___

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 arch...@mail-archive.com


Re: Display a Red frame on the screen

2011-04-08 Thread eveningnick eveningnick
Hi David,
thanks for the answer

I was thinking about the window. But then it has to be something with
a big hole inside. This hole ought to be transparent for mouse clicks
(so if there's something below my window, that 'something' has to be
clickable and focused, and receive keyboard input)? Is it possible to
do somehow? Borderless is a window without a title (as i understand).
What kind of properties should i specify to make a window as that Red
frame? I mean, i really want it to be just a mark for the user,
without any windowing behaviour (well, the user can drag it, if he
clicks on the 'red frame' with mouse, but that is the only relation to
a real window it should have).

In OS Windows i would probably use Regions API, but i have no idea
what to do in Mac OS. Could you give me a clue?
thanks

2011/4/8 David Duncan david.dun...@apple.com:
 You can use NSScreen to get a list of available screens and then just create 
 an NSWindow on whatever screens you want. You probably want a borderless 
 window (which is a flag you can pass when you create the window) so that the 
 window doesn't have content by default.
 --
 David Duncan


___

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 arch...@mail-archive.com


Re: Display a Red frame on the screen

2011-04-08 Thread Andreas Mayer

Am 08.04.2011 um 19:24 schrieb eveningnick eveningnick:

 I was thinking about the window. But then it has to be something with
 a big hole inside. This hole ought to be transparent for mouse clicks
 (so if there's something below my window, that 'something' has to be
 clickable and focused, and receive keyboard input)? Is it possible to
 do somehow? Borderless is a window without a title (as i understand).
 What kind of properties should i specify to make a window as that Red
 frame? I mean, i really want it to be just a mark for the user,
 without any windowing behaviour (well, the user can drag it, if he
 clicks on the 'red frame' with mouse, but that is the only relation to
 a real window it should have).

See this little project. It uses a (borderless) window to place a 'puff* 
graphic under the mouse cursor.

http://www.harmless.de/cocoa-code.php#floatingimage


Andreas___

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 arch...@mail-archive.com


Re: Display a Red frame on the screen

2011-04-08 Thread Peter Lübke


Am 08.04.2011 um 19:24 schrieb eveningnick eveningnick:


I was thinking about the window. But then it has to be something with
a big hole inside. This hole ought to be transparent for mouse clicks
(so if there's something below my window, that 'something' has to be
clickable and focused, and receive keyboard input)? Is it possible to
do somehow? Borderless is a window without a title (as i understand).
What kind of properties should i specify to make a window as that Red
frame? I mean, i really want it to be just a mark for the user,
without any windowing behaviour (well, the user can drag it, if he
clicks on the 'red frame' with mouse, but that is the only relation to
a real window it should have).

In OS Windows i would probably use Regions API, but i have no idea
what to do in Mac OS. Could you give me a clue?


Invoke  -setIgnoresMouseEvents: on the borderless window.

Cheers,

Peter

___

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 arch...@mail-archive.com


Re: Display a Red frame on the screen

2011-04-08 Thread eveningnick eveningnick
thanks andreas, i'll look at that
___

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 arch...@mail-archive.com