Cocoa combo box like Safari - cocoa

Using Cocoa, I'd like to create a "combo box" as seen in Safari - think "select your state" where you click it, it drops down and has every option listed, and you choose them. This differs from the standard NSComboBox because it doesn't have a blank line in it. And it's also not so totally ugly..

Like an NSPopUpButton?

Related

Atom IDE Tab Groups

I was a macbook user in my previous job. I used Atom IDE as a text editor there because I liked how it handled projects in the LHS tree view, and because I liked the tabs. In particular, I liked that in MacOSX, tabs could be grouped, so that clicking one group got one set of tabs, while hiding the other set of tabs. This allowed me to have more tabs open (without tab name being too small to read), while at the same time being more organized.
My question is: is there a way to get the "tab group" feature when using Atom IDE in Windows 10? My first guess is no, since the tab group was probably an OS feature, but I could be wrong.
NOTE: This is not in reference to a "pane", as that feature doesn't hide tabs, as I was hoping for in tab groups.
One Answer: I found this ATOM ide package that makes the tab row into multiple rows. However, instead of hiding one row and showing the other row, it shows both rows at the same time, stacked. It works for now, but a full-fledged plugin for this would be nice.
https://atom.io/packages/multirow-tabs

How to more easily "update all frames" in autolayout in Xcode7?

The "Update Frames" calls are often grayed-out in Xcode
the only way I know to have it update frames to match your constraints, is, tediously select your highest-level view and than (sometimes) you can fish in the menu bar for "Selected Views"->"Update Frames". Further, "All Views"->"Update Frames" would appear to often simply not work or work in a way I can't understand.
Surely there's just a keystroke or button which updates all frames straight away to match any newly-entered constraints (such as those made using control-drag).
Note .. for 2016 you can use this very handy button, which at least brings up the same sub-menu as you can find by searching in the menu bar menu.
However it would seem (see my comments w/ ZaBlanc below) that there is perhaps actually an Xcode bug, and you CAN NOT assign a keystroke to the "All Views" items. (The ones you usually use.)
Even worse .. in Xcode 8 ...
they seem to have removed the 'update frames' option ... WTH
It's easy. Go to Preferences -> Key Bindings. Type "Update Frames" on the top. You'll see two appear. You'll want the bottom one (it will be the one without a keyboard shortcut assigned.)
Assign it to ⌘= or anything else you like.
Life changed.
Just for anyone reading, with Xcode 8.3. The popup menu command no longer exists. The menu bar command Editor -> Update Frames does work. However there's a bug, the default key binding on that does not work. If you add a custom key combo, that custom key combo does work.
AFAIK, there is no keystroke for update all frames, but here's a key tip:
If you have a misplaced views, press the yellow arrow in the document outline (the views tree to the left of canvas), press yellow triangle on any view in the list, then select update frames and check Apply to all views in container - this will update all misplaced views in the selected view controller
Additionally, you probably already know:
You can add a new constraint with Add New Constraints button in canvas bottom right and select "Update frames" option.
You can select any view by mouse-click and holding Option+Shift keys - this will show you the list of all the views, that intersects with mouse pointer. After that you can select update frames menu item on a selected misplaced view.
The same as you, I thought that it's very annoying to fix the misplaced views manually by selecting them and choose that boring option from Xcode menu. After trying hard to shorten the time to fix the layout issues, I had to admit that there is no way to call the function "Update Frames" from command line. So I ended up doing this way:
Open Xcode warnings & error inspector window
Filter all layout warnings by using the keyword "frame for"
Click on warnings to quickly locate to the misplaced views then press Command + Option + =
That's the fastest way I know. Please try it out!
You could also find more details HERE

Xcode- Make Textview continue horizontally forever

I am trying to make a basic text editor (For a School Project if you are wondering) and I want to make it work with different code. The problem is that I cant get TextView to go on forever horizontally. Similar to Notepad++. I have set it to have the ability scroll horizontally, but I cannot seem to make the text keep going on one line. This is for a Mac OS X application and I am using Xcode 5. Also, on a side note, if you by chance know how to number the rows, I would greatly appreciate that as well. Thank you!
Menu option: Xcode->Preferences
From there go to the "Text Editing" tab and check the box for "Line numbers" then in the Indentation subtab uncheck the box for "line wrapping"
To disable word wrap on an NSTextView see this SO answer

Is there a programmer's text editor for OS X with narrowing?

I think the title is essentially self-explanatory except for a necessary clarification and caveat:
Clarification
I'm not entirely sure if 'narrowing' is the universal term for the feature I'm referring to. What I mean is something like Emacs' 'narrow buffer', ie. the ability to select a region and quickly narrow the editor window to show only that region, and then after some edits to be able to quickly zoom out to see/edit the full file again. It's a feature I like, and find far more useful than code folding.
Caveat
Of course the answer is 'yes -- (X)Emacs' (and possibly vim?). But I'm looking for something other than vim or Emacs; almost certainly a more GUIsh one (think Textmate, TextWrangler etc).
My researches seem to suggest that the straightest answer is just 'no'. I haven't been able to find an editor that runs on OS X that supports narrowing, other than emacs.
I have however figured out a workaround that might be of interest for some scenarios, which is to use Hog Bay Software's QuickCursor in conjunction with one or more editors.
For example, I've tried setting up QuickCursor to fire up TextMate. So now when working in XCode, I can select the text I want to narrow to, hit the global hotkey I have set up, and the selected text pops up in a TextMate window. That can be edited, then a save and dismiss window pops the edited text back in XCode.
This also works if you're just working in TextMate (or, I imagine, one of the other editors that QuickCursor can control); ie. you can select select test in the editor, trigger QuickCursor to open the selected text in a new window, and later pop that text back to the original window.
I'm guessing this is not what you want, but you didn't specifically say so: Aquamacs? It's an emacsen with good integration with OS X (cut, paste, menus, toolbars, etc).

GtkNotebook add-tab button

Is it possible in Gtk+ to have an add-tab button inline with the tabs in a notebook, ala Opera or Google Chrome? I do know that Opera uses Qt and Chrome uses custom tabs, but is it possible in pure Gtk+?
Well, if it is not possible, there is a simple workaround:
Create a tab with the title "New Tab" or "+" or whatever
Detect when the tab is selected and, when such happens, create a new tab. Focus on that new tab so that the "New tab" tab isn't ever selected.
Sure. Check out the class BrandedNotebook at line 1384 of this file.
Unfortunately Gtk+ doesn't give you a "nice" way to do this, but you should be able to determine the amount of space available, and use it as you wish. In the case of BrandedNotebook, a pixbuf is drawn in the space, and mouse clicks are handled within the coordinates of the pixbuf.

Resources