Views as a cross-platform UI toolkit

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Views as a cross-platform UI toolkit

Postby zura » Tue Feb 13, 2018 2:17 pm

Hello,

Is it possible to use Chromium Views library as a cross-platform UI toolkit? i.e. *without* writing Win32 API, Gtk or Cocoa code on corresponding platforms.

If yes, then why there is no sample provided? As I see we have separate samples for Win, Mac and Linux.

So basically, I don't want to write any platform specific code - is this possible? and how limited/feature-full this way would be? e.g. support of top-level windows/dialogs, controls such as radio/checkbox, etc...

Alternative is to use Qt and its QWebEngine, which is a modified Chromium. So can CEF be an alternative to such approach? (Qt)
zura
Newbie
 
Posts: 3
Joined: Tue Feb 13, 2018 1:55 pm

Re: Views as a cross-platform UI toolkit

Postby magreenblatt » Wed Feb 14, 2018 9:26 am

zura wrote:Is it possible to use Chromium Views library as a cross-platform UI toolkit?

Yes, on Windows and Linux currently.

zura wrote:If yes, then why there is no sample provided?

Build setup is platform-specific. Run cefclient or cefsimple with the --use-views command-line flag for an example.

zura wrote:So basically, I don't want to write any platform specific code - is this possible? and how limited/feature-full this way would be? e.g. support of top-level windows/dialogs, controls such as radio/checkbox, etc...

Almost any type of UI can be implemented in a browser window using HTML/JS. With Views you do not need to write native code to create a browser window. If you wish other platform-specific integrations (task bar icon, touch bar, etc) then you will still need to write native code. You can browse the views header files to see what's supported at https://bitbucket.org/chromiumembedded/ ... ?at=master
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Views as a cross-platform UI toolkit

Postby zura » Wed Feb 14, 2018 10:50 am

Thanks for the reply.

Any plans for macOS support? Any specific challenges there?

Regarding creating UI in HTML - is there some kind of https://electronjs.org/docs/api/webview-tag or maybe good old iframe should be used? i.e. to have some predefined UI elements and "nested" web view to open some URLs.
zura
Newbie
 
Posts: 3
Joined: Tue Feb 13, 2018 1:55 pm

Re: Views as a cross-platform UI toolkit

Postby magreenblatt » Wed Feb 14, 2018 12:28 pm

zura wrote:Any plans for macOS support? Any specific challenges there?

It's currently under development in Chromium.

zura wrote:Regarding creating UI in HTML - is there some kind of https://electronjs.org/docs/api/webview-tag or maybe good old iframe should be used? i.e. to have some predefined UI elements and "nested" web view to open some URLs.

You can use an iframe and (if necessary) restrict JS bindings access by checking the origin in OnContextCreated.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 100 guests