You can bind a data and an object using evas_object_data_set.
http://docs.enlightenment.org/auto/evas/group__Evas__Object__Group__Extras.html#ga70134a7068c9bff4107a761abe0a2ad4
Set whatever key/value to the object and get them when you need them.
Thanks.

Daniel Juyung Seo (SeoZ)

On Thu, Feb 14, 2013 at 10:14 PM, Justin Rosander
<justinrosan...@gmail.com>wrote:

> Thanks for the reply, Arvind.  Okay, so I have that working, and I
> understand by passing the addresses of the array to my callback, I am
> interacting with specific sliders.  If the type is void, then how would I
> specify that the values of a specific slider is supposed to be related to a
> specific integer?  In dealing with the callback, my understanding is I am
> passing on the address of the array, but I cannot increment the array
> directly in the callback like in a for loop:
>
> static void
> _changed_cb(void *data, Evas_Object *obj, void *event_info)
> {
>     double val = elm_slider_value_get(obj);
>      printf("Changed to %1.0f\n", val);
>      printf("slider is %d", *(int*)data); //test what is passed to *data
>     snd_seq_event_t ev;
>     snd_seq_ev_clear(&ev);
>     snd_seq_ev_set_source(&ev, out_port);
>     snd_seq_ev_set_subs(&ev);
>
>     snd_seq_ev_set_controller(&ev, 0, 0, (int)val);  //second and third
> args need to relate to the specific widget that is being interacted with,
> i.e. "1" for "slider 1"
>
>      snd_seq_ev_set_direct(&ev);
>     snd_seq_event_output_direct(seq_handle, &ev);
>     snd_seq_drain_output(seq_handle);
> }
>
> My goal here is to have the specific slider relate to specific integers
> such as in the second and third arguments of
> snd_seq_ev_set_controller(&ev, 0, 0, (int)val);
> so that when the specific slider is interacted with, I can pass to another
> function that I am dealing with a specific channel number or controller
> number.
>
>
> On Wed, Feb 13, 2013 at 8:51 PM, Arvind R <arvin...@gmail.com> wrote:
>
> > On Thu, Feb 14, 2013 at 6:51 AM, Justin Rosander
> > <justinrosan...@gmail.com> wrote:
> > > Hi there,
> > >
> > > I'm trying to put together a midi controller featuring faders that
> would
> > be
> > > assigned to different channels.  In exploring the use of an array to
> > make a
> > > window full of sliders, I put the following together:
> > >
> > > for(x = 0; x < 12; x++) {
> > >
> > >     //add slider
> > >     sl[x] = elm_slider_add(win);
> > >
> > >     elm_slider_horizontal_set(sl[x], EINA_FALSE);
> > >     //pack at the end of the box
> > >     elm_box_pack_end(box, sl[x]);
> > >     evas_object_show(sl[x]);
> > >     //callback to function returning value
> > >     evas_object_smart_callback_add(sl[x], "changed", _changed_cb,
> NULL);
> > > }
> > Replace the NULL in the callback_add with a pointer to data. It will
> > be available as the first argument in the callback funcion as a void *
> > . If you don't need to reference any other data in the cb, you can
> > pass &sl[x]. Also, the second arg. in the cb is the first arg. in the
> > callback_add().
> > >
> > > What I'm trying to figure out is how I would differentiate one slider
> > from
> > > another in a callback function?  For instance, when I move, say,
> "slider
> > 1"
> > > as opposed to "slider 2".
> > >
> > > Any input is appreciated.
> > >
> > > Justin
> > >
> >
> ------------------------------------------------------------------------------
> > > Free Next-Gen Firewall Hardware Offer
> > > Buy your Sophos next-gen firewall before the end March 2013
> > > and get the hardware for free! Learn more.
> > > http://p.sf.net/sfu/sophos-d2d-feb
> > > _______________________________________________
> > > enlightenment-users mailing list
> > > enlightenment-users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/enlightenment-users
> >
> >
> >
> ------------------------------------------------------------------------------
> > Free Next-Gen Firewall Hardware Offer
> > Buy your Sophos next-gen firewall before the end March 2013
> > and get the hardware for free! Learn more.
> > http://p.sf.net/sfu/sophos-d2d-feb
> > _______________________________________________
> > enlightenment-users mailing list
> > enlightenment-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-users
> >
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> enlightenment-users mailing list
> enlightenment-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-users
>
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to