Building an application with "drawer" in Linux/Mac/Windows - 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.

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

XCode or make - what should I use?

I started my career on Linux/Unix, and moved over to Windows and Visual Studio. XCode feels pretty alien to me. My feeling is that I'm not in control with XCode. It could be the case that I simply haven't understood how to use the IDE, I am new at developing for Apple OSs. One thing that kind of irks me, is that nobody seem to have found a clean way to compile for multiple platforms (iOS and Mac OS X), using the same sources. I've found two ways to "hack it", but the hacks sound fragile.
I've been pondering the idea of using simple make files instead of XCode (except for the occasional use of Interface Builder).
Is this a sane route to go? Has anyone done this? Are there any major drawbacks I need to be aware of before I take the leap, or should I just bite the bullet and wait for the enlightenment?
Use Xcode, use as many high-level tools as possible. The "loss of control" is replaced by more focus on the application, which IMHO is a great tradeoff.
It is kind of like the loss of control when I went from assembly code to "C", but it was worth it. We keep moving to higher level of abstraction and that allows us to accomplish more, focus on the big picture instead of the minor details.
You've just got to learn new ways of doing things. For example, in the situation you describe (building an OS X and iOS app with shared code), I'd put any shared code into a library/framework that is used by both projects, and create a workspace that contains all three projects.
The loss of control you speak of is offset by the fact that this can all be set up without knowing anything about compiler command-line options in around 10 minutes.
It's a different way of thinking, and it can be frustrating if you know how you would do it on a different platform, but there are advantages to both options. You may never have to think about the build process again!

Vi keys in Xcode

I'm surprised no one has asked this yet. What's the best way (if any) to get a Vi experience in Xcode? I know about ViMate but TextMate doesn't come close to Xcode in terms of integration and code completion.
BTW, I am using Xcode 4.
You might want to try out xVim which seems to be an active project. The currently indicate that it works with XCode 4.2, Espresso and Chocolat. Presumably you could selectively enable it with other applications.
Here's another plugin which I made a few weeks ago.
http://programming.jugglershu.net/softwares/xvim.html
This is currently developed for personal (my) use. So you may feel bad with some lack of implementation. Give me a feed back(feature request) then. I'll add some keybinds if I have enough time.
The closest you'll get is http://www.corsofamily.net/jcorso/vi/, or configuring an external editor. This has been a long-standing deficiency with XCode. (If you ask any vi user that is..)
OSX and XCode in general favors Emacs key bindings.
More info on general key-binding strategy for OSX: http://hints.macworld.com/article.php?story=20060317045211408
Right now, I productively use XVim†. I'll probably try $20 ViCiOUS, which seems more polished; I like having source access to my tool-chain, but this is for Xcode, so c'mon me.
† Not xVim, which I just discovered, but apparently face down in the pool. In the [Xx][Vv]im namespace, Xvim (à la Xcode) would have made more sense to me. There, I said it.
Here's another choice: KeyRemap4MacBook.

Mac/Cocoa: Embed a terminal window in my app

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.

mac look n feel on other platforms?

I'm just curious whether there is a gui framework that alloys you to use a mac look n feel on other platforms. presumably frameworks that use native APIs wouldn't be helpful (eg wxwidgets).
qt uses native API partially for mac look n feel, so that isn't useful.
what about swing?
In general, don't do this. Different platforms have different conventions, and your software should follow its platform's conventions to minimize the cognitive load of the user.
Unless, I guess, you're the only person who you ever expect to use it.
Legally, you can't create the Mac look and feel on another platform. Apple owns the copyrights to it.
However, the Quaqua Java Look-and-feel implements Java widgets that have that look-and-feel. If you have a good reason to use it in a non-commercial way, it may be a solution.
Every operating system and desktop manager has a different way of implementing GUI elements. Trying to port an application that will look exactly the same as OSX onto these platforms will be difficult if you're looking to use the native controls. Secondly, like Gred stated, each one will have their own way of doing things and could cause user issues by having unusal icons, symbols and controls displayed or missing.
Though if you would like to attempt this, one of the multi-platform web browsers such as FireFox might be able to give you some idea of how to carry over the same general look and feel over the platforms.
Good luck, and hope this helps some.
To answer the last question, Swing does not ship with the Mac look and feel on platforms that aren't Mac-based. This also applied to the other platform-specific look and feel elements.
While not the greatest solution, for Java, the Nimbus L&F is a good alternative... but since it's now included in Java (as of 6u10), it's not available separately any more.
You can implement your own style in Qt [and probably GTK*] to attempt to look the same (see QStyle). However it probably isn't worth the time and effort and will piss off some users. There are some windows themes that attempt to mimic the look. I know the new version of parallels ships with something like that, but it looks rather funny as the margins, spacing, font, etc is completely wrong.

Resources