tasn pushed a commit to branch master.
commit 6a19cc68a9653773b91a1ada2157e0d03752be93
Author: Simon Busch <[email protected]>
Date: Wed Jan 7 20:43:03 2009 +0000
Fix elementary.Toggle.state_set()
SVN revision: 38493
---
elementary/elementary.c_elementary.pyx | 14 ++------------
include/elementary/c_elementary.pxd | 4 +++-
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/elementary/elementary.c_elementary.pyx
b/elementary/elementary.c_elementary.pyx
index 8a35c12..324e94e 100644
--- a/elementary/elementary.c_elementary.pyx
+++ b/elementary/elementary.c_elementary.pyx
@@ -414,9 +414,9 @@ cdef class Toggle(Object):
def state_set(self, state):
if state == True:
- self.state_ptr = 1
+ elm_toggle_state_set(self.obj, 1)
elif state == False:
- self.state_ptr = 0
+ elm_toggle_state_set(self.obj, 0)
def state_get(self):
if self.state_ptr == 1:
@@ -700,14 +700,6 @@ _toolbar_callback_mapping = dict()
cdef void _toolbar_callback(void *data, c_evas.Evas_Object *obj, void
*event_info):
pass
- """
- callback_func = _toolbar_callback_mapping.get(<long>data, None)
- print callback_func
- if not callable(callback_func):
- print "ERROR: callback function is not callable"
- return
- callback_func(None, "clicked")
- """
cdef class Toolbar(Object):
def __init__(self, c_evas.Object parent):
@@ -719,8 +711,6 @@ cdef class Toolbar(Object):
item = elm_toolbar_item_add(self.obj, icon.obj, label,
_toolbar_callback, NULL)
else:
item = elm_toolbar_item_add(self.obj, NULL, label,
_toolbar_callback, NULL)
-
-# _toolbar_callback_mapping[<long>item.base] = callback
property clicked:
def __set__(self, value):
diff --git a/include/elementary/c_elementary.pxd
b/include/elementary/c_elementary.pxd
index 1a46e93..6bcd393 100644
--- a/include/elementary/c_elementary.pxd
+++ b/include/elementary/c_elementary.pxd
@@ -62,6 +62,7 @@ cdef extern from "Ecore_X.h":
ctypedef Ecore_X_ID Ecore_X_Window
# Dirty hack to manage callback functions for the toolbar
+"""
cdef struct Elm_Toolbar_Item:
evas.c_evas.Evas_Object *obj
evas.c_evas.Evas_Object *base
@@ -69,6 +70,7 @@ cdef struct Elm_Toolbar_Item:
void (*func) (void *data, evas.c_evas.Evas_Object *obj, void *event_info)
void *data
evas.c_evas.Evas_Bool selected
+"""
# For Debugging
"""
@@ -100,7 +102,7 @@ cdef extern from "Elementary.h":
cdef struct Elm_Entry_Anchorview_Info
cdef struct Elm_Entry_Anchorblock_Info
cdef struct Elm_Hoversel_Item
- # cdef struct Elm_Toolbar_Item
+ cdef struct Elm_Toolbar_Item
# Basic elementary functions
void elm_init(int argc,char** argv)
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar