Cursor problems, MAC and PC [message #30698] |
Thu, 09 May 2002 08:03  |
Ted Cary
Messages: 53 Registered: October 2001
|
Member |
|
|
I have been porting some of my lab's IDL 5.4 Macintosh programs to a Windows
2000 PC running 5.5. Programs that change the cursor image have been having
problems, both in direct graphics and object graphics.
1.) On the Mac, just setting the cursor without setting a mask appears to
cause the cursor image to be XOR-ed with the window contents, so it is
always visible against the background. On the PC, unmasked custom cursors
disappear against black backgrounds, as described in the online help, but
the standard cursors set with the CURSOR_STANDARD keyword to DEVICE do
exhibit the XOR-like behavior. Can the XOR behavior be achieved with custom
cursors on a Windows machine?
2.) In Windows, calls to DEVICE with the CURSOR_IMAGE keyword cause a new
direct graphics window to pop up if one is not already open. This did not
happen in the Mac programs. Is there a way to turn this off?
3.) In Macintosh object graphics windows, setting the cursor with
IDLgrWindow::SetCurrentCursor causes some problems. While dragging the
mouse across the viewport, the cursor constantly cycles between the object
window cursor and the direct graphics cursor. This was easily solved by
setting the direct graphics cursor to the same thing as the object window
cursor. On Windows this cursor cycling does not occur; instead new direct
graphics windows keep popping up whenever the cursor is changed (see #2).
I can fix these problems in Windows by drawing and setting masks for each
cursor and taking out all the extra calls to DEVICE, but I was hoping for a
less time consuming, cross-platform solution. The Macintosh object
graphics cursor cycling is particularly troublesome, although the workaround
is simple enough. Is this a known bug or a common programming mistake? Has
anyone experienced or solved any of these problems?
Thanks for any help,
Ted Cary
|
|
|
|
|
|
|
|
|
Re: CURSOR problems [message #45209 is a reply to message #30698] |
Mon, 22 August 2005 13:47   |
Ken Mankoff
Messages: 158 Registered: February 2000
|
Senior Member |
|
|
Without running your code, I think I might have already dealt with
this here:
http://groups-beta.google.com/group/comp.lang.idl-pvwave/bro wse_thread/thread/a2c4c8a401d89bba/05b5e8ecdcca33af?q=mankof f+x11&rnum=1#05b5e8ecdcca33af
Solution:
% defaults write com.apple.x11 wm_click_through -bool true
-k.
On Mon, 22 Aug 2005, Kenneth Bowman wrote:
>
> Is anyone else having problems with CURSOR? I have never seen
> this behavior before, and I have no idea if it is an IDL or an OS
> issue. I am running IDL 6.1 on Mac OS X 10.4.2.
>
> If I run this program:
>
> PRO TEST_CURSOR
> PLOT, FINDGEN(5)
> CURSOR, x, y, /DATA
> PRINT, x, y
> END
>
> it opens an X window and draws the graph. I click on the graphics
> window to change keyboard focus. Clicking in the window has no
> effect. I click back to my terminal window and interrupt
> execution with control-C. Moving the mouse back to the graphic
> window produces an event just as the mouse enters the window (see
> below).
>
> IDL> test_cursor
> ^C% Interrupted at: TEST_CURSOR 3
> /Network/Servers/csrp.tamu.edu/Volumes/csrp0/Home/bowman/id
> l/test/test_cursor.pro
> IDL> .c
> -0.34877722 1.8760835
>
> This behavior renders CURSOR completely non-functional.
>
> Thanks, Ken Bowman
>
|
|
|
|
Re: CURSOR problems [message #45217 is a reply to message #30698] |
Mon, 22 August 2005 10:00   |
Timm Weitkamp
Messages: 66 Registered: August 2002
|
Member |
|
|
R.G. Stockwell wrote:
> "Kenneth Bowman" <k-bowman@null.tamu.edu> wrote in message
> news:k-bowman-4F8C65.10384122082005@news.tamu.edu...
>> Is anyone else having problems with CURSOR? I have never seen this
>> behavior
>> before, and I have no idea if it is an IDL or an OS issue. I am running
>> IDL 6.1
>> on Mac OS X 10.4.2.
>>
>> If I run this program:
>>
>> PRO TEST_CURSOR
>> PLOT, FINDGEN(5)
>> CURSOR, x, y, /DATA
>> PRINT, x, y
>> END
> ...
>> Thanks, Ken Bowman
>
> Works fine here
> IDL Version 6.1.1, Microsoft Windows (Win32 x86 m32). (c) 2004, Research
> Systems, Inc.
Works all right here as well.
{ x86 linux unix linux 6.1 Jul 14 2004 32 64}
Timm Weitkamp
ESRF, Grenoble, France
|
|
|
Re: CURSOR problems [message #45218 is a reply to message #30698] |
Mon, 22 August 2005 09:58   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth Bowman writes:
> Is anyone else having problems with CURSOR? I have never seen this behavior
> before, and I have no idea if it is an IDL or an OS issue. I am running IDL 6.1
> on Mac OS X 10.4.2.
>
> If I run this program:
>
> PRO TEST_CURSOR
> PLOT, FINDGEN(5)
> CURSOR, x, y, /DATA
> PRINT, x, y
> END
>
> it opens an X window and draws the graph. I click on the graphics window to
> change keyboard focus. Clicking in the window has no effect. I click back to
> my terminal window and interrupt execution with control-C. Moving the mouse
> back to the graphic window produces an event just as the mouse enters the window
> (see below).
>
> IDL> test_cursor
> ^C% Interrupted at: TEST_CURSOR 3
> /Network/Servers/csrp.tamu.edu/Volumes/csrp0/Home/bowman/id
> l/test/test_cursor.pro
> IDL> .c
> -0.34877722 1.8760835
>
> This behavior renders CURSOR completely non-functional.
What happens if you set the DOWN keyword on the CURSOR
command? Does that change things at all?
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: CURSOR problems [message #45219 is a reply to message #30698] |
Mon, 22 August 2005 09:30   |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
"Kenneth Bowman" <k-bowman@null.tamu.edu> wrote in message
news:k-bowman-4F8C65.10384122082005@news.tamu.edu...
> Is anyone else having problems with CURSOR? I have never seen this
> behavior
> before, and I have no idea if it is an IDL or an OS issue. I am running
> IDL 6.1
> on Mac OS X 10.4.2.
>
> If I run this program:
>
> PRO TEST_CURSOR
> PLOT, FINDGEN(5)
> CURSOR, x, y, /DATA
> PRINT, x, y
> END
...
> Thanks, Ken Bowman
Works fine here
IDL Version 6.1.1, Microsoft Windows (Win32 x86 m32). (c) 2004, Research
Systems, Inc.
Cheers,
bob
|
|
|
Re: CURSOR problems [message #45295 is a reply to message #45199] |
Tue, 23 August 2005 07:09  |
K. Bowman
Messages: 330 Registered: May 2000
|
Senior Member |
|
|
In article <Pine.OSX.4.61.0508222000470.5937@gouda.local>,
Ken Mankoff <mankoff@gmail.com> wrote:
> On Mon, 22 Aug 2005, Kenneth Bowman wrote:
>>
>> I did search through the group before posting, but didn't have the
>> right keywords. :-(
>
> Funny, because you took part in that thread in both of its
> life-spans. Ahh. Information overload. Where to store it all?
>
> -k.
I know. I remembered that there was a thread about problems with X11 on OS X,
but couldn't recall the specifics. I certainly couldn't remember that I had
actually posted anything! ;-)
Ken
|
|
|
Re: CURSOR problems [message #45296 is a reply to message #45201] |
Tue, 23 August 2005 05:39  |
Patrick Broos
Messages: 27 Registered: December 1996
|
Junior Member |
|
|
I don't have any ideas on your xterm configuration, but as a Solaris
user just moving to OS-X I do have a suggestion about xterms: leave
them behind! As long as $DISPLAY is set correctly you can start X11
programs from a shell running in any terminal application.
Terminal.app (from Apple) is better than xterm, and iTerm is even
better than Terminal.app. You'll be able to use much better fonts than
I could ever get in xterm (on OS-X), multiple ("tabbed") shells, full
integration with other OS-X applications (e.g. drag a file from Finder
and the file's path is printed in the shell), standard OS-X keyboard
shortcuts, configurable menus (e.g. to ssh to favorite other machines),
middle mouse paste, focus-follows-mouse, etc. Here's some code I found
to put in .cshrc to set $DISPLAY in all shells:
# Set DISPLAY so that Carbon terminals can run X
applications.
# This only works if an X server is running; it's a
good idea to start
# an X server at login via System
Preferences->Accounts->Login Items.
# Figure the correct value for DISPLAY from the lock
files /tmp/.X?-lock
if ($?DISPLAY == 0) then
foreach x (0 1 2 3 4 5 6 7 8 9 )
if ( -o /tmp/.X$x-lock ) then
setenv DISPLAY :${x}.0
break
endif
end
endif
I choose to start the X11 server automatically at login.
Patrick Broos
|
|
|
|