Retrieve HIViewRef from dialog - macos

Is there any way to retrieve a HIViewRef reference from a Dialog (similar to HIViewGetRoot) in order to use it as a browser using WebKit API?
Thank's for all.

Assuming you're using modern NIB-based dialogs (and not the ancient resource-based stuff with Dialog Manager calls), there's basically no difference between a "dialog" and a "window", so the "HIViewGetRoot" technique applies in dialogs too.
(and if you are still using resource-based dialogs, check out the upgrading to the Mac OS X HIToolbox document, because you'll need to use NIB-based compositing windows if you want to embed a WebView in Carbon.)

Related

Does Windows support Mac-style PopOver controls?

Mac supports these sort of views:
https://developer.apple.com/design/human-interface-guidelines/macos/windows-and-views/popovers/
They are like short-lived tool panels but automatically disappear when you click outside the view.
I am trying to figure out if we can utilise them from a cross-platform Mac/Win application but can't be sure if WinAPI or Qt supports something like this? Does anyone know what classes they might be?

How to make preferences menu item in the menu to display user preferences in os-x application? [duplicate]

I would like to create a preferences window like in the standard Mac OS X apps (Safari etc.). I have found resources like DBPrefsWindowController from back in 2008 that matches the Apple HIG.
Just wondering if there is a new way to accomplish this? I can't locate any standard windows in Interface Builder so I assume Apple doesn't provide those, nor can I locate a official Apple sample code for providing this standard UI.
Thank you
It seems DBPrefsWindowController is no longer available.
For now, I would recommend the up to date RHPreferences framework.
Available on GitHub. BSD Licensed.
It’s a simple and easy Preferences window controller with multiple tabs for your next Mac application.
It also provides:
Auto resizing between different sized tab views (With animation)
Custom NSToolbarItem support
Persistence of the last used tab
Support for placeholder NSToolbarItems (eg NSToolbarFlexibleSpaceItemIdentifier & NSToolbarShowFontsItemIdentifier)

Accessing intra-window widget hierarchy

Editres is a pretty powerful program for displaying and even modifying properties of widgets within an application window. I believe it interfaces with the X resources. However, very few programs actually understand its protocol (for instance, Firefox does not). Is there a similar program or perhaps a command line tool for displaying widget hierarchy in any given window? A program like xprop will work on any window in the X Window System, but it (as far as I know) only retrieves information about an entire window and not the widget tree within it.
For context, I am working with the GNOME desktop environment on Red Hat Enterprise Linux.
Many modern widget toolkits don't use X windows for each widget, but instead manage the widgets manually as part of the library. As such, there's no protocol to intercept like you can with traditional X programs. These toolkits do expose widget tree information in other ways, though. GTK 2 had https://live.gnome.org/Accerciser, which appears to work with GTK 3.

Visual guide of AppKit controls?

Is there a visual guide to the controls in Mac OS/X AppKit?
Take, for instance, the following control that appears at different places in XCode UI:
I don't know which AppKit control is that. Any ideas?
It looks like a series of NSRadioButton views in an NSMatrix. You can determine the former using Accessibility Inspector, which will tell you that these buttons are of the accessibility class AXRadioButton. You can determine the latter using f-script. (You'll need the new 10.7 injection workflow that isn't in 2.1 yet.)

Is WebView behavior identical to Safari

Our Mac OS application displays user interface inside WebView component.
Can we rely on the fact that WebView behaves exactly as Safari content pane on any Mac?
Can we expect the same set of plugins installed in Safari and inside WebView of our application?
In other words, is the same WebView shared by all applications on Mac OS, including Safari?
Quoted from apple docs:
A WebView object is intended to
support most features you would expect
in a web browser except that it
doesn’t implement the specific user
interface for those features. You are
responsible for implementing the user
interface objects such as status bars,
toolbars, buttons, and text fields.
For example, a WebView object manages
a back-forward list by default, and
has goBack: and goForward: action
methods. It is your responsibility to
create the buttons that would send
theses action messages. Note, there is
some overhead in maintaining a
back-forward list and page cache, so
you should disable it if your
application doesn’t use it."
A WebView uses webkit engine to render html which is what safari also uses. Hence most of the functionality will be the same.

Resources