[Geany] First haxe script

blackdog blackdog at xxxxx
Tue Jul 31 02:10:53 UTC 2007


You may be interested in this one too. This runs from the Geany neko
plugin too, this uses my hxGtk library (a WIP), I'm not actually
calling back to Geany here but an import Geany as in the last example
would do it.

import gtk.Gtk;
import gtk.Window;
import gtk.VBox;
import gtk.HBox;
import gtk.Button;
import gtk.Entry;
import gtk.Label;
import gtk.Event;

class HxDev {

	public static function main() {
		trace("initialising HxDev module");
	}
	
	public function new() {		
		var win = new Window(TOPLEVEL);
		var vbox = new VBox(false,2);
		win.add(vbox);
		var entry = new Entry();
		var label = new Label("HAXE_LIBRARY_PATH");
		var apply = new Button("Apply");
		var hbox1 = new HBox(true,2);
		neko.Lib.print("created ok\n");
		hbox1.add(label);
		hbox1.add(entry);
		vbox.add(hbox1);
		vbox.add(apply);
		neko.Lib.print("added ok\n");
		win.showAll();
		neko.Lib.print("showed ok\n");
		
		apply.connect(Event.clicked(function(o) {
			var t = entry.text;
			untyped__dollar__loader.hxSetHaxeLibraryPath(t); }));
		trace("got here too");
	}
}


-- 
http://www.blackdog-haxe.com/

"It is no measure of health to be well adjusted to a profoundly sick
society." --Jiddu Krishnamurti


On Mon, 30 Jul 2007 22:02:13 -0400
blackdog <blackdog at ipowerhouse.com> wrote:

> 
> Not much of a test but it works!
> 
> import Geany;
> 
> class Tests {
> 	static function main(){
> 		trace("intialising tests - this");
> 	}
> 	
> 	public function new() {
> 		var doc = Geany.create("nice",null);
> 		var intext = "woohoo\n";
> 		doc.setText(intext);	
> 		for (i in 0...5) {
> 			var pos = doc.getPosition();
> 			doc.insertText(pos,"new text "+i+"\n");
> 			pos = doc.getLength();
> 			doc.insertText(pos,"new length is:"+pos+"\n");
> 		}
> 	}
> }
> 
> 


-- 
http://www.blackdog-haxe.com/

"It is no measure of health to be well adjusted to a profoundly sick
society." --Jiddu Krishnamurti


-- 
http://www.blackdog-haxe.com/

"It is no measure of health to be well adjusted to a profoundly sick
society." --Jiddu Krishnamurti



More information about the Users mailing list