Handling dragging files from Finder into a limited-index NSTableView [closed] - cocoa

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
I have an existing NSTableView set up to accept filename dragging from finder. I need to limit the TableView to 10 entries max.
If a user drags in more files than the available slots, should I accept the drop and skim off any excess files, or should I reject the drop?

I'd say, fill the remaining slots but reject the drop. Return YES from -validateDrop:... but NO from -acceptDrop:....
That way, there will be some indication to the user that not all entries were added, but you'll helpfully add the items which can be added.

Related

How do you remove a label with code in swift [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
i have created a label and i want to remove it in another function. what would be the code for this?
The name of the label variable and then removeFromSuperview()
label.removeFromSuperview()
that will remove it from whatever view it is a part of
Link to the apple docs here

How to handle files and folders structure after dragging from Finder [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need to create a simple app that allow user to drag and drop multiple files and folder into some tree list and then display them to user.
A good example of what I need:
What best component should I use?
I just want to take advice before I start.
Your question is too broad, but I'll point you the right direction:
• For your data model, you'll want to use NSTreeController
• For your view, NSOutlineView.
Here are some examples:
• Apple's SourceView - https://developer.apple.com/library/mac/samplecode/SourceView/Introduction/Intro.html
• http://daemonconstruction.blogspot.in/2012/03/simplest-nstreecontroller-example.html

Is there any alternative short name for controller [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Is there any alternative short name for controller, I feel this very general word is a little long for typing.
I think people sometimes use Ctrl as a short hand for control, but this is often in the context of Controls like buttons and check boxes.
In MFC (and wxWidgets), they tend to call the Controller class the App, e.g. as in GraphicApp.

Balsamiq, how to put a button in a Datagrid [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
How can I put a button in a Data Grid in balsamiq? I'm using Balsamiq Mockups 2.2.9.
I just know that a data grid allows to insert only radio buttons or check boxes. However, you may solve your question in below link,
http://blogs.balsamiq.com/ux/2010/07/15/mockup-tips-datagrids-and-specifying-interaction/
I'm not sure that in recent versions, whether it has any other available methods.

Close programmatically all cell groups in Mathematica? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is it possible to collapse all cell groups in the current notebook? I tried
nb = SelectedNotebook[];
SelectionMove[nb, Before, CellGroup]
FrontEndTokenExecute["OpenCloseGroup"]
but nothing changes.
You could use
nb = SelectedNotebook[];
SelectionMove[nb, All, Notebook];
FrontEndTokenExecute[nb, "OpenCloseGroup"]
although it only works if the notebook starts with a cell group, and not with a lone cell. (The menu item behaves the same way.)
If you know there are cellGroupCount groups, you could also do something like:
nb = SelectedNotebook[];
SelectionMove[nb, Before, Notebook]
Do[SelectionMove[nb, Next, CellGroup];
FrontEndTokenExecute[nb, "OpenCloseGroup"], {cellGroupCount}]

Resources