简体   繁体   中英

How do I open the class browser with a specific class?

Amber Smalltalk version 0.13

In this project I'd like to open the class browser with a specific class.

  <button onClick="amber.globals.Browser._openOn_(amber.globals.ProcessingClock)">ProcessingClock class

I get the error message amber not defined (see screen shot below).

Question How do I open the browser properly?

在此处输入图片说明

Of course it is not defined, amber is just a local variable (that is, a parameter) of the loader callback function. Either remember it to some global and reuse in button onclick code (ugly), install onclick handler on the button directly inside loader callback, where you have access to amber variable (probably clumsy, but the most clean), or use require('amber/helpers') instead of amber in direct onclick handlers (in your example you want need to use it twice).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM