just one comment for python-elementary guys: do not use mapping as a dict to care about bindings and their arguments, dicts are not that slow, but not that fast either. For such try to use tuples, which are fast and lean on memory.
On Thu, Jun 18, 2009 at 9:49 AM, Enlightenment SVN<[email protected]> wrote: > Log: > patch from ello: > > ticker #344 > > http://trac.enlightenment.org/e/ticket/344 > > > Author: raster > Date: 2009-06-18 05:49:04 -0700 (Thu, 18 Jun 2009) > New Revision: 41102 > > Modified: > trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_toolbar.pxi > > Modified: > trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_toolbar.pxi > =================================================================== > --- > trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_toolbar.pxi > 2009-06-18 12:14:29 UTC (rev 41101) > +++ > trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_toolbar.pxi > 2009-06-18 12:49:04 UTC (rev 41102) > @@ -25,7 +25,7 @@ > if mapping is not None: > callback = mapping["callback"] > if callback is not None and callable(callback): > - callback(mapping["class"], "clicked") > + callback(mapping["class"], "clicked", mapping["data"]) > else: > print "ERROR: no callback available for the item" > except Exception, e: > @@ -40,7 +40,7 @@ > def __new__(self): > self.item = NULL > > - def __init__(self, c_evas.Object toolbar, c_evas.Object icon, label, > callback): > + def __init__(self, c_evas.Object toolbar, c_evas.Object icon, label, > callback, data = None): > if icon is not None: > self.item = elm_toolbar_item_add(toolbar.obj, icon.obj, label, > _toolbar_callback, NULL) > else: > @@ -50,6 +50,7 @@ > mapping = dict() > mapping["class"] = self > mapping["callback"] = callback > + mapping["data"] = data > _toolbar_callback_mapping[<long>self.item] = mapping > > def delete(self): > @@ -78,7 +79,7 @@ > else: > elm_toolbar_scrollable_set(self.obj, 0) > > - def item_add(self, c_evas.Object icon, label, callback): > + def item_add(self, c_evas.Object icon, label, callback, data = None): > """ > Adds a new item to the toolbar > > @@ -91,7 +92,7 @@ > """ > # Everything is done in the ToolbarItem class, because of wrapping the > # C structures in python classes > - return ToolbarItem(self, icon, label, callback) > + return ToolbarItem(self, icon, label, callback, data) > > property clicked: > def __set__(self, value): > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: [email protected] Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
