attribute long type;
attribute long x;
attribute long y;
};
void source(in string file);
void eval(in string command);
string result();
widget root();
};
string path();
void eval( in string cmd );
void configure( in string options );
void pack( in string options );
};
long length();
Object first();
Object next();
Object current();
iterator walk();
};
hush::kit kit(in string name);
hush::event event(in long type);
};
hush::kit kit(in string name);
hush::container container(in string name);
hush::iterator iterator(in string name);
hush::factory hush(in string name);
};
canvas create( in hush::widget anc, in string path );
hush::item circle( in long x, in long y, in long radius, in string options );
// other items ...
};
interface message : hush::widget {
message create( in hush::widget anc, in string path );
void text(in string txt);
};
interface factory : hush::factory {
widgets::canvas canvas(in string name, in string options);
widgets::message message(in string name, in string options);
};
interface dot : hush::dot {
widgets::canvas canvas(in string name);
widgets::message message(in string name);
widgets::factory widgets(in string name);
};
};
public:
draw_srv( const widget* w, char* path ) : canvas(w,path) {
geometry(200,100);
self()->bind(this);
dragging = 0;
}
void press( event& ) { dragging = 1; }
void motion( event& e) {
if (dragging) circle(e.x(),e.y(),10,"-fill black");
}
void release( event& ) { dragging = 0; }
protected:
int dragging;
};