GUI control via Cef-prefixed functions

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Wed Dec 25, 2013 10:28 pm

Czarek wrote:
IngwiePhoenix wrote:What is the very basic requirement to have CEF spawn in a window? Do I just use the current window I created and give it to CEF - or how do I do that?

Create a window and then pass window handle to CreateBrowser().


So createBrowser() can use any window handle, or must it be a specific one? I am looking into CEGUI and FLTK now, Im just wondering if one of the two would work.
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby Czarek » Thu Dec 26, 2013 2:54 am

IngwiePhoenix wrote:So createBrowser() can use any window handle, or must it be a specific one? I am looking into CEGUI and FLTK now, Im just wondering if one of the two would work.

It has to be a native window handle. On Windows this is HWND. On Linux it is GtkWidget*.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Thu Dec 26, 2013 12:25 pm

But how is it then, that I was told that wxWidgets works with CEF, when that is just another framework that acts as an overlay over native widgets? O.o On mac, it does not spill out the raw NS-thing it is using, afaik... o.o
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby Czarek » Thu Dec 26, 2013 12:29 pm

See wxWindow::GetHandle():

Code: Select all
Returns the platform-specific handle of the physical window.

Cast it to an appropriate handle, such as HWND for Windows, Widget for Motif or GtkWidget for GTK.


http://docs.wxwidgets.org/trunk/classwx ... b722651b27
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Fri Dec 27, 2013 12:04 am

FLTK can spill out the native handle too, now I have everything I need. Bad thing is, the devs had to tell me themselves, because the function went undocumented thru doxygen =D.

But for whoever is curios:

Definition:
Code: Select all
Window fltk_xid(Fl_Window *)


Pseudo-use:
Code: Select all
Fl_Window *win = new Fl_Window(100,100, "o.o");
NSWindow *NSwin = (NSWindow*)fl_xid(win);


I am not good with pointers and variables off the caff - but just think about casting the returned instance by fl_xid to the native handle.

Thank you for the help! ^_^
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Previous

Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 15 guests