summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/plugin.c')
-rw-r--r--plugins/pychrysa/plugin.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/plugins/pychrysa/plugin.c b/plugins/pychrysa/plugin.c
index 9dc0c29..6d8a494 100644
--- a/plugins/pychrysa/plugin.c
+++ b/plugins/pychrysa/plugin.c
@@ -482,7 +482,6 @@ static MatchingFormatAction g_python_plugin_is_matching(const GPythonPlugin *plu
-
/******************************************************************************
* *
* Paramètres : plugin = greffon de prise en charge à utiliser. *
@@ -749,6 +748,50 @@ static PyObject *pychrysa_plugin_run(PyObject *self, PyObject *args)
+#include <pygtk-2.0/pygobject.h>
+
+static int convert_to_w(PyGObject *obj, void **out)
+{
+
+ //if (!pygobject_check(obj,
+
+ *out = pygobject_get(obj);
+
+ return (1);
+
+}
+
+
+static PyObject *add_wgt(PyObject *self, PyObject *args)
+{
+ GtkWidget *result;
+ GtkWidget *button;
+
+
+ result = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_widget_set_size_request(result, 400, 300);
+ gtk_window_set_position(GTK_WINDOW(result), GTK_WIN_POS_CENTER);
+ gtk_container_set_border_width(GTK_CONTAINER(result), 4);
+ gtk_window_set_title(GTK_WINDOW(result), _("ChrysalideWWW"));
+
+ gtk_widget_show (result);
+
+
+ if (!PyArg_ParseTuple(args, "O&", convert_to_w, &button))
+ return Py_None;
+
+ gtk_container_add(GTK_CONTAINER(result), button);
+
+
+ return Py_None;
+
+}
+
+
+
+
+
+
/******************************************************************************
* *
@@ -780,6 +823,9 @@ static PyMethodDef pychrysa_plugin_methods[] = {
{ "run", (PyCFunction)pychrysa_plugin_run, METH_VARARGS,
"Run the plugin for a specific action."
},
+ { "add_wgt", (PyCFunction)add_wgt, METH_VARARGS,
+ "Run the plugin for a specific action."
+ },
NULL
};