6

For example, there is a on-char method on the editor-canvas% class in racket/gui/base. It handles the 'wheel-up and 'wheel-down events and passes other events to the on-char method on canvas%.

I would like to view the source code and see how it does that.

I wish there are some tools like the Ruby API documentation, but now I do not even know where the source code of racket/gui/base is.

Array#each

2 Answers 2

8

In DrRacket IDE you can hover over every imported symbol and right click. In the menu you have "Open defining file". After clicking on this you right click over the same symbol again and look where you clicked last time you'll see it says "Jump to definition (in other file)".

Note that in the same menu you also have "View documentation for symbol from packet" which opens a browser with the documentation.

Sign up to request clarification or add additional context in comments.

Comments

8

In DrRacket click the "Check Syntax" button (the one with the blue check mark and the magnifying glass). Then right click the identifier in question (here on-char) and choose the menu item "Open Defining File". This will open the file in which on-char is defined.

1 Comment

As a bonus tip: For most builting package, you can find the source at github.com/racket/PACKAGE. In this case, see: github.com/racket/gui

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.