]> Dogcows Code - chaz/openbox/blobdiff - src/openbox_wrap.cc
kill button release events
[chaz/openbox] / src / openbox_wrap.cc
index ada473b6b6ccca6350549da16907984acf517fbe..f4db077c2120ba4d8c4d88f3804c26aeb4cb8b91 100644 (file)
@@ -780,13 +780,14 @@ static std::string SwigString_AsString(PyObject* o) {
 
   enum ActionType {
     Action_ButtonPress,
-    Action_ButtonRelease,
     Action_Click,
     Action_DoubleClick,
     Action_EnterWindow,
     Action_LeaveWindow,
     Action_KeyPress,
-    Action_MouseMotion
+    Action_MouseMotion,
+    Action_NewWindow,
+    Action_CloseWindow
   };
   enum WidgetType {
     Type_Frame,
@@ -848,6 +849,10 @@ PyObject * unregister_all(int action)
 
 PyObject * bind(PyObject *keylist, PyObject *func)
 {
+  if (!PyCallable_Check(func)) {
+    PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
+    return NULL;
+  }
   if (!PyList_Check(keylist)) {
     PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list.");
     return NULL;
@@ -2911,13 +2916,14 @@ _swigt__p_XUnmapEvent,
 
 static swig_const_info swig_const_table[] = {
 { SWIG_PY_INT,     (char *)"Action_ButtonPress", (long) Action_ButtonPress, 0, 0, 0},
-{ SWIG_PY_INT,     (char *)"Action_ButtonRelease", (long) Action_ButtonRelease, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Action_Click", (long) Action_Click, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Action_DoubleClick", (long) Action_DoubleClick, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Action_EnterWindow", (long) Action_EnterWindow, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Action_LeaveWindow", (long) Action_LeaveWindow, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Action_KeyPress", (long) Action_KeyPress, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Action_MouseMotion", (long) Action_MouseMotion, 0, 0, 0},
+{ SWIG_PY_INT,     (char *)"Action_NewWindow", (long) Action_NewWindow, 0, 0, 0},
+{ SWIG_PY_INT,     (char *)"Action_CloseWindow", (long) Action_CloseWindow, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Type_Frame", (long) Type_Frame, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Type_Titlebar", (long) Type_Titlebar, 0, 0, 0},
 { SWIG_PY_INT,     (char *)"Type_Handle", (long) Type_Handle, 0, 0, 0},
This page took 0.021224 seconds and 4 git commands to generate.