Listener output
Bill Baxter
dnewsgroup at billbaxter.com
Fri Apr 18 18:24:59 PDT 2008
Barry Denton wrote:
> I have a Listener added to a button as so :-
>
> button.addListener(DWT.Selection, new class Listener {
> void handleEvent(Event event) {
> itemWords [5] = "item has changed " ;//~ System.currentTimeMillis();
> minitable.clear(5); } });
>
> When pressed the button outputs this:-
>
> Event {missing or misplaced '}'}Event {type=13 Button {Change item} time=1679601378 data={null} x=0 y=0 width=0 height=0 detail=0}
> .
> Now all is as it should be except for the {missing or misplaced '}'}
That's a Tango thing. Functions like formatln must have all '{' chars
escaped in the format string. So you or DWT are using a tango string
formatter somewhere you or DWT should probably not be. It should be
print() instead. Yet another reason I don't love Tango for output.
> 1/ Can anybody see why I get this message?
>
> Also "System.currentTimeMillis()"is a C style request .
Looks more Java-style to me...
> 2/ is there a similar request in D for a Linux machine?
probably something in tango.time.Time.
How about this: tango.time.Time.Clock.now.time?
And if that doesn't work stick a few extra .time's .clock's or .now's on
the end and see if it does. ;-)
--bb
More information about the Digitalmars-d-learn
mailing list