Text Field on a MacOS Cocoa program turns black during certain operations - objective-c

I have a simple Mac program I write in Xcode/Cocoa that works fine on my Mac(Yosemite), but on another Mac(El Capitan) some (all?) Text Field's turn black under some circumstances. I don't know if it is OS Version, or some other color or theme preference the user has on that computer. But looking for ideas what to look for.
a) Busy processing - short burst of read/write from a USB device - sometimes the color wheel shows during this processing. When complete however, the Text Fields go to back to normal foreground and background.
b) App loses focus - click outside my app, like the desktop, where my app loses "focus". When my app does not have focus, the Text Fields are blank. But if I click back into my app, the fields go back to normal foreground and background colors.

Related

How to programmatically add a Dock icon bounce on launch?

I've been using Wineskin for quite a while, and, as of late, I've been attempting to use Winemac.drv (or Mac Driver) from CodeWeavers more than X11. The main difference is that Winemac is fully programmed in Objective-C (including its Window system), while the X11 approach uses X11 dylibs and .nib files for windows.
Since Winemac's still in development, however, it lacks in some OS X functionality*. The feature in mind is bouncing on Dock. What's the problem with the bouncing? Well, it simply just doesn't bounce. More specifically at launch. The code somehow overrides the user's option for "Animating apps on launch", or does something that completely ignores the usual app launching animation.
I've still very little experience in Objective-C, so I might've missed some key documentation from Apple's Mac Documentation Library, but my question is:
Can apps usually override this option, or might this be the case just for Wine? If they can, how?
EDIT: I've stated incorrectly that the Mac Driver missed on functionality, when the reality is, as mentioned by Ken Thomases, that Wine processes start at background, so no icon is shown on the Dock at launch, and that means no animation.
I'm the developer of the Mac driver for Wine.
The issue is that all Wine processes start life as background processes with no presence on the Dock. Many Wine processes remain that way because they never present any windows.
When a Wine process does present a window for the first time, it transforms itself from a background process to a foreground process. At this time, it gains a presence on the Dock and in the Command-Tab application switcher and gets a main menu bar. It just so happens that the Dock does not bounce the icon of an app which transforms from a background process to a foreground process. Basically, the Dock is getting involved well after the process was launched and bouncing is for a process which is launching.
An application can make its Dock icon bounce by calling -[NSApplication requestUserAttention:]. However, this does nothing if the application is already active. Also, the bounce animation has a different quality. It's sharper and more urgent, rather than a relaxed bounce.
Basically, there's no way to achieve what you want for the general case. It may be possible to construct a script-based app bundle that configures the environment and then execs Wine. Since the app is bundled and describes itself in its Info.plist as a normal foreground app, it will get a Dock icon immediately and that icon should bounce. I'm not entirely sure how things will behave from there, in terms of the execed Wine taking over the Dock icon. Even if it works for the initial process, any Wine processes which are launched by the initial process will revert to behaving in the manner you're familiar with. (For example, many games have a patcher/launcher which launches a secondary process for the game itself. You might get the patcher/launcher icon to bounce, but that wouldn't help for the game process's icon.)

Windows 8 metro UI: what is a new place for tray notification icons?

Before windows 8, if application want to non-intrusively inform user that something happens, it displays tray icon, maybe animated. For example, if e-mail application finds a new e-mail, it displays a new tray icon (outlook) or animate it's own icon in tray (all other e-mail clients).
With new Windows 8 Metro UI it's a new screen with tiles that supposed to be a main thing user will use to launch and switch apps. Where is no tray area in this mode, but many other things - charms area, something like status area that displays clock and battery usage etc.
According to Microsoft Metro UI design guides - what is the new place for poor e-mail app notification icon?
I think what you want is a notification. There are three kinds of notifications: a tile update, a badge update on the tile or a "toast" in the upper right corner of the screen (when in another application). The various options for these types of notifications are listed here.
The new place to let someone know your app has updated information is the tile itself.
These are called "Live Tiles" because they're intended to be dynamic, and change as new data becomes available.
http://www.winsupersite.com/article/windows8/windows-8-feature-focus-tiles-143175

Force showing keyboard in metro?

I'd like to be able to force the keyboard to show on screen in my Metro app. My goal is to test out different layouts/controls and get a feel for the interaction. My problem is that I'm running Win8 on a MacBook Pro (Parallels) and I don't know how to override the physical keyboard and show it on screen instead.
Similarly, I'd like to be able to force rotation if possible.
You could run your app the Simulator. You can put the Simulator in "Touch Mode" and that will interpret mouse clicks as touch events in the on screen controls like Text Boxes and you can choose to rotate the Simulator into profile as well.

Cover screen with window in cocoa

I am writing a Mac application, in Cocoa, that needs the ability to 'lock down' the computer. Basically, I am writing a small agent that will sit in the background and when prompted, throw up a window that covers the entire screen, including the status bar, and shows a message (something like "give me back my computer, thief!").
The window has two requirements: it can't be moved and it can't be closed, minimized or otherwise disabled - just a big blob sitting on the screen, making sure the thief can't use the computer. I have all the agent stuff lined up, but I need help coding this window. Does anyone have any ideas?
Thanks,
Chris
P.S - In my dream world, this window would show up even at the login screen. The agent will be running by then, but I am not sure if OS X will allow it...
What you're asking for is basically to turn the user's computer into a not-very-functional kiosk. See also this technote on the same subject.
For display, alternatives to the full-screen view mode described in the Kiosk Mode document include:
Capture all the displays and draw directly to them using Quartz Display Services.
Set your window's frame to the frame of its screen and set its window level really high. You'll need to create one such window per screen.

Making a full screen Cocoa app

I want to create a full Screen Cocoa application, however my app is slightly different from a conventional fullscreen app.
This app would be below everything else, so underneath the menu bar and the Dock, etc. It would have a large image covering up the Desktop and icons, with a custom NSView in the middle with a table view, etc. If this concept is hard to understand then here is an image:
http://img10.imageshack.us/img10/6308/mockupo.png
The only part that might be a bit confusing is the background image. This background image is NOT the wallpaper of the computer, but part of the app. So when the app is launched, it goes into full screen mode and puts itself underneath the dock and the menu bar, and underneath all other windows too. So it draws the background image to cover the screen (including Desktop and icons). Then has a custom NSView in the middle containing my controls.
What's the best way to go about doing this?
Thanks
Make a borderless window, the size of the menu-bar screen (screen 0—not [NSScreen mainScreen]), positioned at 0,0, with window level kCGDesktopWindowLevel.
Remember that you will need to observe for screen frame-change notifications (when the user changes the screen dimensions), and that you should correctly handle the case of no screen at all (headless Mac).
I think #Peter Hosey’s solution should work, but to make other windows go on top, you will probably need to change the window level to something else.
But, I implore you, do not do this. This will be the most bugly application the Macintosh has ever seen. There are a lot of really good user interface paradigms that you can use, and "replicating" the main desktop interface of Mac OS X is generally not one of them. That is, unless you are reimplementing Time Machine or something like that.