Mac/Cocoa: Embed a terminal window in my app - cocoa

Anyone found out if it's possible to "embed" an instance of Terminal into an app? It would be awesome if it also just inherited the tab functionality and drag-drop-ness as well. I saw a couple similar questions on here that mentioned iTerm but it seems like there should be an easier way. Like a NSTerminal object I can pop into a view.
I asked the Panic guys about this. They have a terminal window in Coda that for all intents and purposes looks/functions exactly like Terminal.app running standalone on the desktop. However, their response was that they had to write that themselves from scratch. I'm hoping someone has figured out a better way!
Thanks!

You can do this with the Pathfinder SDK from Cocoatech.

No such thing AFAIK. I don't think embedding a full-featured terminal into an unrelated app is a common enough need that anybody would have made a control like that — even Panic only use it in the one app.

Related

How to clear console in Windows

I want to clear the console
I tried using this, but it doesn't work for Windows
print!("\x1B[2J");
Is there an easy way to clear the console?
I think I need some clarification first, on what you're attempting to do. Regardless, this is my best attempt at answering your question <3
Preamble
Given that different terminals work differently and have different APIs, I think you probably will want to use a crate that provides this functionality in a cross-plaform manner.
I'm assuming from here on that you want cross-platform functionality and that you don't mind using external dependencies. If this is correct, you might be happy to know that the terminal interaction crates are actually really developed in the Rust ecosystem. I have heard only good things about them.
With that out of the way, let's move on.
Do you want to just perform actions on the terminal?
If you just want to perform some actions on the terminal, like "clearing", "scrolling", "moving the cursor" and whatnot, I think you will be satisfied with the terminal crate. It allows to perform many actions, like clearing, independently of the platform you're in. It also allows for using interactivity features like interacting with the Mouse and the Keyboard :3
Or do you want to write a GUI for the terminal?
If what you want to do is write a Console-based User Interface though, I think that what might work for you instead is the tui crate. It has all of what you need to build terminal GUIs, from clearing of the console up to graphical widgets. Tools like gitui are written with tui.
Did I answer your question? Feel free to follow up if I fell short :)
I've found a way to clear the console in rust
By using console crate, console.clear() method

Unity ScreenToWorldPoint behaving differently on Mac (compared to PC)?

I have written some tools to be used in Unity for level editing in my project. But when opening the project on a Mac, there is one thing that seems to behave differently. Getting the coordinates within the scene seem to work in the same fashion, but when I call
camera.ScreenToWorldPoint(posInScene)
on Windows the correct position is returned but on the mac it returns something entirely different. Any ideas, what could be the reason for this? Or how I could fix this? The code is run in OnSceneGUI. Of course if things need to be written differently for a mac, then I'll just make the code compile platform dependently. Understanding the the reason for the difference would of course also be nice.
A possibly related thing I've noticed is that camera.rect is always camera.rect(x:0.00, y:0.00, width:1.00, height:1.00) on PC, but for some weird reason on a mac for "Layout" events it's (x:0.00, y:-0.99, width:2.00, height:2.00). Could someone explain that? :o
I don't know what is the root cause of this issue, but the workaround is to use HandleUtility.GUIPointToWorldRay instead of camera.ScreenToWorldPoint.

Screenshot of Hidden Window

I need to take a screenshot of a currently hidden window without giving focus to that window. I saw a post on this, here: Window screenshot using WinAPI
I've never used this method, so any advice is greatly appreciated.
I would like to be able to do this either in Windows or OS X, is it possible to do in OS X? It doesn't necessarily need to be in the same language or be cross platform, but of course, that's a plus :).
I would investigate the possibility of asking the window to draw itself into a bitmap, rather than trying to take its picture with a screenshot. That might be a way of making it irrelevant that the window is minimized. Something like the WM_PRINT or WM_PRINTCLIENT message. I suspect that's actually what the person was trying to do who asked the original question that you linked to. The biggest pitfall is if the window doesn't handle that message appropriately. Not all apps are so well-behaved. Also, I don't think it works for windows that are truly hidden, but I can't tell from your question and the flurry of articles you link to whether or not that's a real concern.
Unfortunately, I also know nothing about programming OS X; I'm just a user on that platform. You might try diving into the Qt sources to see how they're doing it cross-platform, if that's really important to you.
It's hard to imagine that you could have one solution that would work on Windows and OS X. The windowing frameworks are completely different. It would be harder to try to come up with one solution that to write two.
On Windows at least, I'm not convinced you'll have much luck taking a screenshot of a hidden or obscured window. When you search for this on the web, there are a gazillion hits for people asking that very question. None of them appear to have succeeded. If you factor in DWM and Aero glass then I think your chances of success are limited.

Building an application with "drawer" in Linux/Mac/Windows

I'd like to build an application with a "drawer" GUI element, like it is all over the place in Mac OS X.
Is it possible to do so in Linux/Windows? Is it possible to build it crossplatform?
I like OS X drawers, but they are not used nearly as often as they used to be. The only apps that I currently use that makes use of them are OmniWeb and TextMate.
I don't think it's worth trying to recreate that UI feature for Windows or Linux. In addition to being too much work, your users likely will find it jarring.
Generally speaking, a standard sidebar ought to support whatever you might use a drawer for.
I think you'd have to roll your own drawer in Linux/Windows.
You all say that drawer is not in use "anymore", which doesn't really help. In any case, I see it fit on a TextMate perfectly, and noone complains about it :-)
KDE seems to have a drawers-like functionality as seen in KDevelop, and some other applications (Kate, the editor, uses them too), but I have never tried to use them in anything I've written, and so would have no idea how to write them.
I haven't used Osx a lot, but cant just a normal sidebar do the job?
Drawers are no long really used on the Mac. I only know of a few that still use them and most of these are older applications. Most have moved the sidebar into the app in a collapsable split view.

Is QuickSilver dead? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
After having read that QuickSilver was no longer supported by BlackTree and has since gone open source, I noticed more and more people switching to/suggesting other app launchers i.e. Buttler and LaunchBar.
Is QuickSilver still relevant? Has anyone experienced any instability since it's gone open source?
Quicksilver is still alive and well. There are at least a couple of endeavours to keep it going, up to date and restructure and clean up the code base. Check out the code from Google Code.
As for launching apps, not even Spotlight comes close to how fast it is in Quicksilver.
Of course the real joy of Quicksilver is past just launching apps and using triggers, scripts and the many plugins. My workflow goes to a new level with Quicksilver. I'd be lost without it.
Update: Since posting this I switched and use LaunchBar for a while. This was during the time that QuickSilver seemed to be almost close to death. Loved LaunchBar and didn't need to switch back to QuickSilver. Recently though, I have left LaunchBar and have been using Alfred. I would highly recommend it. For me, LaunchBar and Alfred are pretty close. But, aesthetically and operationally, Alfred suits my tastes more than LaunchBar.
It still runs stably for me. I would be miserable without it.
And yeah, I would recommend switching if you only use it for an "app launcher", but launching apps is like white belt Quicksilver. I don't know of any program that lets you simply tell your computer what to do in such a simple way. And even Spotlight won't remember the keys you usually type to identify an object or action.
Ubiquity for Firefox is pretty good, but it's locked inside a browser...
I haven't used OS X in a while, but the impression I get is that Spotlight has largely negated the reason for using a launcher in the first place. Quicksilver has some cool things like direct objects built in, but by and large it was mostly used for launching apps, and Spotlight can now do that just as fast.
I also gave up on QuickSilver for a while when Leopard came out. I tried Spotlight. I gave up on that and returned. QuickSilver is much faster, and it does so much more that I missed.
I have not noticed any instability (Leopard) running B54 (3815) - it looks like the open-source version is B56A3 though.
QuickSilver is awesome when integrated with Parallels/VMWare Fusion to launch Windows apps too. You don't get the deep integration as with the various OSX plugins, but it definitely helps the dual-OS usability.
I love QS and agree that it is so productive that I am willing to put up with its flaws. I usually have to launch it several times before it gets up and running, though. To fix that issue I created a little quicksilver launcher app.
I use quicksilver all day (on latest version of OSX); and no spotlight doesn't negate it... quicksilver is still much faster for launching applications.
After Quicksilver stopped being updated for a while, I migrated to LaunchBar. Quicksilver had some occasional crashes and could be very resource intensive. LaunchBar has largely the same functionality without these problems. It is not free though.
The one thing I do miss was using QS to quickly send attachments via email to people in my address book. Highlighting the file, activate QS, Current Selection tab Mail to.. tab Person's name was just awesome.
After the 10.5.5 update, I find Spotlight to solve 99% of the things I originally used Quicksilver for and the speed is nearly identical now. Spotlight is invaluable for finding information you may not remember where or when you last saw it. Unless a major rewrite of QS causes me to reevaluate it again, I suspect Spotlight will be all I need and use.
There are a couple branches out there that are active, I think I'm currently running B56 and loving it. I have too many scripts, triggers, objects that I rely on daily...I would be lost without it.
It's 201 and it's still running strong!
QuickSilver is still alive, and well.
You can find the hub-website for all activities at http://qsapp.com/
GitHub (used for source code and issues tracking) is at https://github.com/quicksilver/Quicksilver
The latest version, B58 (3841) is quite stable on Snow Leopard (10.6.6).
No. It's back, baby.
I didn't know Quicksilver wasn't being as actively supported.
It does all I need it to do at the moment though.
Just installed LaunchBar but I can't set it to be Option + Space to "launch", I can't deal with it not using that, I'm too use to Spotlight on Command + Space and Ctrl + Space is for VS 2008 :P

Resources