embedding images inside Playground
Hi, is it possible to somehow embed images (Form) inside Playground? The use case is a kind of in-image help or guide where one could also execute code, but there would be also example images. Or maybe have a container Morph that would contain Playground? Is that possible? Thanks, Peter
Hi,
On Feb 21, 2016, at 12:06 AM, Peter Uhnák <i.uhnak@gmail.com> wrote:
Hi,
is it possible to somehow embed images (Form) inside Playground?
The use case is a kind of in-image help or guide where one could also execute code, but there would be also example images.
This is not yet possible, but it is intended to move in that direction.
Or maybe have a container Morph that would contain Playground? Is that possible?
Intriguing idea. Could you elaborate on this? Cheers, Doru
Thanks, Peter
-- www.tudorgirba.com www.feenk.com "Every thing has its own flow."
On Sun, Feb 21, 2016 at 12:15 AM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
On Feb 21, 2016, at 12:06 AM, Peter Uhnák <i.uhnak@gmail.com> wrote:
Hi,
is it possible to somehow embed images (Form) inside Playground?
The use case is a kind of in-image help or guide where one could also execute code, but there would be also example images.
This is not yet possible, but it is intended to move in that direction.
Or maybe have a container Morph that would contain Playground? Is that possible?
Intriguing idea. Could you elaborate on this?
Well the idea is rather simple. Imagine that instead of having a website or a book or a pdf somewhere you would have a more live version directly in the image that you could interact with. An extremely crude example: â Creating something like that is currently quite awful: ``` window := SystemWindow new. window addMorph: (RubScrolledTextMorph new beWrapped; yourself) frame: (0@0 corner: 1@0.2). window addMorph: (SpecWindow allInstances detect: [ :each | each identityHash = 330624768 ]) frame: (0@0.2 corner: 1@0.4). window addMorph: (RubScrolledTextMorph new beWrapped; beForSmalltalkScripting; yourself) frame: (0@0.4 corner: 1@0.6). '/tmp/pharo.png' asFileReference binaryReadStreamDo: [ :stream | window addMorph: (PNGReadWriter formFromStream: stream) asMorph frame: (0@0.6 corner: 1 @0.8) ]. window addMorph: (RubScrolledTextMorph new beWrapped; beForSmalltalkScripting; yourself) frame: (0@0.8 corner: 1@1). window submorphs second push. window openInWorld. ``` Also I've just realized that on ESUG someone (Andrei I think) was showing something like this running on Bloc⦠but I have no memory what it was called. Peter
Hi, Ok. Indeed, what you are describing is what we call Snippets. We would like the Playground to be formed of Snippets, where each Snippet can be of different types (one of them is a picture). We had indeed a prototype that was demoed at ESUG. This will have to be redone once Bloc becomes more stable. This will not be immediate, but this is an important goal for us. Cheers, Doru
On Feb 21, 2016, at 12:55 AM, Peter Uhnák <i.uhnak@gmail.com> wrote:
On Sun, Feb 21, 2016 at 12:15 AM, Tudor Girba <tudor@tudorgirba.com> wrote: Hi,
On Feb 21, 2016, at 12:06 AM, Peter Uhnák <i.uhnak@gmail.com> wrote:
Hi,
is it possible to somehow embed images (Form) inside Playground?
The use case is a kind of in-image help or guide where one could also execute code, but there would be also example images.
This is not yet possible, but it is intended to move in that direction.
Or maybe have a container Morph that would contain Playground? Is that possible?
Intriguing idea. Could you elaborate on this?
Well the idea is rather simple. Imagine that instead of having a website or a book or a pdf somewhere you would have a more live version directly in the image that you could interact with.
An extremely crude example: <pharo.png> â
Creating something like that is currently quite awful:
``` window := SystemWindow new.
window addMorph: (RubScrolledTextMorph new beWrapped; yourself) frame: (0@0 corner: 1@0.2).
window addMorph: (SpecWindow allInstances detect: [ :each | each identityHash = 330624768 ]) frame: (0@0.2 corner: 1@0.4).
window addMorph: (RubScrolledTextMorph new beWrapped; beForSmalltalkScripting; yourself) frame: (0@0.4 corner: 1@0.6).
'/tmp/pharo.png' asFileReference binaryReadStreamDo: [ :stream | window addMorph: (PNGReadWriter formFromStream: stream) asMorph frame: (0@0.6 corner: 1 @0.8) ].
window addMorph: (RubScrolledTextMorph new beWrapped; beForSmalltalkScripting; yourself) frame: (0@0.8 corner: 1@1).
window submorphs second push.
window openInWorld. ```
Also I've just realized that on ESUG someone (Andrei I think) was showing something like this running on Bloc⦠but I have no memory what it was called.
Peter
-- www.tudorgirba.com www.feenk.com "To utilize feedback, you first have to acquire it."
Hi Peter and Doru,
On Feb 21, 2016, at 12:55 AM, Peter Uhnák <i.uhnak@gmail.com> wrote:
[...]
Well the idea is rather simple. Imagine that instead of having a website or a book or a pdf somewhere you would have a more live version directly in the image that you could interact with.
The idea of grafoscopio's[1] interactive notebook is precisely that one. Documents are trees, but instead of being represented in HTML or XML or LaTeX, they live directly inside the image and nodes in that tree have two main forms: text and code. Textual node are edited in a light markup language (pandoc's markdown) and can include references to another media (images, html embed snippets and so on) and code nodes are interactive playgrounds with all their benefits. The tree can be used to structure the writing by imposing/emerging hierarchy on it: chapters, examples, main ideas inside a text, and so on, with the use of tags that tell the tree how each node will be treated. Trees can be exported to several formats, including markdown, LaTeX, HTML and pdf (vÃa LaTeX). [1] http://mutabit.com/grafoscopio/index.en.html Because grafoscopio is also a self-learning exercise, is full of rookie code and incomplete functionality, but hopefully it will get better with my upcoming internship. It's taught and evolved mainly in a community event called data week and the next week we will start our third edition [2], so I hope also to get some boots in functionality soon and share it back with the community. [2] http://mutabit.com/dataweek/ On 21/02/16 02:28, Tudor Girba wrote:
Hi,
Ok. Indeed, what you are describing is what we call Snippets. We would like the Playground to be formed of Snippets, where each Snippet can be of different types (one of them is a picture). We had indeed a prototype that was demoed at ESUG. This will have to be redone once Bloc becomes more stable. This will not be immediate, but this is an important goal for us.
Nice to know! There is some intended date for this? Cheers, Offray
If you just want to execute code (similar to the old Workspace) then you can just use Rubric. | textMorph | textMorph := RubScrolledTextMorph new newScrolledText. textMorph beWrapped; beForSmalltalkScripting. textMorph openInWindow extent: 432@432. Best regards, Henrik From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Peter Uhnák Sent: Sunday, February 21, 2016 12:07 AM To: Pharo Users List <pharo-users@lists.pharo.org> Subject: [Pharo-users] embedding images inside Playground Hi, is it possible to somehow embed images (Form) inside Playground? The use case is a kind of in-image help or guide where one could also execute code, but there would be also example images. Or maybe have a container Morph that would contain Playground? Is that possible? Thanks, Peter
2016-02-21 0:06 GMT+01:00 Peter Uhnák <i.uhnak@gmail.com>:
Hi,
is it possible to somehow embed images (Form) inside Playground?
With good old PluggableTextMorph and Text you can just call #asText on a Morph and add it to the text of the TextMorph: |text block| block := [ PolymorphSystemSettings pharoLogo asText, String cr,ProfStef pharoZenValuesContents ]. text:=(Smalltalk ui theme builder newBasicTextEditorFor: block getText: #value setText: nil). text openInWindow. Offray did some work on combining spec trees with GT-Playground, to build some kind of workbook with code and text.
The use case is a kind of in-image help or guide where one could also execute code, but there would be also example images.
Or maybe have a container Morph that would contain Playground? Is that possible?
Thanks, Peter
Hi, On 21/02/16 07:19, Nicolai Hess wrote:
2016-02-21 0:06 GMT+01:00 Peter Uhnák <i.uhnak@gmail.com <mailto:i.uhnak@gmail.com>>:
Hi,
is it possible to somehow embed images (Form) inside Playground?
With good old PluggableTextMorph and Text you can just call #asText on a Morph and add it to the text of the TextMorph:
|text block| block := [ PolymorphSystemSettings pharoLogo asText, String cr,ProfStef pharoZenValuesContents ]. text:=(Smalltalk ui theme builder newBasicTextEditorFor: block getText: #value setText: nil). text openInWindow.
Offray did some work on combining spec trees with GT-Playground, to build some kind of workbook with code and text.
Yes, with a lot of help from the community (thanks again!). I have pointed to it as a reply in this thread. The upcoming data week local event will boosts some support for collaboration via Fossil SCM, SQLite integration, easy installation via Pharo Catalog and increase our gallery of data visualization approached themes/templates this time aligned with some efforts on Open Spending / Open Budget[1][2]. Our last exploration was using this tool for supporting open research in visualizing medicine public data released by governments[3] [1] https://openspending.org/ [2] http://openbudgets.eu/ [3] http://mutabit.com/offray/blog/en/entry/sdv-infomed I'll keep you informed on our advances and issues. Cheers, Offray
participants (5)
-
Henrik Nergaard -
Nicolai Hess -
Offray Vladimir Luna Cárdenas -
Peter Uhnák -
Tudor Girba