Add Button to Flap

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

Add Button to Flap

Zulq Alam
Hi, I'm learning Squeak/Smalltalk at the moment and enjoying it
immensely. I've asked in #squeak and it was suggested that I ask here.

Perhaps it's how little I know about Morphic but I don't know how to add
a button to the Tools flap.

I can open a Shout Workspace via World Menu -> open... -> Shout
Workspace. I would like to be able to drag a new Shout Workspace from
the Tools flap rather than take this root.

I've tried dragging and playing with Halos, but to no avail.

I feel like I'm missing something really obvious?

Any help appreciated.

Thanks,
Zulq.

Reply | Threaded
Open this post in threaded view
|

Re: Add Button to Flap

Edgar J. De Cleene
Zulq Alam puso en su mail :

> Hi, I'm learning Squeak/Smalltalk at the moment and enjoying it
> immensely. I've asked in #squeak and it was suggested that I ask here.
>
> Perhaps it's how little I know about Morphic but I don't know how to add
> a button to the Tools flap.
>
> I can open a Shout Workspace via World Menu -> open... -> Shout
> Workspace. I would like to be able to drag a new Shout Workspace from
> the Tools flap rather than take this root.
>
> I've tried dragging and playing with Halos, but to no avail.
>
> I feel like I'm missing something really obvious?
>
> Any help appreciated.
>
> Thanks,
> Zulq.

See if Shout Workspace have in class something like
prototypicalToolWindow
    "Answer an example of myself seen in a tool window, for the benefit of
parts-launching tools"

    | aWindow |
    aWindow _ self new openAsMorphEditing: nil.
    aWindow setLabel: 'System Browser'; applyModelExtent.
    ^ aWindow

I copy from System Browser, but many windows have one.
If not , you should type the appropiate in class.
But also you should do a button for firing.
Could be a IconicButton with imageForm of above window.
Build one and drag and drop on Flap.

Sorry the several steps, but if you don't have a chair you should build one.

Edgar



       
       
               
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar 


Reply | Threaded
Open this post in threaded view
|

Re: Add Button to Flap

Frank Urbach
In reply to this post by Zulq Alam
You can look at the class-side in the system-browser and search for "registerInFlapsRegistry".This accessor and the "unload" accessor you should implement for the class you wish to see on flaps. Use the Method-Finder from the Tools-Flap to see how you should implement such things.

Cheers,
Frank

-------- Original Message --------
Subject: Add Button to Flap (14-Mrz-2006 15:48)
From:    Zulq Alam <[hidden email]>
To:      [hidden email]

> Hi, I'm learning Squeak/Smalltalk at the moment and enjoying it
> immensely. I've asked in #squeak and it was suggested that I ask here.
>
> Perhaps it's how little I know about Morphic but I don't know how to add
> a button to the Tools flap.
>
> I can open a Shout Workspace via World Menu -> open... -> Shout
> Workspace. I would like to be able to drag a new Shout Workspace from
> the Tools flap rather than take this root.
>
> I've tried dragging and playing with Halos, but to no avail.
>
> I feel like I'm missing something really obvious?
>
> Any help appreciated.
>
> Thanks,
> Zulq.



Reply | Threaded
Open this post in threaded view
|

Re: Add Button to Flap

Zulq Alam
In reply to this post by Edgar J. De Cleene
Thanks Edgar and Frank. The following worked in the end.

Flaps unregisterQuadsWithReceiver: Workspace.
Flaps registerQuad: #(SHWorkspace prototypicalToolWindow 'Workspace' 'A
workspace is a simple window for editing text. You can later save the
contents to a file if you desire.') forFlapNamed: 'Tools'.
Flaps replaceToolsFlap.

The class SHWorkspace is a subclass of Workspace so the
prototypicalToolWindow implementation comes for free.

The key is to send replaceToolsFlap to the Flaps class otherwise nothing
happens. The side effect is the flaps colour schemes are reset (easily
fixed) and the Workspace icon is at the bottom of the flap (no idea how
to fix but not too bothered).

Thanks,
Zulq.


Reply | Threaded
Open this post in threaded view
|

Re: Add Button to Flap

Edgar J. De Cleene
Zulq Alam puso en su mail :

> The key is to send replaceToolsFlap to the Flaps class otherwise nothing
> happens. The side effect is the flaps colour schemes are reset (easily
> fixed) and the Workspace icon is at the bottom of the flap (no idea how
> to fix but not too bothered).
Select it via halo.
In the menu button do bring to front.

Next question ? :=)

Edgar

 



       
       
               
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar