Wednesday, July 20, 2005

Thanks to a few sentences worth of help from robert ginda on #mozilla, and tons of walking thru mozilla breakpoints to see how XUL wires up command handlers and executes them, clicking a button now results in the following output:


2005-07-20 20:30:14.653 layout[22453] Help! I've been clicked!
Button::ButtonPressed success
Button::ButtonPressed. return is a number
Button::ButtonPressed. return is an int
Button::ButtonPressed. return is a primitive
Button::ButtonPressed return is 17


The JS is:


function Button1Click()
{
return 17;
}


So, what's the big deal? My layout engine is calling onclick handlers for button elements, that's what!

So, as a next step, I need to see if I can create an object that interfaces to C++ and provides logging services. Dumping output to stderr should be good enough. That way, I can write something like this:


function Button1Click()
{
logger.print("Button1Click: value is %d\n", 17);
return 17;
}


Fun stuff :-)

0 Comments:

Post a Comment

<< Home