Hi Luke,

On Thu, Aug 3, 2017 at 11:25 AM, Luke Gorrie <luke@snabb.co> wrote:
I have built an application based on the GTInspector. Hurray!

Looks really nice!
 

Now I want to share it and I need to write documentation. I would like to include screenshots in the docs but I don't want to create them by hand.

So my question is: Is there an easy way to automatically generate screenshots for GTInspector extension methods? e.g. to specify an object and the name of a presentation and to get a PNG file of how that looks in the GTInspector.

To add to Juraj's email you can use something like the following:


inspectorWindow := GTInspector inspector: Morph new. 
inspector := inspectorWindow model. 

inspectorsPresentations := inspector panes first presentations first cachedPresentation first.
inspectorsPresentations pane lastActivePresentation: (inspectorsPresentations presentations detect: [ :each|
each title = 'Morph']).

morph := inspectorWindow.
"morph exportAsPNG."
file :=  Smalltalk imageDirectory / morph externalName, '.png'.
PNGReadWriter putForm: morph imageForm onFileNamed: file.

inspectorWindow close.


This opens an inspector, selects a certain presentation based on its title and then exports the entire inspector window as a png.
If you want to export only certain parts of the inspector you can play with Morph>>#allMorphsDo: to locate within the inspector window for example only the morph showing a certain presentation.
 

Thanks!

P.S. References to how other people write their docs in general would be interesting.

I usually use pillar :). There are several extension for the inspector that you can use to edit pilar documents.
 

P.P.S. Here is GTInspector browsing internal data structures of a JIT compiler :-)

Quite nice!

Cheers,
Andrei 



_______________________________________________
Moose-dev mailing list
Moose-dev@list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev