Help: pluggable widgets for forms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Help: pluggable widgets for forms

K K Subbu
All,

I am trying to develop a tool to view a form within a window frame. All
existing pluggable widgets seem to handle string/text only.

Are there any pluggable widgets and spec that deal with forms or images
(much larger than a icon or thumbnail)?

Thanks and Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

Karl Ramberg
I'm not sure what you try to do here.
In morphic you usually use SketchMorph or ImageMorph
Any morph can be sent 'openInWindow'
So open the form:
(ImageMorph new image:myForm) openInWindow
(SketchMorph withForm:myForm) openInWindow

Best,
Karl


On Fri, Jun 5, 2020 at 4:53 PM K K Subbu <[hidden email]> wrote:
All,

I am trying to develop a tool to view a form within a window frame. All
existing pluggable widgets seem to handle string/text only.

Are there any pluggable widgets and spec that deal with forms or images
(much larger than a icon or thumbnail)?

Thanks and Regards .. Subbu



Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

timrowledge


> On 2020-06-05, at 8:16 AM, karl ramberg <[hidden email]> wrote:
>
> I'm not sure what you try to do here.
> In morphic you usually use SketchMorph or ImageMorph

I suspect that Subbu is looking for sometihng in the toolbuilder world; and it correct that there isn't anything therein. ToolBuilder is pretty much solely set up to make the basic programming tools right now.

It *shouldn't* be too hard to add a bitmap viewing pane to the system. I like to hope, anyway...


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
I'd kill for a Nobel Peace Prize.



Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

Christoph Thiede

I have experimented with a number of approaches in the past:


  • Read-only PluggableTextSpec with a text with a TextAnchor to an ImageMorph
  • Read-only PluggableTextSpec with a text with a TextFontReference to a FormSetFont
  • PluggablePanelSpec with an ImageMorph child (specify a symbol for #children)


However, all these approaches don't support resizing the form later.

I think a PluggableImageMorph that supports changing the image later and scaling it into bounds (either fit or cut) would be a nice extension for Morphic-Pluggable Widgets.

Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von tim Rowledge <[hidden email]>
Gesendet: Freitag, 5. Juni 2020 19:02 Uhr
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Help: pluggable widgets for forms
 


> On 2020-06-05, at 8:16 AM, karl ramberg <[hidden email]> wrote:
>
> I'm not sure what you try to do here.
> In morphic you usually use SketchMorph or ImageMorph

I suspect that Subbu is looking for sometihng in the toolbuilder world; and it correct that there isn't anything therein. ToolBuilder is pretty much solely set up to make the basic programming tools right now.

It *shouldn't* be too hard to add a bitmap viewing pane to the system. I like to hope, anyway...


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
I'd kill for a Nobel Peace Prize.





Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

K K Subbu
In reply to this post by timrowledge
On 05/06/20 10:32 pm, tim Rowledge wrote:
> I suspect that Subbu is looking for sometihng in the toolbuilder
> world; and it correct that there isn't anything therein. ToolBuilder
> is pretty much solely set up to make the basic programming tools
> right now.

Yes, Tim. I was trying to build a tool to view the state of a simulated
vm - displayForm, activeContext etc.

Essentially, I was looking for a pluggable widget and model that would
show a live view of displayForm scaled to fit the frame as the window
gets resized. So that rules out Christoph hacks.

Doing "displayForm asMorph ..." or "(ImageMorph new image:myForm)
openInWindow" as Karl suggested is quite tedious :-(.

Such a widget would also be useful in an inspector.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

Christoph Thiede

Such a widget would also be useful in an inspector.


True; and lists, styled texts, etc. could also be useful in an inspector. I already developed a concept of such an approach in SqueakSheet with a few fellow students (just that it's nested in a table there). Maybe we should implement something similar in the Inspector at some time ...


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von K K Subbu <[hidden email]>
Gesendet: Freitag, 5. Juni 2020 19:57:33
An: [hidden email]
Betreff: Re: [squeak-dev] Help: pluggable widgets for forms
 
On 05/06/20 10:32 pm, tim Rowledge wrote:
> I suspect that Subbu is looking for sometihng in the toolbuilder
> world; and it correct that there isn't anything therein. ToolBuilder
> is pretty much solely set up to make the basic programming tools
> right now.

Yes, Tim. I was trying to build a tool to view the state of a simulated
vm - displayForm, activeContext etc.

Essentially, I was looking for a pluggable widget and model that would
show a live view of displayForm scaled to fit the frame as the window
gets resized. So that rules out Christoph hacks.

Doing "displayForm asMorph ..." or "(ImageMorph new image:myForm)
openInWindow" as Karl suggested is quite tedious :-(.

Such a widget would also be useful in an inspector.

Regards .. Subbu



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

Karl Ramberg
In reply to this post by K K Subbu
See FileList>>readGraphicContent
It adds a resizeable form to a text field.

Best,
Karl



On Fri, Jun 5, 2020 at 7:57 PM K K Subbu <[hidden email]> wrote:
On 05/06/20 10:32 pm, tim Rowledge wrote:
> I suspect that Subbu is looking for sometihng in the toolbuilder
> world; and it correct that there isn't anything therein. ToolBuilder
> is pretty much solely set up to make the basic programming tools
> right now.

Yes, Tim. I was trying to build a tool to view the state of a simulated
vm - displayForm, activeContext etc.

Essentially, I was looking for a pluggable widget and model that would
show a live view of displayForm scaled to fit the frame as the window
gets resized. So that rules out Christoph hacks.

Doing "displayForm asMorph ..." or "(ImageMorph new image:myForm)
openInWindow" as Karl suggested is quite tedious :-(.

Such a widget would also be useful in an inspector.

Regards .. Subbu



Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

K K Subbu
On 06/06/20 3:24 am, karl ramberg wrote:
> See FileList>>readGraphicContent
> It adds a resizeable form to a text field.

Quite a neat trick - using a form as a character in a font! This could
be used to show a graphic when a form is selected in an inspector.

Thanks and Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

Karl Ramberg


On Sat, Jun 6, 2020 at 7:38 PM K K Subbu <[hidden email]> wrote:
On 06/06/20 3:24 am, karl ramberg wrote:
> See FileList>>readGraphicContent
> It adds a resizeable form to a text field.

Quite a neat trick - using a form as a character in a font! This could
be used to show a graphic when a form is selected in an inspector.
 
The explorer already does show a small icon of the morph imageForm.



Best,
Karl



Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

K K Subbu
In reply to this post by timrowledge
On 05/06/20 10:32 pm, tim Rowledge wrote:
> I suspect that Subbu is looking for sometihng in the toolbuilder world; and it correct that there isn't anything therein. ToolBuilder is pretty much solely set up to make the basic programming tools right now.
>
> It*shouldn't*  be too hard to add a bitmap viewing pane to the system. I like to hope, anyway...

Poking around in the latest Spur64VMMaker, I found a previous attempt by
tty and eem to develop a SimulatorMorph for StackInterpreter. It appears
to be abandoned and a simpler morph (openAsMorph) is being used for
CogVMInterpreter.

Possibly because of its complexity in trying to combine two separate
morphs - vm controller and vm console into one window. Having them
separate would have been easier as the vm console morph is dynamic in
size and contents.

Thanks to all those who responded to my queries. I found a lot of good
stuff already in Morphic. Form>>hackBits: wraps a form around bits in a
byte array. OLPCVirtualScreen, OLPCVirtualSensor show virtualization of
display and input.

I wish there was a Help->Morphic Classes - a guide through the various
concepts illustrated by Morphs that is kept in sync with each update. An
in-image guide with live links will be easier to read and simpler to
keep in sync than Swiki pages.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

marcel.taeumel
In reply to this post by K K Subbu

Am 06.06.2020 19:38:08 schrieb K K Subbu <[hidden email]>:

On 06/06/20 3:24 am, karl ramberg wrote:
> See FileList>>readGraphicContent
> It adds a resizeable form to a text field.

Quite a neat trick - using a form as a character in a font! This could
be used to show a graphic when a form is selected in an inspector.

Thanks and Regards .. Subbu



Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

K K Subbu
Marcel,

That was a quick neat hack! Thanks.

Can this work when inspecting an array of forms?

Regards .. Subbu


Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

marcel.taeumel
Can this work when inspecting an array of forms?

Not quite because custom inspectors define their field specifications. There is no overriding mechanism in place where you can say "for all kinds of inspectors, do X to a field's contents when Y condition is satisfied".

What you can do is to create a "ArrayOfFormsInspector" which does as you want to. But you would have to invoke it manually if you happen to have an array of forms at your "hand". :-)

Best,
Marcel

Am 09.06.2020 20:08:48 schrieb K K Subbu <[hidden email]>:

Marcel,

That was a quick neat hack! Thanks.

Can this work when inspecting an array of forms?

Regards .. Subbu




Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

K K Subbu
On 11/06/20 3:04 pm, Marcel Taeumel wrote:
> Not quite because custom inspectors define their field specifications.
> There is no overriding mechanism in place where you can say "for all
> kinds of inspectors, do X to a field's contents when Y condition is
> satisfied".

What if #contents in the code pane contained the graphic as a glyph but
surrounded by double quotes for form fields? It would still parse as
code wouldn't it?

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Help: pluggable widgets for forms

marcel.taeumel
Hi Subbu.

What if #contents in the code pane contained the graphic as a glyph but
> surrounded by double quotes for form fields? It would still parse as
> code wouldn't it?

You want a nice print-on result? That could be implemented in TextEditor >> #printIt. :-) And it would work also in Workspace, System Browser, etc...

Best,
Marcel

Am 11.06.2020 19:28:23 schrieb K K Subbu <[hidden email]>:

On 11/06/20 3:04 pm, Marcel Taeumel wrote:
> Not quite because custom inspectors define their field specifications.
> There is no overriding mechanism in place where you can say "for all
> kinds of inspectors, do X to a field's contents when Y condition is
> satisfied".

What if #contents in the code pane contained the graphic as a glyph but
surrounded by double quotes for form fields? It would still parse as
code wouldn't it?

Regards .. Subbu