I am creating a Cocoa Application for Mac OS 10.6 >, and I want to hide the toolbar of an NSWindow automatically when it is not in use for at least 30 seconds.
I think this can be done with NSTimers, but I'm not familiar with them and I don't know how I can implement this.
Another problem is that both the NSToolbarDelegate and NSWindowDelegate protocols don't have delegate methods like toolbarDidShow:
Can anyone point me in the right direction? Thanks.
PS. This is not to punish the user, but rather give the user a cleaner window (the window consist of only a toolbar for color and font and a text-view).
PPS. Can the hide-toolbar-animation lead into a problem with the cursor while the user is typing?
I think this can be done with NSTimers, but I'm not familiar with them and I don't know how I can implement this.
The Timer Programming Guide might help you here. It's easy enough to show and hide the toolbar, use -setVisible:. Also, -isVisible can be used to determine the visibility of the toolbar.
Related
I'm using wxWidgets 2.8 on a Linux box.
I'd like to get notifications of scroll events from wxListCtrl (or wxListView). Basically I want to be notified when someone uses the scrollbars.
I tried with EVT_SCROLLWIN and EVT_SCROLL without success.
Can someone provide me some sample code?
Unfortunately I cannot find any documentation/sample about this topic. Any pointer?
I need to intercept this event because I'm using a wxListView under MOTIF (sic) and when I scroll the list, the new items are not redrawn (basically I see the list empty until I click an item). So, my hack would be to call wxWindow::Redraw() after a scroll.
Any alternative solution to my original problem?
Thanks.
You won't get scroll events for what can be (even if it is not in wxGTK, actually) a native control, this is just not something that wxWidgets guarantees because it is very difficult (and maybe impossible) to implement in general.
Sorry.
I would like to programmatically Add a UIScrollView in a UIAlertView.
I found a way to do that but I was not successful in adding text to this UIScrollView (using the same code as in here: https://www.youtube.com/watch?v=4SG0CAAl5u0).
is there an alternative to do that? the text I have is very long and I need people to be able to scroll but without being able to edit it.
I know that the Apple user interface guideline does not recommend long text in alerts (although detecting WiFi networks does that) but I have no choice but doing it
If you add a large text in UIAlertView it automatically becomes scrollable.
You don't have to do any thing to make it scrollable.
Here is a control on github that has a tabelView inside it. If you need to customize beyond what Inder suggests, you might want to look at the code and replace the tableView with a scrollView.
Also, there are other controls at cocoacontrols.com that might help you directly or give you some ideas.
I would like to implement a dialog in my App that behaves like the New-File-Dialog in Xcode. Here is an image.
It must
docks to the toolbar
allow me to set a custom view
Is it possible to place NSTextFields in there and return/access their values, when the user klicks the ok button?
I know that the e.g. NSSavePanel behaves similar but I don't find anything for raping it like at. You can set just a view for distributing a save-action.
Best regards
You can implement this using sheets. You should refer Sheet Programming Topics.
My application is such that it does not require the tool-bar. It is very simple in nature and is controlled 100% by keyboard actions (one at a time, even). So while I know it's generally accepted that you should leave the toolbar in place, this time I feel that it actually hampers the UX of the program. So, I was wondering if it's possible to actually remove the tool-bar from my program?
It's easy to remove the traffic lights [ o o o ] from the bar, and there's no Title, but the space is still there, and the application simple looks 'off' with the extra space.
Any pointers are much appreciated, as I've looked around with the following queries:
How to remove the toolbar in an OSX application in XCode / Objective-C.
How do I remove the toolbar in an OSX application in XCode / Objective-C?
and a few others without much success.
You say toolbar, but I think you mean the window's title bar. This previous answer should work for you. The top answer is the way to do it, and the second answer is an argument against doing it.
Hide NSWindow Title Bar
If you want to keep title bar, but just want to customize it (including close, minimize and maximize buttons), you can use INAppStoreWindow component.
I want to create an NSWindow (or something else) that can appear above the mac menubar. I know this is possible because TeamViewer does it with their "mouse" image.
Example: http://i.stack.imgur.com/6iZbG.png
How do they do it? (or, how can I do it?)
You want to check out window levels, as alluded to in moritz' comment. Any level above NSMainMenuWindowLevel should appear above the menu bar.
If you really want to be above everything else, you can use a shielding window level (not technically part of the regular NSWindow window level). Shielding windows are intended for full screen apps which take over the screen, but you can use a regular window which does this. I have a magnifying glass type app that uses this to good affect.
[myWindow setWindowLevel:CGShieldingWindowLevel()];
Also as alluded to moritz' comment, doing this is generally a bad idea, so make sure you've a good reason for doing so.