Example #1
0
#!/usr/bin/python
import gtklib
from gtk import *
import GdkPixbuf
import GdkPixbufLoader
import GDK
from Test import *
import _GdkPixbufLoader

import _GdkPixbuf
_GdkPixbuf.set_debugging (0)
_GdkPixbufLoader.set_debugging (1)

import os
del os.environ["PYGTK_FATAL_EXCEPTIONS"] 

def feed_loader ():
	global fp, loader
	data = fp.read (64 * 1)
	if len(data) == 0:
		fp.close ()
		loader.close ()
		return FALSE
	loader.write (data)	
	return TRUE

#def area_prepared (loader, x, y):
def area_prepared (loader, x=None):
	print "area_prepared(): ", x

def area_updated (loader, x, y, width, height, *args):
#!/usr/bin/python
import gtklib

from gtk import *
import GDK
import GTK
import sys
import os
import string
import GdkPixbuf

import _GdkPixbuf
_GdkPixbuf.set_debugging(0)


class ProgressFileStatus:
    imagefile = None
    loader = None
    rgbwin = None
    buf = None
    timeout = None
    readlen = None


DEFAULT_WIDTH = 24
DEFAULT_HEIGHT = 24

default_image = [
    0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
    0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
    0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Example #3
0
def set_debugging(val):
    _GdkPixbuf.set_debugging(val)
Example #4
0
		return

	width = min (event_width, pix_width - x)
	height = min (event_height, pix_height - y)

	pixbuf.render_to_drawable (
	    drawing_area.get_window(),
	    drawing_area.get_style().black_gc,
	    x, y, x, y, 
	    width, height,
	    GDK.RGB_DITHER_NORMAL, 0, 0 
	)

#####	main 	########
import _GdkPixbuf
_GdkPixbuf.set_debugging (FALSE)
push_rgb_visual ()

import sys
if len(sys.argv) > 1:
	filename = sys.argv[1]
else:
	filename = "pic.png"

fp = open (filename, "r")

win = GtkWindow ()
win.connect ("destroy", mainquit)
win.set_usize (400, 400)

scrolled_window = GtkScrolledWindow ()
Example #5
0
def set_debugging (val):
	_GdkPixbuf.set_debugging (val)