Add function to get the screen size.

Sun, 29 Jul 2007 16:45:29 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Sun, 29 Jul 2007 16:45:29 +0000
changeset 19182
f109918d7e3d
parent 19181
6dd5ae8a6121
child 19183
aee7b7ad425e

Add function to get the screen size.

finch/libgnt/pygnt/gnt.override file | annotate | diff | comparison | revisions
--- a/finch/libgnt/pygnt/gnt.override	Sun Jul 29 16:36:05 2007 +0000
+++ b/finch/libgnt/pygnt/gnt.override	Sun Jul 29 16:45:29 2007 +0000
@@ -76,5 +76,19 @@
 	Py_INCREF(Py_None);
 	return Py_None;
 }
+%%
+define screen_size noargs
+static PyObject *
+_wrap_screen_size(PyObject *self)
+{
+	PyObject *list = PyList_New(0);
 
+	if (list == NULL)
+		return NULL;
 
+	PyList_Append(list, PyInt_FromLong((long)getmaxx(stdscr)));
+	PyList_Append(list, PyInt_FromLong((long)getmaxy(stdscr)));
+
+	return list;
+}
+

mercurial