[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] ecore_evas_callback_resize in c++



On Wed, 24 May 2006 23:44:52 +0200 Sevcsik András <sevcsik@citromail.hu>
babbled:

> Hi!
> 
> I'm trying to make an EdjeWindow class in c++. The problem is, that I
> can't bind with ecore_evas_callback_resize(). The compiler says:
> 
> contactlist.h: In constructor ‘EdjeWindow::EdjeWindow(char*,
> char*)’: contactlist.h:67: error: argument of type ‘void
> (EdjeWindow::)(Ecore_Evas*)’ does not match ‘void
> (*)(Ecore_Evas*)’
> 
> Here is the method I want to bind to callback_resize:
> 
> void EdjeWindow::AutoResize() {
> 	ecore_evas_geometry_get(ee, NULL, NULL, &edje_w, &edje_h);
> 	evas_object_resize(edje, edje_w, edje_h);
> }
> 
> I tried to add an "Ecore_Evas * ee" parameter to the method, but it
> doesn't work. Anyway, I don't need a parameter, since "ee" and "edje"
> are defined as class members:

well - actually you do need ee. ecore_evas calls the callback on a window
resize and passes in the ecore_evas (ee) that got resized. you can then
query/get all object specific data from the ee (you can attach data with string
keys ect.). something you attach is goign to HAVE to be a pointer to your c++
object so from the c callback you can now start doing c++. (ie maybe call
another function like cc_obj->resize_handle(); for example) THEN inside this
resize_handle method you will be happily in raw c++ land with "this" being your
object etc.

> private:
> 		Ecore_Evas	*ee;
> 		Evas		*evas;
> 		Evas_Object	*edje;
> 
> SetTitle() method works fine this way... I see that
> ecore_evas_callback_resize needs a function with an Evas_Ecore type
> parameter, but it doesn't work even with it.
> 
> Please keep in mind that I'm VERY BEGINNER IN C++, so be gentle
> please :) I know EFL wasn't designed for c++, but I really prefer c++
> than c.
> 
> I attached my whole header file.
> 
> Thanks,
> 	Sevcsik


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster@rasterman.com
裸好多
Tokyo, Japan (東京 日本)