summaryrefslogtreecommitdiff
path: root/gtk/__init__.py
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2002-11-19 02:17:38 +0000
committerJames Henstridge <jamesh@src.gnome.org>2002-11-19 02:17:38 +0000
commit75a08796665e3bd273dcfd1016b6ae181330a1f5 (patch)
treef8fe7b9e7fa5fae2d151b372be059d9906d9d9be /gtk/__init__.py
parent17e4ea9a0464718545adea3a3d41dec952889f76 (diff)
downloadpygtk-75a08796665e3bd273dcfd1016b6ae181330a1f5.tar.gz
get rid of pyg_handler_marshal and pyg_input_marshal, which were the last
2002-11-19 James Henstridge <james@daa.com.au> * gtk/gtkobject-support.c: get rid of pyg_handler_marshal and pyg_input_marshal, which were the last bits of code using the old GtkArg APIs in gtk. * gtk/gtk.override: remove wrappers for gtk_idle_add, gtk_timeout_add and gtk_input_add. (_wrap_gtk_quit_add): change so that it doesn't use pyg_handler_marshal. * gtk/__init__.py: set the TRUE and FALSE constants to True and False if possible. Fall back to 0/1 otherwise. (*): bind idle, timeout and input functions to gobject equivalents. * gobjectmodule.c (get_handler_priority): helper function to get priority value as a keyword argument. (pyg_idle_add): convert priority arg to an optional keyword argument. (pyg_timeout_add): and here. (pyg_io_add_watch): and here.
Diffstat (limited to 'gtk/__init__.py')
-rw-r--r--gtk/__init__.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/gtk/__init__.py b/gtk/__init__.py
index 31e730c1..9f3b52cd 100644
--- a/gtk/__init__.py
+++ b/gtk/__init__.py
@@ -27,17 +27,31 @@ except ImportError:
pass
# TRUE and FALSE constants ...
-FALSE = 0
-TRUE = 1
+try:
+ FALSE = False
+ TRUE = True
+except NameError:
+ FALSE = 0
+ TRUE = 1
-import gobject
-del gobject
+import gobject as _gobject
# load the required modules:
import keysyms
from _gtk import *
import gdk # this is created by the _gtk import
+threads_init = gdk.threads_init
+threads_enter = gdk.threads_leave
+threads_leave = gdk.threads_leave
+
+idle_add = _gobject.idle_add
+idle_remove = _gobject.source_remove
+timeout_add = _gobject.timeout_add
+timeout_remove = _gobject.source_remove
+input_add = _gobject.io_add_watch
+input_remove = _gobject.source_remove
+
# old names compatibility ...
mainloop = main
def mainquit(*args):
@@ -49,9 +63,3 @@ load_fontset = gdk.fontset_load
create_pixmap = gdk.Pixmap
create_pixmap_from_xpm = gdk.pixmap_create_from_xpm
create_pixmap_from_xpm_d = gdk.pixmap_create_from_xpm_d
-
-threads_init = gdk.threads_init
-threads_enter = gdk.threads_leave
-threads_leave = gdk.threads_leave
-
-input_add = input_add_full