Creating and adding a Listener

Ty Tower tytower at hotmail.com.au
Sat Mar 1 17:11:01 PST 2008


    Listener listener = new Listener () ;
      table.addListener (DWT.SetData, new Listener());

The compiler tells me it cannot create an instance of Listener, so how do I get say a mouse listener into a table?

In passing something from the examples given in the code will not compile either as it dislikes the "blocks" and "public"

void addTextListener(Text text) {
           text.addModifyListener(new class(text) ModifyListener {
               char[][] values;
                Text text;
               this( Text text ){ this.text = text; }
                  public void modifyText(ModifyEvent e){
                    Integer index = cast(Integer)(this.text.getData("index"));
                     values[index.intValue()] = this.text.getText();} });}


More information about the Digitalmars-d-learn mailing list