#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Andreas Büsching <crunchy@bitkipper.net>
#
# test programm for the gobject notifier
#
# Copyright (C) 2004, 2005, 2006
#	Andreas Büsching <crunchy@bitkipper.net>
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version
# 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA

"""Simple test program for the GTK+ notifier."""

import sys

import notifier

notifier.init( notifier.GTK, x11 = False )

def hello( *args ):
	print 'Hello World'

# notifier-timer testfunction
def timer_test():
	print "timer_test"
	notifier.dispatcher_add( notifier.Callback( dispatcher_test, 1, 2, 3 ) )
	return True

def dispatcher_test( a, b, c ):
	print 'dispatcher', a, b, c
	return False

def _stdin( fd ):
	notifier.socket_remove( 0 )
	return False

notifier.socket_add( 0, _stdin )
notifier.timer_add( 4000, notifier.Callback( timer_test ) )
notifier.dispatcher_add( notifier.Callback( dispatcher_test, 1, 2, 3 ) )
notifier.loop()


syntax highlighted by Code2HTML, v. 0.9.1