summaryrefslogtreecommitdiff
path: root/efl/elementary/efl.elementary_radio.pxi
diff options
context:
space:
mode:
Diffstat (limited to 'efl/elementary/efl.elementary_radio.pxi')
-rw-r--r--efl/elementary/efl.elementary_radio.pxi85
1 files changed, 85 insertions, 0 deletions
diff --git a/efl/elementary/efl.elementary_radio.pxi b/efl/elementary/efl.elementary_radio.pxi
new file mode 100644
index 0000000..94a90f5
--- /dev/null
+++ b/efl/elementary/efl.elementary_radio.pxi
@@ -0,0 +1,85 @@
1# Copyright (c) 2008-2009 Simon Busch
2#
3# This file is part of python-elementary.
4#
5# python-elementary is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# python-elementary is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with python-elementary. If not, see <http://www.gnu.org/licenses/>.
17#
18
19cdef class Radio(LayoutClass):
20
21 def __init__(self, evasObject parent, obj=None):
22 if obj is None:
23 self._set_obj(elm_radio_add(parent.obj))
24 else:
25 self._set_obj(<Evas_Object*>obj)
26
27 def group_add(self, evasObject group):
28 elm_radio_group_add(self.obj, group.obj)
29
30 def state_value_set(self, value):
31 elm_radio_state_value_set(self.obj, value)
32
33 def state_value_get(self):
34 return elm_radio_state_value_get(self.obj)
35
36 property state_value:
37 def __get__(self):
38 return elm_radio_state_value_get(self.obj)
39 def __set__(self, value):
40 elm_radio_state_value_set(self.obj, value)
41
42 def value_set(self, value):
43 elm_radio_value_set(self.obj, value)
44
45 def value_get(self):
46 return elm_radio_value_get(self.obj)
47
48 property value:
49 def __get__(self):
50 return elm_radio_value_get(self.obj)
51 def __set__(self, value):
52 elm_radio_value_set(self.obj, value)
53
54 #TODO: Check whether this actually works
55 def value_pointer_set(self, value):
56 cdef int valuep = value
57 elm_radio_value_pointer_set(self.obj, &valuep)
58
59 def selected_object_get(self):
60 cdef Radio r = Radio()
61 cdef Evas_Object *selected = elm_radio_selected_object_get(self.obj)
62 if selected == NULL:
63 return None
64 else:
65 r.obj = selected
66 return r
67
68 property selected_object:
69 def __get__(self):
70 cdef Radio r = Radio()
71 cdef Evas_Object *selected = elm_radio_selected_object_get(self.obj)
72 if selected == NULL:
73 return None
74 else:
75 r.obj = selected
76 return r
77
78 def callback_changed_add(self, func, *args, **kwargs):
79 self._callback_add("changed", func, *args, **kwargs)
80
81 def callback_changed_del(self, func):
82 self._callback_del("changed", func)
83
84
85_object_mapping_register("elm_radio", Radio)