/* start module: gtk */
gtk = $pyjs.loaded_modules["gtk"] = function (__mod_name__) {
if(gtk.__was_initialized__) return gtk;
gtk.__was_initialized__ = true;
if (__mod_name__ == null) __mod_name__ = 'gtk';
var __name__ = gtk.__name__ = __mod_name__;
 pyjslib.__import__(['pyjamas.log', 'pyjamas'], 'pyjamas.log', 'gtk')
 gtk.log = $pyjs.__modules__.pyjamas.log;
 pyjslib.__import__(['browser'], 'browser', 'gtk')
 gtk.browser = $pyjs.__modules__.browser
 pyjslib.__import__(['gdk'], 'gdk', 'gtk')
 gtk.gdk = $pyjs.__modules__.gdk
gtk.WINDOW_TOPLEVEL = 1;
gtk.EXPAND = 1;
gtk.FILL = 2;
gtk.TOPLEVEL = 1;
gtk.NO_WINDOW = 2;
gtk.REALIZED = 4;
gtk.MAPPED = 8;
gtk.VISIBLE = 16;
gtk.SENSITIVE = 32;
gtk.PARENT_SENSITIVE = 64;
gtk.CAN_FOCUS = 128;
gtk.HAS_FOCUS = 256;
gtk.CAN_DEFAULT = 512;
gtk.HAS_DEFAULT = 1024;
gtk.HAS_GRAB = 2048;
gtk.RC_STYLE = 4096;
gtk.COMPOSITE_CHILD = 8192;
gtk.NO_REPARENT = 16384;
gtk.APP_PAINTABLE = 32768;
gtk.RECEIVES_DEFAULT = 65536;
gtk.DOUBLE_BUFFERED = 131072;
gtk.UPDATE_CONTINUOUS = 1;
gtk.UPDATE_DISCONTINUOUS = 2;
gtk.UPDATE_DELAYED = 4;
gtk.POS_LEFT = 1;
gtk.POS_RIGHT = 2;
gtk.POS_TOP = 4;
gtk.POS_BOTTOM = 8;
gtk.GObject = (function(){
	var cls_instance = pyjs__class_instance('GObject');
	var cls_definition = new Object();
	cls_definition.__md5__ = '78de663db4f953754947cb7e7e774f50';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.callbacks = new pyjslib.Dict([]);
		self.connections = 0;
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.connect = pyjs__bind_method(cls_instance, 'connect', function(detailed_signal, handler, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			detailed_signal = arguments[1];
			handler = arguments[2];
			data = arguments[3];
		}
		if (typeof data == 'undefined') data=null;
		var l;
		detailed_signal = detailed_signal.replace(String('_'), String('-'));
		l = self.callbacks.setdefault(detailed_signal, new pyjslib.List([]));
		l.append(new pyjslib.Tuple([handler, data]));
		self.connections += 1;
		return self.connections;
	}
	, 1, [null,null,'self', 'detailed_signal', 'handler', 'data']);
	cls_definition.connect_object = pyjs__bind_method(cls_instance, 'connect_object', function(detailed_signal, handler, gobject, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			detailed_signal = arguments[1];
			handler = arguments[2];
			gobject = arguments[3];
			data = arguments[4];
		}
		if (typeof data == 'undefined') data=null;
		var inner;
		detailed_signal = detailed_signal.replace(String('_'), String('-'));
		inner = function(widget, data) {

			handler(widget, data);
			return null;
		};
		inner.__name__ = 'inner';

		inner.__bind_type__ = 0;
		inner.__args__ = [null,null,'widget', 'data'];
		self.connect(detailed_signal, inner, data);
		return null;
	}
	, 1, [null,null,'self', 'detailed_signal', 'handler', 'gobject', 'data']);
	cls_definition.emit = pyjs__bind_method(cls_instance, 'emit', function(detailed_signal) {
		if (this.__is_instance__ === true) {
			var self = this;
			var args = new Array();
			for (var pyjs__va_arg = 1; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				args.push(pyjs__arg);
			}
			args = pyjslib.Tuple(args);

		} else {
			var self = arguments[0];
			detailed_signal = arguments[1];
			var args = new Array();
			for (var pyjs__va_arg = 2; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
				var pyjs__arg = arguments[pyjs__va_arg];
				args.push(pyjs__arg);
			}
			args = pyjslib.Tuple(args);

		}
		var pair;
		detailed_signal = detailed_signal.replace(String('_'), String('-'));
		if (pyjslib.bool(self.callbacks.has_key(detailed_signal))) {
			var __pair = self.callbacks.__getitem__(detailed_signal).__iter__();
			try {
				while (true) {
					var pair = __pair.next();
					
					pair.__getitem__(0)(self, pair.__getitem__(1));
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		return null;
	}
	, 1, ['args',null,'self', 'detailed_signal']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

 		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
gtk.Object = (function(){
	var cls_instance = pyjs__class_instance('Object');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a76fbfa0a7cb6ae0d3f24175b7f3cfe3';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.GObject.__init__(self);
		self.flags = 0;
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.set_flags = pyjs__bind_method(cls_instance, 'set_flags', function(flags) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			flags = arguments[1];
		}

		self.flags = flags;
		return null;
	}
	, 1, [null,null,'self', 'flags']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.GObject));
})();
gtk.Widget = (function(){
	var cls_instance = pyjs__class_instance('Widget');
	var cls_definition = new Object();
	cls_definition.__md5__ = '26c9b1a76fb700b7943097fe2f488e7a';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Object.__init__(self);
		self._visible = false;
		self.widget_cont = gtk.browser.Element(String('div'));
		self.widget_cont.setStyle(String('visibility'), String('hidden'));
		self.widget_cont.setStyle(String('position'), String('absolute'));
		self.widget_cont.setStyle(String('overflow'), String('hidden'));
		self.minheight = 1;
		self.minwidth = 1;
		self.widget_cont.setPxStyle(String('minHeight'), self.minheight);
		self.widget_cont.setPxStyle(String('minWidth'), self.minwidth);
		self.margin = 0;
		self.widget_cont.setPxStyle(String('margin'), self.margin);
		self._parent = null;
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.get_allocation = pyjs__bind_method(cls_instance, 'get_allocation', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var y,x,w,h;
		x = self.widget_cont.getX();
		y = self.widget_cont.getY();
		w = self.widget_cont.getWidth();
		h = self.widget_cont.getHeight();
		return gtk.gdk.Rectangle(x, y, w, h);
	}
	, 1, [null,null,'self']);
	cls_definition.show = pyjs__bind_method(cls_instance, 'show', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self._visible = true;
		self.widget_cont.setStyle(String('visibility'), String('visible'));
		self._redraw();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.hide = pyjs__bind_method(cls_instance, 'hide', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self._visible = false;
		self.widget_cont.setStyle(String('visibility'), String('hidden'));
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.show_all = pyjs__bind_method(cls_instance, 'show_all', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.show();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.hide_all = pyjs__bind_method(cls_instance, 'hide_all', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.hide();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.destroy = pyjs__bind_method(cls_instance, 'destroy', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.emit(String('destroy'));
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.grab_default = pyjs__bind_method(cls_instance, 'grab_default', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

 		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.set_size_request = pyjs__bind_method(cls_instance, 'set_size_request', function(width, height) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			width = arguments[1];
			height = arguments[2];
		}

 		return null;
	}
	, 1, [null,null,'self', 'width', 'height']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var container;
		container = self.widget_cont;
		container.setPxStyle(String('minHeight'), self.minheight);
		container.setPxStyle(String('minWidth'), self.minwidth);
		container.setPxStyle(String('margin'), self.margin);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Object));
})();
gtk.Entry = (function(){
	var cls_instance = pyjs__class_instance('Entry');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'afade7fd1a18d7063e766a9370e62cc0';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Widget.__init__(self);
		self.widget_int = gtk.browser.Document.createElement(String('input'));
		self.widget_cont.append(self.widget_int);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Widget));
})();
gtk.Container = (function(){
	var cls_instance = pyjs__class_instance('Container');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a56228d8f80a783601bf7d9d4cd3336c';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Widget.__init__(self);
		self.children = new pyjslib.List([]);
		self.widget_int = gtk.browser.Document.createElement(String('div'));
		self.widget_int.setStyle(String('position'), String('absolute'));
		self.widget_cont.append(self.widget_int);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		if (pyjslib.bool(self._visible)) {
			child.show();
		}
		child._parent = self;
		self.children.append(child);
		self.widget_int.append(child.widget_cont);
		self.minwidth += child.minwidth;
		self.minheight += child.minheight;
		return null;
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.set_border_width = pyjs__bind_method(cls_instance, 'set_border_width', function(border_width) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			border_width = arguments[1];
		}

		self.margin = border_width;
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'border_width']);
	cls_definition.get_border_width = pyjs__bind_method(cls_instance, 'get_border_width', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.margin;
	}
	, 1, [null,null,'self']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var container,child;
		gtk.Widget._redraw(self);
		container = self.widget_cont;
		container.setPxStyle(String('width'), container.getWidth());
		container.setPxStyle(String('height'), container.getHeight());
		self.minwidth =  ( 2 * self.margin ) ;
		self.minheight =  ( 2 * self.margin ) ;
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child._redraw();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (pyjslib.bool(pyjslib.eq(pyjslib.len(self.children), 1))) {
			self.minwidth += self.children.__getitem__(0).minwidth;
			self.minheight += self.children.__getitem__(0).minheight;
		}
		container.setPxStyle(String('minHeight'), self.minheight);
		container.setPxStyle(String('minWidth'), self.minwidth);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.show_all = pyjs__bind_method(cls_instance, 'show_all', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var child;
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child.show_all();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		gtk.Widget.show_all(self);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.hide_all = pyjs__bind_method(cls_instance, 'hide_all', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var child;
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child.hide_all();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		gtk.Widget.hide_all(self);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.child_set_property = pyjs__bind_method(cls_instance, 'child_set_property', function(child, prop, value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
			prop = arguments[2];
			value = arguments[3];
		}

		pyjslib.setattr(child, prop, value);
		return null;
	}
	, 1, [null,null,'self', 'child', 'prop', 'value']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Widget));
})();
gtk.Bin = (function(){
	var cls_instance = pyjs__class_instance('Bin');
	var cls_definition = new Object();
	cls_definition.__md5__ = '09b4e1c4f6ee3c2afb1de061e99adf75';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Container.__init__(self);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.get_child = pyjs__bind_method(cls_instance, 'get_child', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool((pyjslib.cmp(pyjslib.len(self.children), 0) == 1))) {
			return self.children.__getitem__(0);
		}
		else {
			return null;
		}
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		if (pyjslib.bool((pyjslib.cmp(pyjslib.len(self.children), 0) == 1))) {
		}
		gtk.Container.add(self, child);
		return null;
	}
	, 1, [null,null,'self', 'child']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Container));
})();
gtk.Table = (function(){
	var cls_instance = pyjs__class_instance('Table');
	var cls_definition = new Object();
	cls_definition.__md5__ = '7189f9fa43a579d82cec23cbe4c0987e';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(rows, columns, homogeneous) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			rows = arguments[1];
			columns = arguments[2];
			homogeneous = arguments[3];
		}
		if (typeof rows == 'undefined') rows=1;
		if (typeof columns == 'undefined') columns=1;
		if (typeof homogeneous == 'undefined') homogeneous=false;

		gtk.Container.__init__(self);
		self.rows = rows;
		self.columns = columns;
		self.vert_inc =  ( 100.0 / rows ) ;
		self.horitz_inc =  ( 100.0 / columns ) ;
		return null;
	}
	, 1, [null,null,'self', 'rows', 'columns', 'homogeneous']);
	cls_definition.attach = pyjs__bind_method(cls_instance, 'attach', function(child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
			left_attach = arguments[2];
			right_attach = arguments[3];
			top_attach = arguments[4];
			bottom_attach = arguments[5];
			xoptions = arguments[6];
			yoptions = arguments[7];
			xpadding = arguments[8];
			ypadding = arguments[9];
		}
		if (typeof xoptions == 'undefined') xoptions=null;
		if (typeof yoptions == 'undefined') yoptions=null;
		if (typeof xpadding == 'undefined') xpadding=0;
		if (typeof ypadding == 'undefined') ypadding=0;
		var child_container;
		if (pyjslib.bool((xoptions === null))) {
			xoptions = (gtk.EXPAND | gtk.FILL);
		}
		if (pyjslib.bool((yoptions === null))) {
			yoptions = (gtk.EXPAND | gtk.FILL);
		}
		gtk.Container.add(self, child);
		child_container = child.widget_cont;
		child_container.setPercentStyle(String('left'),  ( left_attach * self.horitz_inc ) );
		child_container.setPercentStyle(String('right'),  ( 100 -  ( right_attach * self.horitz_inc )  ) );
		child_container.setPercentStyle(String('top'),  ( top_attach * self.vert_inc ) );
		child_container.setPercentStyle(String('bottom'),  ( 100 -  ( bottom_attach * self.vert_inc )  ) );
		return null;
	}
	, 1, [null,null,'self', 'child', 'left_attach', 'right_attach', 'top_attach', 'bottom_attach', 'xoptions', 'yoptions', 'xpadding', 'ypadding']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Container));
})();
gtk.Box = (function(){
	var cls_instance = pyjs__class_instance('Box');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'ed60f383fc96906df5a4e574d2892a7b';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Container.__init__(self);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._add_element = pyjs__bind_method(cls_instance, '_add_element', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}

		gtk.Container.add(self, element);
		return null;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition.pack_start = pyjs__bind_method(cls_instance, 'pack_start', function(child, expand, fill, padding) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
			expand = arguments[2];
			fill = arguments[3];
			padding = arguments[4];
		}
		if (typeof expand == 'undefined') expand=true;
		if (typeof fill == 'undefined') fill=true;
		if (typeof padding == 'undefined') padding=0;

		child.expand = expand;
		child.fill = fill;
		child.padding = padding;
		self._add_element(child);
		return null;
	}
	, 1, [null,null,'self', 'child', 'expand', 'fill', 'padding']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		child.expand = true;
		child.fill = true;
		child.padding = 0;
		self._add_element(child);
		return null;
	}
	, 1, [null,null,'self', 'child']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Container));
})();
gtk.HBox = (function(){
	var cls_instance = pyjs__class_instance('HBox');
	var cls_definition = new Object();
	cls_definition.__md5__ = '1dd65e53b6b6d9c9f1a03be7b8fd9500';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(homogeneous, spacing) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			homogeneous = arguments[1];
			spacing = arguments[2];
		}
		if (typeof homogeneous == 'undefined') homogeneous=false;
		if (typeof spacing == 'undefined') spacing=0;

		gtk.Box.__init__(self);
		self.homogeneous = homogeneous;
		self.spacing = spacing;
		return null;
	}
	, 1, [null,null,'self', 'homogeneous', 'spacing']);
	cls_definition._add_element = pyjs__bind_method(cls_instance, '_add_element', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}

		gtk.Box._add_element(self, element);
		element.widget_cont.setPxStyle(String('height'),  ( self.widget_cont.getHeight() -  ( 2 * self.margin )  ) );
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var count,right,container,child_container,fix_width,child,horiz_inc,left;
		gtk.Box._redraw(self);
		count = 0;
		fix_width = 0;
		if (pyjslib.bool(!(self.homogeneous))) {
			var __child = self.children.__iter__();
			try {
				while (true) {
					var child = __child.next();
					
					if (pyjslib.bool(child.expand)) {
						count += 1;
					}
					else {
						fix_width +=  (  (  ( child.minwidth + self.spacing )  + child.padding )  +  ( 2 * child.margin )  ) ;
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else {
			count = pyjslib.len(self.children);
		}
		container = self.widget_cont;
		horiz_inc =  (  (  ( container.getWidth() -  ( 2 * self.margin )  )  - fix_width )  / count ) ;
		left = self.margin;
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				if (pyjslib.bool((pyjslib.len(self.children) != 1))) {
					if (pyjslib.bool((pyjslib.cmp( ( child.minheight +  ( 2 * self.margin )  ) , self.minheight) == 1))) {
						self.minheight =  ( child.minheight +  ( 2 * self.margin )  ) ;
					}
					self.minwidth +=  (  (  ( child.minwidth +  ( 2 * child.margin )  )  + self.spacing )  + child.padding ) ;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		container.setPxStyle(String('minHeight'), self.minheight);
		container.setPxStyle(String('minWidth'), self.minwidth);
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child_container = child.widget_cont;
				child_container.setPxStyle(String('height'),  ( container.getHeight() -  ( 2 * self.margin )  ) );
				child_container.setPxStyle(String('left'),  (  ( left +  ( self.spacing / 2 )  )  +  ( child.padding / 2 )  ) );
				if (pyjslib.bool(child.expand)) {
					left += horiz_inc;
				}
				else {
					left +=  (  (  ( child.minwidth +  ( 2 * child.margin )  )  + self.spacing )  + child.padding ) ;
				}
				right =  (  ( container.getWidth() - self.margin )  - left ) ;
				right = pyjslib.max(right, self.margin);
				child_container.setPxStyle(String('right'),  (  ( right +  ( self.spacing / 2 )  )  +  ( child.padding / 2 )  ) );
				child._redraw();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Box));
})();
gtk.VBox = (function(){
	var cls_instance = pyjs__class_instance('VBox');
	var cls_definition = new Object();
	cls_definition.__md5__ = '21618d3e152de74771bd21c69a3ce16e';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(homogeneous, spacing) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			homogeneous = arguments[1];
			spacing = arguments[2];
		}
		if (typeof homogeneous == 'undefined') homogeneous=false;
		if (typeof spacing == 'undefined') spacing=0;

		gtk.Box.__init__(self);
		self.homogeneous = homogeneous;
		self.spacing = spacing;
		return null;
	}
	, 1, [null,null,'self', 'homogeneous', 'spacing']);
	cls_definition._add_element = pyjs__bind_method(cls_instance, '_add_element', function(element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			element = arguments[1];
		}

		gtk.Box._add_element(self, element);
		element.widget_cont.setPxStyle(String('width'),  ( self.widget_cont.getWidth() -  ( 2 * self.margin )  ) );
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'element']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var count,vert_inc,bottom,fix_height,child,top;
		gtk.Box._redraw(self);
		count = 0;
		fix_height = 0;
		if (pyjslib.bool(!(self.homogeneous))) {
			var __child = self.children.__iter__();
			try {
				while (true) {
					var child = __child.next();
					
					if (pyjslib.bool(child.expand)) {
						count += 1;
					}
					else {
						fix_height +=  (  (  ( child.minheight + self.spacing )  + child.padding )  +  ( 2 * child.margin )  ) ;
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else {
			count = pyjslib.len(self.children);
		}
		vert_inc =  (  (  ( self.widget_cont.getHeight() -  ( 2 * self.margin )  )  - fix_height )  / count ) ;
		top = self.margin;
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				if (pyjslib.bool((pyjslib.len(self.children) != 1))) {
					if (pyjslib.bool((pyjslib.cmp( ( child.minwidth +  ( 2 * self.margin )  ) , self.minwidth) == 1))) {
						self.minwidth =  ( child.minwidth +  ( 2 * self.margin )  ) ;
					}
					self.minheight +=  (  (  ( child.minheight +  ( 2 * child.margin )  )  + self.spacing )  + child.padding ) ;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		self.widget_cont.setPxStyle(String('minHeight'), self.minheight);
		self.widget_cont.setPxStyle(String('minWidth'), self.minwidth);
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				child.widget_cont.setPxStyle(String('width'),  ( self.widget_cont.getWidth() -  ( 2 * self.margin )  ) );
				child.widget_cont.setPxStyle(String('top'),  (  ( top +  ( self.spacing / 2 )  )  +  ( child.padding / 2 )  ) );
				if (pyjslib.bool(child.expand)) {
					top += vert_inc;
				}
				else {
					top +=  (  (  ( child.minheight +  ( 2 * child.margin )  )  + self.spacing )  + child.padding ) ;
				}
				bottom =  (  ( self.widget_cont.getHeight() - self.margin )  - top ) ;
				bottom = pyjslib.max(bottom, self.margin);
				child.widget_cont.setPxStyle(String('bottom'),  (  ( bottom +  ( self.spacing / 2 )  )  +  ( child.padding / 2 )  ) );
				child._redraw();
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Box));
})();
gtk.Window = (function(){
	var cls_instance = pyjs__class_instance('Window');
	var cls_definition = new Object();
	cls_definition.__md5__ = '2336fc3c8e542795c925eb2f94b56d24';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(type) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			type = arguments[1];
		}
		if (typeof type == 'undefined') type=gtk.WINDOW_TOPLEVEL;
		var style;
		gtk.Bin.__init__(self);
		gtk.browser.Document.window.catchEvents(new pyjslib.List([String('resize')]), self);
		self.type = type;
		self.title = String('');
		self.child = null;
		var __style = new pyjslib.List([String('top'), String('bottom'), String('right'), String('left')]).__iter__();
		try {
			while (true) {
				var style = __style.next();
				
				self.widget_cont.setPxStyle(style, 0);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (pyjslib.bool(pyjslib.eq(self.type, gtk.WINDOW_TOPLEVEL))) {
			gtk.browser.Document.append(self.widget_cont);
		}
		else {
		}
		return null;
	}
	, 1, [null,null,'self', 'type']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		gtk.Bin.add(self, child);
		child.widget_cont.setPxStyle(String('width'), self.widget_cont.getWidth());
		child.widget_cont.setPxStyle(String('height'), self.widget_cont.getHeight());
		self.child = child;
		return null;
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.set_title = pyjs__bind_method(cls_instance, 'set_title', function(title) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			title = arguments[1];
		}

		self.title = title;
		if (pyjslib.bool(pyjslib.eq(self.type, gtk.WINDOW_TOPLEVEL))) {
			gtk.browser.Document.setTitle(title);
		}
		else {
		}
		return null;
	}
	, 1, [null,null,'self', 'title']);
	cls_definition.show = pyjs__bind_method(cls_instance, 'show', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self._redraw();
		gtk.Bin.show(self);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		if (pyjslib.bool(self.child)) {
			self.child.widget_cont.setPxStyle(String('width'), self.widget_cont.getWidth());
			self.child.widget_cont.setPxStyle(String('height'), self.widget_cont.getHeight());
		}
		gtk.Bin._redraw(self);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		if (pyjslib.bool(new pyjslib.List([String('resize')]).__contains__(event.type))) {
			self._redraw();
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Bin));
})();
gtk.Button = (function(){
	var cls_instance = pyjs__class_instance('Button');
	var cls_definition = new Object();
	cls_definition.__md5__ = '3b0507e2f289d7574ffc7645e234fcc3';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(label) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			label = arguments[1];
		}
		if (typeof label == 'undefined') label=null;

		gtk.Bin.__init__(self);
		self.widget_cont.catchEvents(new pyjslib.List([String('click')]), self);
		self.child = null;
		if (pyjslib.bool((label !== null))) {
			self.add(gtk.Label(label));
		}
		self.widget_int.setStyle(String('textAlign'), String('center'));
		self.widget_int.setProperty(String('className'), String('button'));
		self.minheight = 25;
		self.minwidth = 20;
		return null;
	}
	, 1, [null,null,'self', 'label']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		gtk.Bin.add(self, child);
		self.child = child;
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'child']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var width,height;
		gtk.Bin._redraw(self);
		self.minheight += self.child.minheight;
		self.minwidth += self.child.minwidth;
		width = self.widget_cont.getWidth();
		width = pyjslib.max(width,  ( self.minwidth + 2 ) );
		height = self.widget_cont.getHeight();
		height = pyjslib.max(height,  ( self.minheight + 2 ) );
		self.widget_int.setPxStyle(String('width'),  ( width - 2 ) );
		self.widget_int.setPxStyle(String('height'),  ( height - 2 ) );
		self.child.widget_cont.setPxStyle(String('width'), width);
		self.child.widget_cont.setPxStyle(String('height'), height);
		self.child._redraw();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			self.emit(String('clicked'));
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Bin));
})();
gtk.ToggleButton = (function(){
	var cls_instance = pyjs__class_instance('ToggleButton');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'b9959bf76908f6a012cdbdc7d689925a';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(label) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			label = arguments[1];
		}
		if (typeof label == 'undefined') label=null;

		gtk.Button.__init__(self, label);
		self.connect(String('toggled'), self.toggled);
		self.istoggled = false;
		self.widget_int.setProperty(String('className'), String('togglebutton'));
		return null;
	}
	, 1, [null,null,'self', 'label']);
	cls_definition.toggled = pyjs__bind_method(cls_instance, 'toggled', function(widget, event, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			event = arguments[2];
			data = arguments[3];
		}
		if (typeof data == 'undefined') data=null;

		self.istoggled = !(self.istoggled);
		if (pyjslib.bool(self.istoggled)) {
			self.widget_int.setProperty(String('className'), String('togglebutton-toggled'));
		}
		else {
			self.widget_int.setProperty(String('className'), String('togglebutton'));
		}
		return null;
	}
	, 1, [null,null,'self', 'widget', 'event', 'data']);
	cls_definition.set_active = pyjs__bind_method(cls_instance, 'set_active', function(is_active) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			is_active = arguments[1];
		}

		if (pyjslib.bool(((is_active) && (!(self.istoggled))) || ((!(is_active)) && (self.istoggled)))) {
			self.emit(String('toggled'));
		}
		return null;
	}
	, 1, [null,null,'self', 'is_active']);
	cls_definition.get_active = pyjs__bind_method(cls_instance, 'get_active', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.istoggled;
	}
	, 1, [null,null,'self']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			self.emit(String('toggled'));
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Button));
})();
gtk.CheckButton = (function(){
	var cls_instance = pyjs__class_instance('CheckButton');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c1d78045eb4ac1b09cb5054fef8a0d08';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(label) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			label = arguments[1];
		}
		if (typeof label == 'undefined') label=null;

		gtk.ToggleButton.__init__(self);
		self.check = gtk.browser.Element(String('input'));
		self.check.setStyle(String('position'), String('absolute'));
		self.check.setStyle(String('width'), String('auto'));
		self.check.setStyle(String('height'), String('auto'));
		self.check.setPxStyle(String('left'), 0);
		self.check.setProperty(String('type'), String('checkbox'));
		self.check_widget = gtk.Widget();
		self.check_widget.widget_cont.append(self.check);
		self.check_widget.show();
		self.box = pyjs_kwargs_call(gtk, 'HBox', null, null, [{spacing:6}]);
		self.box.show();
		self.box.pack_start(self.check_widget, false);
		self.add(self.box);
		if (pyjslib.bool((label !== null))) {
			self.label = gtk.Label(label);
			self.box.pack_start(self.label, false);
		}
		self.widget_int.setProperty(String('className'), String('checkbutton'));
		return null;
	}
	, 1, [null,null,'self', 'label']);
	cls_definition.add = pyjs__bind_method(cls_instance, 'add', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		gtk.ToggleButton.add(self, child);
		return null;
	}
	, 1, [null,null,'self', 'child']);
	cls_definition.toggled = pyjs__bind_method(cls_instance, 'toggled', function(widget, event, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			event = arguments[2];
			data = arguments[3];
		}
		if (typeof data == 'undefined') data=null;

		self.istoggled = !(self.istoggled);
		if (pyjslib.bool(self.istoggled)) {
			self.check.setProperty(String('checked'), true);
		}
		else {
			self.check.setProperty(String('checked'), false);
		}
		return null;
	}
	, 1, [null,null,'self', 'widget', 'event', 'data']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.ToggleButton._redraw(self);
		self.check.setPxStyle(String('top'),  (  (  ( self.check_widget.widget_cont.getHeight() / 2 )  -  ( self.check.getHeight() / 2 )  )  - 2.5 ) );
		self.check_widget.minwidth =  ( self.check.getWidth() + 2 ) ;
		self.check_widget.minheight =  ( self.check.getHeight() + 2 ) ;
		self.check_widget._redraw();
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.ToggleButton));
})();
gtk.RadioButton = (function(){
	var cls_instance = pyjs__class_instance('RadioButton');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'f11ed0e9e9ef12b308f40f49e6b3871b';
	cls_definition.counter = 0
	cls_definition.groups = new pyjslib.Dict([])
	cls_definition.running = false
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(group, label) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			group = arguments[1];
			label = arguments[2];
		}
		if (typeof group == 'undefined') group=null;
		if (typeof label == 'undefined') label=null;

		gtk.CheckButton.__init__(self, label);
		self.check.setProperty(String('type'), String('radio'));
		if (pyjslib.bool((group === null))) {
			self.group = gtk.RadioButton.counter;
			gtk.RadioButton.counter += 1;
			gtk.RadioButton.groups.__setitem__(self.group, new pyjslib.List([self]));
		}
		else {
			self.group = group.group;
			gtk.RadioButton.groups.__getitem__(self.group).append(self);
		}
		return null;
	}
	, 1, [null,null,'self', 'group', 'label']);
	cls_definition.toggled = pyjs__bind_method(cls_instance, 'toggled', function(widget, event, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			widget = arguments[1];
			event = arguments[2];
			data = arguments[3];
		}
		if (typeof data == 'undefined') data=null;
		var b;
		if (pyjslib.bool(gtk.RadioButton.running)) {
			return null;
		}
		gtk.RadioButton.running = true;
		var __b = gtk.RadioButton.groups.__getitem__(self.group).__iter__();
		try {
			while (true) {
				var b = __b.next();
				
				if (pyjslib.bool(b.istoggled)) {
					b.check.setProperty(String('checked'), false);
					b.istoggled = false;
					b.emit(String('toggled'));
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		self.check.setProperty(String('checked'), true);
		self.istoggled = true;
		gtk.RadioButton.running = false;
		return null;
	}
	, 1, [null,null,'self', 'widget', 'event', 'data']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.CheckButton));
})();
gtk.Misc = (function(){
	var cls_instance = pyjs__class_instance('Misc');
	var cls_definition = new Object();
	cls_definition.__md5__ = '0dafbc2c9b087fcda8b1dc12966ddad1';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Widget.__init__(self);
		self.xalign = 0.5;
		self.yalign = 0.5;
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.set_alignment = pyjs__bind_method(cls_instance, 'set_alignment', function(xalign, yalign) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			xalign = arguments[1];
			yalign = arguments[2];
		}

		self.xalign = xalign;
		self.yalign = yalign;
		return null;
	}
	, 1, [null,null,'self', 'xalign', 'yalign']);
	cls_definition.get_alignment = pyjs__bind_method(cls_instance, 'get_alignment', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return new pyjslib.Tuple([self.xalign, self.yalign]);
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Widget));
})();
gtk.Image = (function(){
	var cls_instance = pyjs__class_instance('Image');
	var cls_definition = new Object();
	cls_definition.__md5__ = '16215b9e508c09ab0733ace5ba3afc99';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Misc.__init__(self);
		self.img = gtk.browser.Element(String('img'));
		self.img.setStyle(String('position'), String('absolute'));
		self.img.setStyle(String('width'), String('auto'));
		self.img.setStyle(String('height'), String('auto'));
		self.widget_cont.append(self.img);
		self.widget_cont.setProperty(String('className'), String('image'));
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.set_from_file = pyjs__bind_method(cls_instance, 'set_from_file', function(filename) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			filename = arguments[1];
		}

		self.img.setProperty(String('src'), filename);
		return null;
	}
	, 1, [null,null,'self', 'filename']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Misc._redraw(self);
		self.img.setPxStyle(String('top'),  (  ( self.widget_cont.getHeight() - self.img.getHeight() )  * self.yalign ) );
		self.img.setPxStyle(String('left'),  (  ( self.widget_cont.getWidth() - self.img.getWidth() )  * self.xalign ) );
		self.minwidth = self.img.getWidth();
		self.minheight = self.img.getHeight();
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Misc));
})();
gtk.Label = (function(){
	var cls_instance = pyjs__class_instance('Label');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a9739c0b5ad4878ad6d594186240f40f';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(str) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			str = arguments[1];
		}
		if (typeof str == 'undefined') str=null;

		gtk.Misc.__init__(self);
		self.label = gtk.browser.Element(String('div'));
		self.label.setStyle(String('position'), String('absolute'));
		self.label.setStyle(String('width'), String('auto'));
		self.label.setStyle(String('height'), String('auto'));
		self.label.setStyle(String('whiteSpace'), String('nowrap'));
		self.label.setHTML(str);
		self.widget_cont.append(self.label);
		self.widget_cont.setStyle(String('visibility'), String('visible'));
		self.widget_cont.setProperty(String('className'), String('label'));
		return null;
	}
	, 1, [null,null,'self', 'str']);
	cls_definition.set_text = pyjs__bind_method(cls_instance, 'set_text', function(str) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			str = arguments[1];
		}

		self.label.setHTML(str);
		return null;
	}
	, 1, [null,null,'self', 'str']);
	cls_definition.get_text = pyjs__bind_method(cls_instance, 'get_text', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.label.getHTML();
	}
	, 1, [null,null,'self']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Misc._redraw(self);
		self.label.setPxStyle(String('top'),  (  ( self.widget_cont.getHeight() - self.label.getHeight() )  * self.yalign ) );
		self.label.setPxStyle(String('left'),  (  ( self.widget_cont.getWidth() - self.label.getWidth() )  * self.xalign ) );
		self.minwidth = self.label.getWidth();
		self.minheight = self.label.getHeight();
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Misc));
})();
gtk.Separator = (function(){
	var cls_instance = pyjs__class_instance('Separator');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'a459e905a8d9e0c2760d061953394e4c';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Widget.__init__(self);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Widget));
})();
gtk.HSeparator = (function(){
	var cls_instance = pyjs__class_instance('HSeparator');
	var cls_definition = new Object();
	cls_definition.__md5__ = '425c3a526a6eebc9f93d71771fabd842';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Separator.__init__(self);
		self.separator = gtk.browser.Element(String('hr'));
		self.widget_cont.append(self.separator);
		self.widget_cont.setProperty(String('className'), String('hseparator'));
		self.minheight = 10;
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Separator));
})();
gtk.Adjustment = (function(){
	var cls_instance = pyjs__class_instance('Adjustment');
	var cls_definition = new Object();
	cls_definition.__md5__ = '28de0f893ca38acf734f08f40548626e';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(value, lower, upper, step_incr, page_incr, page_size) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			value = arguments[1];
			lower = arguments[2];
			upper = arguments[3];
			step_incr = arguments[4];
			page_incr = arguments[5];
			page_size = arguments[6];
		}
		if (typeof value == 'undefined') value=0;
		if (typeof lower == 'undefined') lower=0;
		if (typeof upper == 'undefined') upper=0;
		if (typeof step_incr == 'undefined') step_incr=0;
		if (typeof page_incr == 'undefined') page_incr=0;
		if (typeof page_size == 'undefined') page_size=0;

		gtk.Object.__init__(self);
		self.value = value;
		self.lower = lower;
		self.upper = upper;
		self.step_incr = step_incr;
		self.page_incr = page_incr;
		self.page_size = page_size;
		return null;
	}
	, 1, [null,null,'self', 'value', 'lower', 'upper', 'step_incr', 'page_incr', 'page_size']);
	cls_definition.get_value = pyjs__bind_method(cls_instance, 'get_value', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.value;
	}
	, 1, [null,null,'self']);
	cls_definition.set_value = pyjs__bind_method(cls_instance, 'set_value', function(value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			value = arguments[1];
		}

		self.value = value;
		if (pyjslib.bool((pyjslib.cmp(self.value, self.lower) == -1))) {
			self.value = self.lower;
		}
		if (pyjslib.bool((pyjslib.cmp(self.value, self.upper) == 1))) {
			self.value = self.upper;
		}
		self.emit(String('value-changed'));
		return null;
	}
	, 1, [null,null,'self', 'value']);
	cls_definition.changed = pyjs__bind_method(cls_instance, 'changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.emit(String('changed'));
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Object));
})();
gtk.Range = (function(){
	var cls_instance = pyjs__class_instance('Range');
	var cls_definition = new Object();
	cls_definition.__md5__ = '6697e79e8dbe5cd566f44cee50745ea9';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;

		gtk.Widget.__init__(self);
		self.value = gtk.browser.Element(String('div'));
		self.value.setStyle(String('position'), String('absolute'));
		self.widget_cont.append(self.value);
		if (pyjslib.bool((adjustment !== null))) {
			self.adjustment = adjustment;
		}
		else {
			self.adjustment = gtk.Adjustment();
		}
		self.adjustment.connect(String('value-changed'), self._adjustment_value_changed);
		self.adjustment.connect(String('changed'), self._adjustment_changed);
		self.value.setHTML(pyjslib.str(self.adjustment.get_value()));
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition.set_update_policy = pyjs__bind_method(cls_instance, 'set_update_policy', function(policy) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			policy = arguments[1];
		}

 		return null;
	}
	, 1, [null,null,'self', 'policy']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.value.setHTML(pyjslib.str(self.adjustment.get_value()));
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._adjustment_changed = pyjs__bind_method(cls_instance, '_adjustment_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self._redraw();
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Widget));
})();
gtk.Scale = (function(){
	var cls_instance = pyjs__class_instance('Scale');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c6ad1c7d0a151b36b2822a62b066bdba';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;

		gtk.Range.__init__(self, adjustment);
		self.line = gtk.browser.Element(String('div'));
		self.line.setStyle(String('position'), String('absolute'));
		self.line.setProperty(String('className'), String('scale'));
		self.line.catchEvents(new pyjslib.List([String('click')]), self);
		self.cursor = gtk.browser.Element(String('div'));
		self.cursor.setStyle(String('position'), String('absolute'));
		self.cursor.setProperty(String('className'), String('scale-cursor'));
		self.widget_cont.append(self.line);
		self.mouseover = false;
		self.value_pos = gtk.POS_TOP;
		self.draw_value = true;
		self.digits = 1;
		self.cursor.catchEvents(new pyjslib.List([String('mousedown')]), self);
		gtk.browser.Document.document.catchEvents(new pyjslib.List([String('mousemove')]), self);
		gtk.browser.Document.document.catchEvents(new pyjslib.List([String('mouseup')]), self);
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition.set_digits = pyjs__bind_method(cls_instance, 'set_digits', function(digits) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			digits = arguments[1];
		}

		self.digits = digits;
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'digits']);
	cls_definition.set_draw_value = pyjs__bind_method(cls_instance, 'set_draw_value', function(draw_value) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			draw_value = arguments[1];
		}

		self.draw_value = draw_value;
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'draw_value']);
	cls_definition.get_draw_value = pyjs__bind_method(cls_instance, 'get_draw_value', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.draw_value;
	}
	, 1, [null,null,'self']);
	cls_definition.set_value_pos = pyjs__bind_method(cls_instance, 'set_value_pos', function(pos) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			pos = arguments[1];
		}

		self.value_pos = pos;
		self._redraw();
		return null;
	}
	, 1, [null,null,'self', 'pos']);
	cls_definition.get_value_pos = pyjs__bind_method(cls_instance, 'get_value_pos', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.value_pos;
	}
	, 1, [null,null,'self']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var value;
		value = self.adjustment.get_value();

        value = value.toFixed(self.digits);
        
		self.value.setHTML(pyjslib.str(value));
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._move_cursor = pyjs__bind_method(cls_instance, '_move_cursor', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}

 		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		if (pyjslib.bool(pyjslib.eq(event.type, String('mousedown')))) {
			self.mouseover = true;
		}
		else if (pyjslib.bool((pyjslib.eq(event.type, String('mousemove'))) && (self.mouseover))) {
			self._move_cursor(event);
		}
		else if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			self._move_cursor(event);
		}
		else if (pyjslib.bool(pyjslib.eq(event.type, String('mouseup')))) {
			self.mouseover = false;
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Range));
})();
gtk.VScale = (function(){
	var cls_instance = pyjs__class_instance('VScale');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c595c355efcf1a8d5e6c7fc6dff6439f';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;

		gtk.Scale.__init__(self, adjustment);
		self.line.setPxStyle(String('width'), 15);
		self.cursor.setPxStyle(String('height'), 30);
		self.cursor.setPxStyle(String('width'), 13);
		self.line.append(self.cursor);
		self.minwidth = 30;
		self.minheight = 60;
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var container_height,container,line_width,value,container_width,value_width,line,value_height;
		gtk.Scale._redraw(self);
		container = self.widget_cont;
		line = self.line;
		value = self.value;
		container_width = container.getWidth();
		container_height = container.getHeight();
		line_width = self.line.getWidth();
		value_width = self.value.getWidth();
		value_height = self.value.getHeight();
		if (pyjslib.bool(!(self.draw_value))) {
			line.setPxStyle(String('left'),  (  ( container_width - line_width )  / 2 ) );
			line.setPxStyle(String('top'), 0);
			line.setPxStyle(String('height'),  ( container_height - 2 ) );
			value.setStyle(String('visibility'), String('hidden'));
		}
		else {
			value.setStyle(String('visibility'), String('visible'));
			if (pyjslib.bool(pyjslib.eq(self.value_pos, gtk.POS_TOP))) {
				value.setPxStyle(String('left'),  (  ( container_width - value_width )  / 2 ) );
				value.setPxStyle(String('top'), 0);
				line.setPxStyle(String('left'),  (  ( container_width - line_width )  / 2 ) );
				line.setPxStyle(String('top'),  ( value_height + 2 ) );
				line.setPxStyle(String('height'),  (  ( container_height - value_height )  - 4 ) );
			}
			else if (pyjslib.bool(pyjslib.eq(self.value_pos, gtk.POS_LEFT))) {
				value.setPxStyle(String('left'),  (  ( container_width / 2 )  -  (  ( value_width + line_width )  / 2 )  ) );
				line.setPxStyle(String('left'),  (  ( container_width / 2 )  +  (  ( value_width + line_width )  / 2 )  ) );
				line.setPxStyle(String('top'), 0);
				line.setPxStyle(String('height'),  ( container_height - 2 ) );
			}
			else if (pyjslib.bool(pyjslib.eq(self.value_pos, gtk.POS_RIGHT))) {
				value.setPxStyle(String('left'),  (  ( container_width / 2 )  +  (  ( value_width + line_width )  / 2 )  ) );
				line.setPxStyle(String('left'),  (  ( container_width / 2 )  -  (  ( value_width + line_width )  / 2 )  ) );
				line.setPxStyle(String('top'), 0);
				line.setPxStyle(String('height'),  ( container_height - 2 ) );
			}
			else {
				value.setPxStyle(String('left'),  (  ( container_width - value_width )  / 2 ) );
				value.setPxStyle(String('top'),  ( container_height - value_height ) );
				line.setPxStyle(String('left'),  (  ( container_width - line_width )  / 2 ) );
				line.setPxStyle(String('top'), 0);
				line.setPxStyle(String('height'),  (  ( container_height - value_height )  - 4 ) );
			}
		}
		self._adjustment_value_changed();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._move_cursor = pyjs__bind_method(cls_instance, '_move_cursor', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var incr,old_value,value,y;
		gtk.Scale._move_cursor(self, event);
		y =  (  ( event.clientY - self.line.getY() )  -  ( self.cursor.getHeight() / 2 )  ) ;
		y = pyjslib.max(y, 0);
		y = pyjslib.min(y,  (  ( self.line.getHeight() - self.cursor.getHeight() )  - 2 ) );
		value =  (  ( y /  (  ( self.line.getHeight() - self.cursor.getHeight() )  - 2 )  )  *  ( self.adjustment.upper - self.adjustment.page_size )  ) ;
		if (pyjslib.bool(self.draw_value)) {
			value = pyjslib.round(value, self.digits);
		}
		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			old_value = self.adjustment.get_value();
			incr = self.adjustment.page_incr;
			if (pyjslib.bool((pyjslib.cmp(value, old_value) == 1))) {
				self.adjustment.set_value( ( old_value + incr ) );
			}
			else if (pyjslib.bool((pyjslib.cmp(value, old_value) == -1))) {
				self.adjustment.set_value( ( old_value - incr ) );
			}
		}
		else {
			self.adjustment.set_value(value);
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var y,pos,value;
		gtk.Scale._adjustment_value_changed(self);
		value = self.adjustment.get_value();
		if (pyjslib.bool(self.draw_value)) {
			value = pyjslib.round(value, self.digits);
		}
		y =  (  (  ( value - self.adjustment.lower )  /  ( self.adjustment.upper - self.adjustment.page_size )  )  *  (  ( self.line.getHeight() - self.cursor.getHeight() )  - 2 )  ) ;
		self.cursor.setPxStyle(String('top'), y);
		if (pyjslib.bool(new pyjslib.Tuple([gtk.POS_LEFT, gtk.POS_RIGHT]).__contains__(self.value_pos))) {
			pos =  (  ( y -  ( self.value.getHeight() / 2 )  )  +  ( self.cursor.getHeight() / 2 )  ) ;
			self.value.setPxStyle(String('top'), pos);
		}
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Scale));
})();
gtk.HScale = (function(){
	var cls_instance = pyjs__class_instance('HScale');
	var cls_definition = new Object();
	cls_definition.__md5__ = '9b89f007df007ab6f19304112e7a38e5';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;

		gtk.Scale.__init__(self, adjustment);
		self.line.setPxStyle(String('height'), 15);
		self.cursor.setPxStyle(String('height'), 13);
		self.cursor.setPxStyle(String('width'), 30);
		self.line.append(self.cursor);
		self.minwidth = 60;
		self.minheight = 37;
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var container_height,container,line_width,value,container_width,value_width,line,line_height,value_height;
		gtk.Scale._redraw(self);
		container = self.widget_cont;
		line = self.line;
		value = self.value;
		container_width = container.getWidth();
		container_height = container.getHeight();
		line_width = self.line.getWidth();
		line_height = self.line.getHeight();
		value_width = self.value.getWidth();
		value_height = self.value.getHeight();
		if (pyjslib.bool(!(self.draw_value))) {
			line.setPxStyle(String('top'),  (  ( container_height - line_height )  / 2 ) );
			line.setPxStyle(String('width'),  ( container_width - 2 ) );
			value.setStyle(String('visibility'), String('hidden'));
		}
		else {
			self.value.setStyle(String('visibility'), String('visible'));
			if (pyjslib.bool(pyjslib.eq(self.value_pos, gtk.POS_TOP))) {
				value.setPxStyle(String('top'),  (  ( container_height / 2 )  -  (  (  ( line_height + value_height )  + 2 )  / 2 )  ) );
				line.setPxStyle(String('left'), 0);
				line.setPxStyle(String('top'),  (  (  (  ( container_height / 2 )  +  ( line_height / 2 )  )  -  ( value_height / 2 )  )  + 1 ) );
				line.setPxStyle(String('width'),  ( container_width - 2 ) );
			}
			else if (pyjslib.bool(pyjslib.eq(self.value_pos, gtk.POS_LEFT))) {
				value.setPxStyle(String('left'), 0);
				value.setPxStyle(String('top'),  (  ( container_height - value_height )  / 2 ) );
				line.setPxStyle(String('left'),  ( value_width + 2 ) );
				line.setPxStyle(String('top'),  (  ( container_height - line_height )  / 2 ) );
				line.setPxStyle(String('width'),  (  ( container_width -  ( value_width + 2 )  )  - 2 ) );
			}
			else if (pyjslib.bool(pyjslib.eq(self.value_pos, gtk.POS_RIGHT))) {
				value.setPxStyle(String('left'),  ( container_width - value_width ) );
				value.setPxStyle(String('top'),  (  ( container_height - value_height )  / 2 ) );
				line.setPxStyle(String('left'), 0);
				line.setPxStyle(String('top'),  (  ( container_height - line_height )  / 2 ) );
				line.setPxStyle(String('width'),  (  ( container_width -  ( value_width + 2 )  )  - 2 ) );
			}
			else {
				value.setPxStyle(String('top'),  (  (  (  ( container_height / 2 )  +  ( line_height / 2 )  )  -  ( value_height / 2 )  )  + 1 ) );
				line.setPxStyle(String('left'), 0);
				line.setPxStyle(String('top'),  (  ( container_height / 2 )  -  (  (  ( line_height + value_height )  + 2 )  / 2 )  ) );
				line.setPxStyle(String('width'),  ( container_width - 2 ) );
			}
		}
		self._adjustment_value_changed();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._move_cursor = pyjs__bind_method(cls_instance, '_move_cursor', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var incr,old_value,value,x;
		gtk.Scale._move_cursor(self, event);
		x =  (  ( event.clientX - self.line.getX() )  -  ( self.cursor.getWidth() / 2 )  ) ;
		x = pyjslib.max(x, 0);
		x = pyjslib.min(x,  (  ( self.line.getWidth() - self.cursor.getWidth() )  - 2 ) );
		value =  (  ( x /  (  ( self.line.getWidth() - self.cursor.getWidth() )  - 2 )  )  *  ( self.adjustment.upper - self.adjustment.page_size )  ) ;
		if (pyjslib.bool(self.draw_value)) {
			value = pyjslib.round(value, self.digits);
		}
		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			old_value = self.adjustment.get_value();
			incr = self.adjustment.page_incr;
			if (pyjslib.bool((pyjslib.cmp(value, old_value) == 1))) {
				self.adjustment.set_value( ( old_value + incr ) );
			}
			else if (pyjslib.bool((pyjslib.cmp(value, old_value) == -1))) {
				self.adjustment.set_value( ( old_value - incr ) );
			}
		}
		else {
			self.adjustment.set_value(value);
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var x,pos,value;
		gtk.Scale._adjustment_value_changed(self);
		value = self.adjustment.get_value();
		if (pyjslib.bool(self.draw_value)) {
			value = pyjslib.round(value, self.digits);
		}
		x =  (  (  ( value - self.adjustment.lower )  /  ( self.adjustment.upper - self.adjustment.page_size )  )  *  (  ( self.line.getWidth() - self.cursor.getWidth() )  - 2 )  ) ;
		self.cursor.setPxStyle(String('left'), x);
		if (pyjslib.bool(new pyjslib.Tuple([gtk.POS_TOP, gtk.POS_BOTTOM]).__contains__(self.value_pos))) {
			pos =  (  ( x -  ( self.value.getWidth() / 2 )  )  +  ( self.cursor.getWidth() / 2 )  ) ;
			pos = pyjslib.max(pos, 0);
			pos = pyjslib.min(pos,  ( self.line.getWidth() - self.value.getWidth() ) );
			self.value.setPxStyle(String('left'), pos);
		}
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Scale));
})();
gtk.Scrollbar = (function(){
	var cls_instance = pyjs__class_instance('Scrollbar');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c1bcd0acc2cf51bdf351ead2aa3e9a6d';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;
		var up_arrow,down_arrow;
		gtk.Range.__init__(self, adjustment);
		self.down_arrow = gtk.browser.Element(String('div'));
		self.up_arrow = gtk.browser.Element(String('div'));
		down_arrow = self.down_arrow;
		up_arrow = self.up_arrow;
		down_arrow.setStyle(String('position'), String('absolute'));
		down_arrow.setPxStyle(String('height'), 15);
		down_arrow.setPxStyle(String('width'), 15);
		down_arrow.catchEvents(new pyjslib.List([String('click')]), self);
		up_arrow.setStyle(String('position'), String('absolute'));
		up_arrow.setPxStyle(String('height'), 15);
		up_arrow.setPxStyle(String('width'), 15);
		up_arrow.catchEvents(new pyjslib.List([String('click')]), self);
		self.line = gtk.browser.Element(String('div'));
		self.line.setStyle(String('position'), String('absolute'));
		self.line.setProperty(String('className'), String('scrollbar'));
		self.line.catchEvents(new pyjslib.List([String('click')]), self);
		self.cursor = gtk.browser.Element(String('div'));
		self.cursor.setStyle(String('position'), String('absolute'));
		self.cursor.setProperty(String('className'), String('scrollbar-cursor'));
		self.widget_cont.append(down_arrow);
		self.widget_cont.append(self.line);
		self.widget_cont.append(up_arrow);
		self.mouseover = false;
		self.cursor.catchEvents(new pyjslib.List([String('mousedown')]), self);
		self.value.setStyle(String('visibility'), String('hidden'));
		gtk.browser.Document.document.catchEvents(new pyjslib.List([String('mousemove')]), self);
		gtk.browser.Document.document.catchEvents(new pyjslib.List([String('mouseup')]), self);
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

 		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._move_cursor = pyjs__bind_method(cls_instance, '_move_cursor', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}

 		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		if (pyjslib.bool(pyjslib.eq(event.type, String('mousedown')))) {
			self.mouseover = true;
		}
		else if (pyjslib.bool((pyjslib.eq(event.type, String('mousemove'))) && (self.mouseover))) {
			self._move_cursor(event);
		}
		else if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			self._move_cursor(event);
		}
		else if (pyjslib.bool(pyjslib.eq(event.type, String('mouseup')))) {
			self.mouseover = false;
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Range));
})();
gtk.HScrollbar = (function(){
	var cls_instance = pyjs__class_instance('HScrollbar');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'f553aeeb92fc02b0aa2922b6e4e7b64a';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;

		gtk.Scrollbar.__init__(self, adjustment);
		self.down_arrow.setProperty(String('className'), String('scrollbar-left-arrow'));
		self.up_arrow.setProperty(String('className'), String('scrollbar-right-arrow'));
		self.line.setPxStyle(String('height'), 15);
		self.cursor.setPxStyle(String('height'), 13);
		self.line.append(self.cursor);
		self.minwidth = 60;
		self.minheight = 37;
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var cursor_size,top;
		gtk.Scrollbar._redraw(self);
		top =  (  ( self.widget_cont.getHeight() - self.line.getHeight() )  / 2 ) ;
		self.down_arrow.setPxStyle(String('top'), top);
		self.down_arrow.setPxStyle(String('left'), 0);
		self.line.setPxStyle(String('top'), top);
		self.line.setPxStyle(String('left'), self.down_arrow.getWidth());
		self.line.setPxStyle(String('width'),  (  (  ( self.widget_cont.getWidth() - 2 )  - self.down_arrow.getWidth() )  - self.up_arrow.getWidth() ) );
		self.up_arrow.setPxStyle(String('top'), top);
		self.up_arrow.setPxStyle(String('left'),  ( self.down_arrow.getWidth() + self.line.getWidth() ) );
		cursor_size =  (  (  ( self.widget_cont.getWidth() - 2 )  * self.adjustment.page_size )  / 100.0 ) ;
		cursor_size = pyjslib.max(cursor_size, 30);
		self.cursor.setPxStyle(String('width'), cursor_size);
		self._adjustment_value_changed();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._move_cursor = pyjs__bind_method(cls_instance, '_move_cursor', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var incr,old_value,pos,value,x;
		gtk.Scrollbar._move_cursor(self, event);
		pos =  ( event.clientX - self.line.getX() ) ;
		x =  ( pos -  ( self.cursor.getWidth() / 2 )  ) ;
		x = pyjslib.max(x, 0);
		x = pyjslib.min(x,  (  ( self.line.getWidth() - self.cursor.getWidth() )  - 2 ) );
		value =  (  ( x /  (  ( self.line.getWidth() - self.cursor.getWidth() )  - 2 )  )  *  ( self.adjustment.upper - self.adjustment.page_size )  ) ;
		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			old_value = self.adjustment.get_value();
			if (pyjslib.bool((pyjslib.cmp(pos, 0) == -1))) {
				incr = self.adjustment.step_incr;
				self.adjustment.set_value( ( old_value - incr ) );
			}
			else if (pyjslib.bool((pyjslib.cmp(pos, self.line.getWidth()) == 1))) {
				incr = self.adjustment.step_incr;
				self.adjustment.set_value( ( old_value + incr ) );
			}
			else {
				incr = self.adjustment.page_incr;
				if (pyjslib.bool((pyjslib.cmp(value, old_value) == 1))) {
					self.adjustment.set_value( ( old_value + incr ) );
				}
				else if (pyjslib.bool((pyjslib.cmp(value, old_value) == -1))) {
					self.adjustment.set_value( ( old_value - incr ) );
				}
			}
		}
		else {
			self.adjustment.set_value(value);
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var x,value;
		gtk.Scrollbar._adjustment_value_changed(self);
		value = self.adjustment.get_value();
		x =  (  (  ( value - self.adjustment.lower )  /  ( self.adjustment.upper - self.adjustment.page_size )  )  *  (  ( self.line.getWidth() - self.cursor.getWidth() )  - 2 )  ) ;
		self.cursor.setPxStyle(String('left'), x);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Scrollbar));
})();
gtk.VScrollbar = (function(){
	var cls_instance = pyjs__class_instance('VScrollbar');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'dbd7652cd36f50646dcc5007a48a54e2';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(adjustment) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			adjustment = arguments[1];
		}
		if (typeof adjustment == 'undefined') adjustment=null;

		gtk.Scrollbar.__init__(self, adjustment);
		self.down_arrow.setProperty(String('className'), String('scrollbar-down-arrow'));
		self.up_arrow.setProperty(String('className'), String('scrollbar-up-arrow'));
		self.line.setPxStyle(String('width'), 15);
		self.cursor.setPxStyle(String('width'), 13);
		self.line.append(self.cursor);
		self.minwidth = 30;
		self.minheight = 90;
		return null;
	}
	, 1, [null,null,'self', 'adjustment']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var cursor_size,left;
		gtk.Scrollbar._redraw(self);
		left =  (  ( self.widget_cont.getWidth() - self.line.getWidth() )  / 2 ) ;
		self.up_arrow.setPxStyle(String('left'), left);
		self.up_arrow.setPxStyle(String('top'), 0);
		self.line.setPxStyle(String('top'), self.up_arrow.getHeight());
		self.line.setPxStyle(String('left'), left);
		self.line.setPxStyle(String('height'),  (  (  ( self.widget_cont.getHeight() - 2 )  - self.up_arrow.getHeight() )  - self.down_arrow.getHeight() ) );
		self.down_arrow.setPxStyle(String('top'),  ( self.up_arrow.getHeight() + self.line.getHeight() ) );
		self.down_arrow.setPxStyle(String('left'), left);
		cursor_size =  (  (  ( self.widget_cont.getHeight() - 2 )  * self.adjustment.page_size )  / 100.0 ) ;
		cursor_size = pyjslib.max(cursor_size, 30);
		self.cursor.setPxStyle(String('height'), cursor_size);
		self._adjustment_value_changed();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._move_cursor = pyjs__bind_method(cls_instance, '_move_cursor', function(event) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
		}
		var incr,old_value,pos,value,y;
		gtk.Scrollbar._move_cursor(self, event);
		pos =  ( event.clientY - self.line.getY() ) ;
		y =  ( pos -  ( self.cursor.getHeight() / 2 )  ) ;
		y = pyjslib.max(y, 0);
		y = pyjslib.min(y,  (  ( self.line.getHeight() - self.cursor.getHeight() )  - 2 ) );
		value =  (  ( y /  (  ( self.line.getHeight() - self.cursor.getHeight() )  - 2 )  )  *  ( self.adjustment.upper - self.adjustment.page_size )  ) ;
		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			old_value = self.adjustment.get_value();
			if (pyjslib.bool((pyjslib.cmp(pos, 0) == -1))) {
				incr = self.adjustment.step_incr;
				self.adjustment.set_value( ( old_value - incr ) );
			}
			else if (pyjslib.bool((pyjslib.cmp(pos, self.line.getHeight()) == 1))) {
				incr = self.adjustment.step_incr;
				self.adjustment.set_value( ( old_value + incr ) );
			}
			else {
				incr = self.adjustment.page_incr;
				if (pyjslib.bool((pyjslib.cmp(value, old_value) == 1))) {
					self.adjustment.set_value( ( old_value + incr ) );
				}
				else if (pyjslib.bool((pyjslib.cmp(value, old_value) == -1))) {
					self.adjustment.set_value( ( old_value - incr ) );
				}
			}
		}
		else {
			self.adjustment.set_value(value);
		}
		return null;
	}
	, 1, [null,null,'self', 'event']);
	cls_definition._adjustment_value_changed = pyjs__bind_method(cls_instance, '_adjustment_value_changed', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var y,value;
		gtk.Scrollbar._adjustment_value_changed(self);
		value = self.adjustment.get_value();
		y =  (  (  ( value - self.adjustment.lower )  /  ( self.adjustment.upper - self.adjustment.page_size )  )  *  (  ( self.line.getHeight() - self.cursor.getHeight() )  - 2 )  ) ;
		self.cursor.setPxStyle(String('top'), y);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Scrollbar));
})();
gtk.OptionMenu = (function(){
	var cls_instance = pyjs__class_instance('OptionMenu');
	var cls_definition = new Object();
	cls_definition.__md5__ = '8a7039e48cd8f3f746bfd9ff4c4e33e7';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Button.__init__(self);
		self.ico = gtk.browser.Element(String('img'));
		self.ico.setProperty(String('src'), String('arr.png'));
		self.ico.setStyle(String('position'), String('absolute'));
		self.ico.setPxStyle(String('right'), 2);
		self.widget_int.append(self.ico);
		self.connect(String('clicked'), self._clicked, null);
		self.menu = null;
		self.menu_open = false;
		self.label = gtk.Label(String(''));
		self.label.set_alignment(0, 0.5);
		self.add(self.label);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var pad,rect;
		gtk.Button._redraw(self);
		rect = self.get_allocation();
		pad =  (  ( rect.height / 2 )  -  ( self.ico.getHeight() / 2 )  ) ;
		self.ico.setPxStyle(String('top'), pad);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._clicked = pyjs__bind_method(cls_instance, '_clicked', function(elem, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			elem = arguments[1];
			data = arguments[2];
		}
		if (typeof data == 'undefined') data=null;
		var rect;
		self.menu_open = !(self.menu_open);
		if (pyjslib.bool(!(self.menu._visible))) {
			rect = self.get_allocation();
			self.menu.widget_cont.setPxStyle(String('left'), rect.x);
			self.menu.widget_cont.setPxStyle(String('top'),  ( rect.y + rect.height ) );
			self.menu.show_all();
		}
		else {
			self.menu.hide_all();
		}
		return null;
	}
	, 1, [null,null,'self', 'elem', 'data']);
	cls_definition._selected = pyjs__bind_method(cls_instance, '_selected', function(elem, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			elem = arguments[1];
			data = arguments[2];
		}
		if (typeof data == 'undefined') data=null;
		var act;
		act = self.menu.get_active();
		if (pyjslib.bool((act !== null))) {
			self.label.set_text(act.label_cont);
		}
		return null;
	}
	, 1, [null,null,'self', 'elem', 'data']);
	cls_definition.set_menu = pyjs__bind_method(cls_instance, 'set_menu', function(menu) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			menu = arguments[1];
		}

		self.label.set_text(menu.items.__getitem__(0).label_cont);
		self.menu = menu;
		self.menu.connect(String('selection-done'), self._selected, null);
		return null;
	}
	, 1, [null,null,'self', 'menu']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Button));
})();
gtk.MenuShell = (function(){
	var cls_instance = pyjs__class_instance('MenuShell');
	var cls_definition = new Object();
	cls_definition.__md5__ = '413aab081f3b45003be6c548dbc1af28';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var container;
		gtk.Container.__init__(self);
		self.items = new pyjslib.List([]);
		container = self.widget_cont;
		container.setStyle(String('border'), String('1px solid gray'));
		container.setStyle(String('position'), String('absolute'));
		container.setStyle(String('width'), String('auto'));
		container.setStyle(String('height'), String(''));
		container.setStyle(String('left'), String(''));
		container.setStyle(String('right'), String(''));
		container.setStyle(String('bottom'), String(''));
		container.setStyle(String('top'), String(''));
		container.setStyle(String('zIndex'), String('100'));
		gtk.widget_int.setStyle(String('position'), String('absolute'));
		self.widget_int = self.widget_cont;
		container.setProperty(String('className'), String('menushell'));
		self.hide();
		gtk.browser.Document.append(self.widget_cont);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.append = pyjs__bind_method(cls_instance, 'append', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		child.hide();
		child.connect(String('select'), self._selected, null);
		self.items.append(child);
		self.add(child);
		return null;
	}
	, 1, [null,null,'self', 'child']);
	cls_definition._selected = pyjs__bind_method(cls_instance, '_selected', function(elem, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			elem = arguments[1];
			data = arguments[2];
		}
		if (typeof data == 'undefined') data=null;

		self.emit(String('selection-done'));
		self.hide_all();
		return null;
	}
	, 1, [null,null,'self', 'elem', 'data']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}
		var child;
		gtk.Container._redraw(self);
		var __child = self.children.__iter__();
		try {
			while (true) {
				var child = __child.next();
				
				self.minwidth = pyjslib.max(self.minwidth, child.minwidth);
				self.minheight += child.minheight;
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		self.widget_cont.setPxStyle(String('minHeight'), self.minheight);
		self.widget_cont.setPxStyle(String('minWidth'), self.minwidth);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Container));
})();
gtk.Menu = (function(){
	var cls_instance = pyjs__class_instance('Menu');
	var cls_definition = new Object();
	cls_definition.__md5__ = 'c71f42ca712eef1ddd7d51077582f0ff';
	cls_definition.append = pyjs__bind_method(cls_instance, 'append', function(child) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			child = arguments[1];
		}

		child.connect(String('select'), self._catch_active, null);
		gtk.MenuShell.append(self, child);
		self._active = null;
		return null;
	}
	, 1, [null,null,'self', 'child']);
	cls_definition._catch_active = pyjs__bind_method(cls_instance, '_catch_active', function(elem, data) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			elem = arguments[1];
			data = arguments[2];
		}
		if (typeof data == 'undefined') data=null;

		self._active = elem;
		return null;
	}
	, 1, [null,null,'self', 'elem', 'data']);
	cls_definition.get_active = pyjs__bind_method(cls_instance, 'get_active', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self._active;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.MenuShell));
})();
gtk.Item = (function(){
	var cls_instance = pyjs__class_instance('Item');
	var cls_definition = new Object();
	cls_definition.__md5__ = '033a6128143abaff60aecaf7394a0c64';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(name) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			name = arguments[1];
		}
		var container;
		gtk.Bin.__init__(self);
		self.label_cont = name;
		container = self.widget_cont;
		container.catchEvents(new pyjslib.List([String('click')]), self);
		container.setStyle(String('position'), String(''));
		container.setStyle(String('width'), String('100%'));
		container.setStyle(String('bottom'), String(''));
		container.setStyle(String('top'), String(''));
		self.widget_int.setStyle(String('position'), String('absolute'));
		self.widget_int = self.widget_cont;
		container.setProperty(String('className'), String('menuitem'));
		self.content = gtk.Label(name);
		self.content.hide();
		self.add(self.content);
		return null;
	}
	, 1, [null,null,'self', 'name']);
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			self.emit(String('select'));
			self.emit(String('toggle'));
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	cls_definition.show = pyjs__bind_method(cls_instance, 'show', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Bin.show(self);
		self.content.show();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.hide = pyjs__bind_method(cls_instance, 'hide', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Bin.hide(self);
		self.content.hide();
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition._redraw = pyjs__bind_method(cls_instance, '_redraw', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		gtk.Bin._redraw(self);
		self.widget_cont.setPercentStyle(String('width'), 100);
		return null;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Bin));
})();
gtk.MenuItem = (function(){
	var cls_instance = pyjs__class_instance('MenuItem');
	var cls_definition = new Object();
	cls_definition.__md5__ = '4e99de8cfb245fc3dc5252a8f6efd3d1';
	cls_definition.dom_event = pyjs__bind_method(cls_instance, 'dom_event', function(event, element) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			event = arguments[1];
			element = arguments[2];
		}

		gtk.Item.dom_event(self, event, element);
		if (pyjslib.bool(pyjslib.eq(event.type, String('click')))) {
			self.emit(String('activate'));
		}
		return null;
	}
	, 1, [null,null,'self', 'event', 'element']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(gtk.Item));
})();
gtk.gtkbuildermap = new pyjslib.Dict([[String('GtkWindow'), gtk.Window], [String('GtkTable'), gtk.Table], [String('GtkLabel'), gtk.Label], [String('GtkVBox'), gtk.VBox], [String('GtkHBox'), gtk.HBox], [String('GtkEntry'), gtk.Entry]]);
gtk.find_props = function(node) {
	var name,i,res,n,props;
	res = new pyjslib.Dict([]);
	if (pyjslib.bool(!(node))) {
		return new pyjslib.Dict([]);
	}
	props = node.getElementsByTagName(String('property'));
	var __i = pyjslib.range(props.length).__iter__();
	try {
		while (true) {
			var i = __i.next();
			
			n = props.item(n);
			name = n.attributes.getNamedItem(String('name')).nodeValue;
			gtk.log.write(String('find_props '));
			gtk.log.write(name);
			gtk.log.write(String(' '));
			gtk.log.write(n.textContent);
			gtk.log.writebr(String(''));
			res.__setitem__(name, n.textContent);
		}
	} catch (e) {
		if (e.__name__ != 'StopIteration') {
			throw e;
		}
	}
	return res;
};
gtk.find_props.__name__ = 'find_props';

gtk.find_props.__bind_type__ = 0;
gtk.find_props.__args__ = [null,null,'node'];
gtk.BuilderETree = (function(){
	var cls_instance = pyjs__class_instance('BuilderETree');
	var cls_definition = new Object();
	cls_definition.__md5__ = '4b5182ff5c9a8c0ff2f5a31bf70b71d0';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.objects = new pyjslib.List([]);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.create_object_from_xml_node = pyjs__bind_method(cls_instance, 'create_object_from_xml_node', function(node) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			node = arguments[1];
		}
		var temp_prop,obj,name,err,props,value,prop,pyjs_try_err,child,childobj,klsname,id,childnode;
		klsname = node.attrib.__getitem__(String('class'));
		id = node.attrib.__getitem__(String('id'));
		obj = gtk.gtkmap.__getitem__(klsname)();
		var __prop = node.findall(String('property')).__iter__();
		try {
			while (true) {
				var prop = __prop.next();
				
				name = prop.attrib.__getitem__(String('name'));
				value = prop.textContent;
				try {
					pyjslib.setattr(obj.props, name, value);
				} catch(pyjs_try_err) {
					var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
					$pyjs.__last_exception__ = {error: pyjs_try_err, module: gtk, try_lineno: 1289};
					{
						$pyjs.__last_exception__.except_lineno = 1294;
						err = pyjs_try_err;
						if (pyjslib.bool(value.isdigit())) {
							pyjslib.setattr(obj.props, name, pyjslib.int(value));
						}
						else {
						}
					} 				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		var __childnode = node.findall(String('child')).__iter__();
		try {
			while (true) {
				var childnode = __childnode.next();
				
				childobj = childnode.find(String('object'));
				if (pyjslib.bool((childobj === null))) {
					continue;
				}
				child = self.create_object_from_xml_node(childobj);
				obj.add_child(gtk.Builder(), child, klsname);
				props = gtk.find_props(childnode.find(String('packing')));
				var __temp_prop = props.items().__iter__();
				try {
					while (true) {
						var temp_prop = __temp_prop.next();
										var prop = temp_prop.__getitem__(0);				var value = temp_prop.__getitem__(1);
						if (pyjslib.bool(value.isdigit())) {
							value = pyjslib.int(value);
						}
						obj.child_set_property(child, prop, value);
					}
				} catch (e) {
					if (e.__name__ != 'StopIteration') {
						throw e;
					}
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return obj;
	}
	, 1, [null,null,'self', 'node']);
	cls_definition.add_from_file = pyjs__bind_method(cls_instance, 'add_from_file', function(fname) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			fname = arguments[1];
		}
		var s;
		s = gtk.open(fname).read();
		return s.add_from_string(s);
	}
	, 1, [null,null,'self', 'fname']);
	cls_definition.add_from_string = pyjs__bind_method(cls_instance, 'add_from_string', function(f) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			f = arguments[1];
		}
		var obj,doc,s,x;
		s = gtk.open(gtk.fname).read();
		doc = gtk.lxml.etree.fromstring(s);
		var __x = doc.__iter__();
		try {
			while (true) {
				var x = __x.next();
				
				if (pyjslib.bool((x.tag != String('object')))) {
					continue;
				}
				obj = self.create_object_from_xml_node(x);
				self.objects.append(obj);
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return null;
	}
	, 1, [null,null,'self', 'f']);
	cls_definition.get_objects = pyjs__bind_method(cls_instance, 'get_objects', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.objects;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
gtk.gtkmap = new pyjslib.Dict([[String('GtkWindow'), gtk.Window], [String('GtkTable'), gtk.Table], [String('GtkLabel'), gtk.Label], [String('GtkVBox'), gtk.VBox], [String('GtkHBox'), gtk.HBox], [String('GtkEntry'), gtk.Entry]]);
gtk.Builder = (function(){
	var cls_instance = pyjs__class_instance('Builder');
	var cls_definition = new Object();
	cls_definition.__md5__ = '6dc8a640f252322c6f9fd264ffc13dc1';
	cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		self.objects = new pyjslib.List([]);
		return null;
	}
	, 1, [null,null,'self']);
	cls_definition.create_object_from_xml_node = pyjs__bind_method(cls_instance, 'create_object_from_xml_node', function(node) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			node = arguments[1];
		}
		var temp_prop,obj,name,err,i,child,value,prop,packing,pyjs_try_err,props,childobj,klsname,childnodes,id,childnode;
		klsname = node.attributes.getNamedItem(String('class')).nodeValue;
		id = node.attributes.getNamedItem(String('id')).nodeValue;
		gtk.log.writebr(pyjslib.sprintf(String('%s %s'), new pyjslib.Tuple([klsname, id])));
		obj = gtk.gtkmap.__getitem__(klsname)();
		props = node.getElementsByTagName(String('property'));
		gtk.log.writebr(pyjslib.sprintf(String('%s %d'), new pyjslib.Tuple([klsname, props.length])));
		var __i = pyjslib.range(props.length).__iter__();
		try {
			while (true) {
				var i = __i.next();
				
				prop = props.item(i);
				name = prop.attributes.getNamedItem(String('name')).nodeValue;
				value = prop.textContent;
				try {
					pyjslib.setattr(obj, name, value);
				} catch(pyjs_try_err) {
					var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
					$pyjs.__last_exception__ = {error: pyjs_try_err, module: gtk, try_lineno: 1354};
					{
						$pyjs.__last_exception__.except_lineno = 1358;
						err = pyjs_try_err;
						if (pyjslib.bool((value) && (value.isdigit()))) {
							pyjslib.setattr(obj, name, pyjslib.int(value));
						}
						else {
						}
					} 				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		childnodes = node.getElementsByTagName(String('child'));
		gtk.log.writebr(pyjslib.sprintf(String('%s children %d'), new pyjslib.Tuple([klsname, childnodes.length])));
		var __i = pyjslib.range(childnodes.length).__iter__();
		try {
			while (true) {
				var i = __i.next();
				
				childnode = childnodes.item(i);
				childobj = childnode.getElementsByTagName(String('object'));
				if (pyjslib.bool((childobj === null))) {
					continue;
				}
				if (pyjslib.bool(pyjslib.eq(childobj.length, 0))) {
					continue;
				}
				childobj = childobj.item(0);
				child = self.create_object_from_xml_node(childobj);
				obj.add(child);
				packing = childnode.getElementsByTagName(String('packing'));
				if (pyjslib.bool((packing === null))) {
					continue;
				}
				if (pyjslib.bool(pyjslib.eq(packing.length, 0))) {
					continue;
				}
				packing = packing.item(0);
				props = gtk.find_props(packing);
				var __temp_prop = props.items().__iter__();
				try {
					while (true) {
						var temp_prop = __temp_prop.next();
										var prop = temp_prop.__getitem__(0);				var value = temp_prop.__getitem__(1);
						if (pyjslib.bool(value.isdigit())) {
							value = pyjslib.int(value);
						}
						obj.child_set_property(child, prop, value);
					}
				} catch (e) {
					if (e.__name__ != 'StopIteration') {
						throw e;
					}
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		return obj;
	}
	, 1, [null,null,'self', 'node']);
	cls_definition.add_from_file = pyjs__bind_method(cls_instance, 'add_from_file', function(fname) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			fname = arguments[1];
		}
		var pyjs_try_err,fobj,s;
		fobj = gtk.open(fname);
		try {
			s = fobj.read();
		} catch(pyjs_try_err) {
			var pyjs_try_err_name = (typeof pyjs_try_err.__name__ == 'undefined' ? pyjs_try_err.name : pyjs_try_err.__name__ );
			$pyjs.__last_exception__ = {error: pyjs_try_err, module: gtk, try_lineno: 1390};
		} finally {
			fobj.close();
		}
		return s.add_from_string(s);
	}
	, 1, [null,null,'self', 'fname']);
	cls_definition.add_from_string = pyjs__bind_method(cls_instance, 'add_from_string', function(xmldoc) {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
			xmldoc = arguments[1];
		}
		var x,obj;
		x = xmldoc.firstChild.firstChild;
    while (pyjslib.bool(x)) {
		gtk.log.writebr(x.nodeName);
		if (pyjslib.bool(pyjslib.eq(x.nodeName, String('object')))) {
			gtk.log.writebr(String('creating object'));
			obj = self.create_object_from_xml_node(x);
			self.objects.append(obj);
		}
		x = x.nextSibling;
    }
		return null;
	}
	, 1, [null,null,'self', 'xmldoc']);
	cls_definition.get_objects = pyjs__bind_method(cls_instance, 'get_objects', function() {
		if (this.__is_instance__ === true) {
			var self = this;
		} else {
			var self = arguments[0];
		}

		return self.objects;
	}
	, 1, [null,null,'self']);
	return pyjs__class_function(cls_instance, cls_definition, 
	                            new Array(pyjslib.object));
})();
gtk.main = function() {

 	return null;
};
gtk.main.__name__ = 'main';

gtk.main.__bind_type__ = 0;
gtk.main.__args__ = [null,null,];
gtk.main_quit = function() {

	gtk.browser.Document.setContent(String('This application has finalized !'));
	return null;
};
gtk.main_quit.__name__ = 'main_quit';

gtk.main_quit.__bind_type__ = 0;
gtk.main_quit.__args__ = [null,null,];
return this;
}; /* end gtk */
$pyjs.modules_hash['gtk'] = $pyjs.loaded_modules['gtk'];


 /* end module: gtk */


/*
PYJS_DEPS: ['pyjamas.log', 'pyjamas', 'browser', 'gdk']
*/
