Page 2 of 2

Re: GUI control via Cef-prefixed functions

PostPosted: Wed Dec 25, 2013 10:28 pm
by IngwiePhoenix
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.

Re: GUI control via Cef-prefixed functions

PostPosted: Thu Dec 26, 2013 2:54 am
by Czarek
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*.

Re: GUI control via Cef-prefixed functions

PostPosted: Thu Dec 26, 2013 12:25 pm
by IngwiePhoenix
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

Re: GUI control via Cef-prefixed functions

PostPosted: Thu Dec 26, 2013 12:29 pm
by Czarek
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

Re: GUI control via Cef-prefixed functions

PostPosted: Fri Dec 27, 2013 12:04 am
by IngwiePhoenix
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! ^_^