I was playing with a little software idea last night and ran into
difficulty.
Actually, I could start an email with that sentence almost every day.
I wanted a little image-processing tool and felt that Photoshop was
massive overkill (also, I donât have it anymore, and itâs expensive).
So I thought: It might be fun to write a little semi-interactive program
with an old-fashioned interface.
This is Mac OS X, fwiw.
The basic logic flow was:
Read an image file
Loop:
Read a command via gets
Parse and execute the command
Display the resulting image
Which works âmostly okâ â but when I do img.display and it
opens a new window⌠the new window (naturally?) has the
focus â I would say âstealsâ the focus from iTerm.
Thinking about this, I suppose it relates more to the window
manager (and maybe ImageMagick and the OS) than to RubyâŚ
Having said that, I wonder if there is a solution to this, other than
constantly re-clicking in my original terminal window?
I was playing with a little software idea last night and ran into difficulty.
Actually, I could start an email with that sentence almost every day.
â
I firmly believe one should strive daily for this sort of perfection.
Read an image file
manager (and maybe ImageMagick and the OS) than to RubyâŚ
This is indeed a property of OS/X (or any other similar display manager,
such as Windows, X, etc)
Having said that, I wonder if there is a solution to this, other than
constantly re-clicking in my original terminal window?
I havenât written any native applications in ruby, but I imagine that
after you call img.display from your program, you can steal back the
focus in your REPL just before you read a command, but again, Iâm not
sure how youâd do this specifically. Youâd probably need to send some
message to raise the iTerm window. I know you could do something in
AppleScript to do this, but again, not sure what, specifically.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.