aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-01-29 00:19:00 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-01-29 00:19:00 +0000
commitcd621fe499141885e5a0d8b4e42a0f8a7f41a9ac (patch)
treee9f03b14359517e117726500cf71c3e3d34789a9
parent31688e1b8f028059a700a92a8276c97928abd260 (diff)
downloadenigma2-cd621fe499141885e5a0d8b4e42a0f8a7f41a9ac.tar.gz
enigma2-cd621fe499141885e5a0d8b4e42a0f8a7f41a9ac.zip
fixed refcount of eListboxPythonStringContent
-rw-r--r--components.py11
-rw-r--r--lib/gui/elistbox.cpp2
-rw-r--r--lib/python/enigma_python.i7
-rw-r--r--mytest.py12
4 files changed, 19 insertions, 13 deletions
diff --git a/components.py b/components.py
index 20827180..52c94606 100644
--- a/components.py
+++ b/components.py
@@ -229,17 +229,18 @@ class MenuList(HTMLComponent, GUIComponent):
GUIComponent.__init__(self)
def getCurrent(self):
- return self.l.getCurrentSelection()
+# return self.l.getCurrentSelection()
+ return "none"
def GUIcreateInstance(self, priv, parent, skindata):
g = eListbox(parent)
# BIG BIG HACK. :( we have to ensure that the eListboxPythonStringContent doesn't get destroyed.
# we really have to take a look at the GC stuff
- self.l = eListboxPythonStringContent()
- self.l.setList(["Test Object 1", "Item #2", "Item #3", "nun kommt eine Zahl:", 15, "Bla fasel", "lulabla"])
- g.setContent(self.l)
+ l = eListboxPythonStringContent()
+ l.setList(["Test Object 1", "Item #2", "Item #3", "nun kommt eine Zahl:", 15, "Bla fasel", "lulabla"])
+ g.setContent(l)
return g
def GUIdeleteInstance(self, g):
g.setContent(None)
- del self.l
+ #del self.l
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp
index 96214aea..e06ab3e6 100644
--- a/lib/gui/elistbox.cpp
+++ b/lib/gui/elistbox.cpp
@@ -114,9 +114,7 @@ int eListbox::event(int event, void *data, void *data2)
void eListbox::recalcSize()
{
- eDebug("recalc size");
m_itemheight = 20;
m_content->setSize(eSize(size().width(), m_itemheight));
m_items_per_page = size().height() / m_itemheight;
- eDebug("done!");
}
diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i
index b84dbd14..ae15d0d9 100644
--- a/lib/python/enigma_python.i
+++ b/lib/python/enigma_python.i
@@ -33,6 +33,11 @@ is usually caused by not marking PSignals as immutable.
*/
+%define RefCount(...)
+%typemap(newfree) __VA_ARGS__ * { eDebug("adding ref"); $1->AddRef(); }
+%extend __VA_ARGS__ { ~__VA_ARGS__() { eDebug("removing ref!"); self->Release(); } }
+%ignore __VA_ARGS__::~__VA_ARGS__();
+%enddef
%module enigma
%{
@@ -59,6 +64,8 @@ extern void runMainloop();
extern PSignal1<void,int> &keyPressedSignal();
%}
+RefCount(eListboxPythonStringContent)
+
#define DEBUG
%include "stl.i"
%include <lib/base/object.h>
diff --git a/mytest.py b/mytest.py
index 5233d85e..e4a722ac 100644
--- a/mytest.py
+++ b/mytest.py
@@ -37,11 +37,11 @@ screens["global"](components)
# test our screens
components["$001"] = screens["testDialog"]()
-print "*** classes:"
-dump(screens)
-
-print "*** instances:"
-dump(components)
+#print "*** classes:"
+#dump(screens)
+#
+#print "*** instances:"
+#dump(components)
# display
@@ -100,7 +100,7 @@ class Session:
self.currentWindow = None
def keyEvent(self, code):
- print "code " + str(code)
+# print "code " + str(code)
if code == 32:
self.currentDialog.data["okbutton"]["instance"].push()