Can someone provide example Spec code to place a menubar at the top of a window? I've been struggling with MenuModels and MenuGroups etcetera but I get something more like a pop-up menu than the typical standard main menu of an application. Any help much appreciated.
|
There is no such a morph existing (yet).
You can do something based on button invoking popup menu If you want some snippet based on this work around, just ask
Ben On 16 Feb 2014, at 20:11, kmo <[hidden email]> wrote: Can someone provide example Spec code to place a menubar at the top of a |
Benjamin wrote:
There is no such a morph existing (yet).I've not had occasion to need it yet, but that seems like a critical omission for developers of traditional business software. Could almost be considered a bug in requirements :) "Perhaps" something should be included in Pharo 3 - in spite of the Pharo 3 feature freeze? cheers -ben |
I think a Spec model could be done to provide this feature
About the integration in 3.0, one may argue it’s not present since years, nobody complained so :P Ben On 16 Feb 2014, at 23:33, [hidden email] wrote:
|
Benjamin wrote:
I think a Spec model could be done to provide this feature True, but Pharo is moving into a domain that Squeak didn't target :P :P cheers -ben
|
Le 17/02/2014 15:02, [hidden email] a écrit : > Benjamin wrote: >> I think a Spec model could be done to provide this feature >> >> About the integration in 3.0, one may argue it’s not present since >> years, nobody complained so :P >> >> Ben > > True, but Pharo is moving into a domain that Squeak didn't target :P :P > cheers -ben Note that Squeak 4.3 has a true menu bar ;) Note 2: a small change or extension to the MenuMorph infrastructure in Pharo would hold a normal menu bar... Wait, it may already be there, unknown to all :) Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95 |
Goubier Thierry wrote:
> > > Le 17/02/2014 15:02, [hidden email] a écrit : >> Benjamin wrote: >>> I think a Spec model could be done to provide this feature >>> >>> About the integration in 3.0, one may argue it’s not present since >>> years, nobody complained so :P >>> >>> Ben >> >> True, but Pharo is moving into a domain that Squeak didn't target :P :P >> cheers -ben > > Note that Squeak 4.3 has a true menu bar ;) > > Note 2: a small change or extension to the MenuMorph infrastructure in > Pharo would hold a normal menu bar... Wait, it may already be there, > unknown to all :) > > Thierry |
Le 17/02/2014 15:18, [hidden email] a écrit : > Goubier Thierry wrote: >> >> Note that Squeak 4.3 has a true menu bar ;) >> >> Note 2: a small change or extension to the MenuMorph infrastructure in >> Pharo would hold a normal menu bar... Wait, it may already be there, >> unknown to all :) >> >> Thierry > Cool. Thanks Thierry. Look for DockingBarMorph. Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95 |
Yes - there's no problem with menus if you use Morphs. Here's an interface that uses a ToolDockingBarMorph to implement a menu.
The question is - why can't you do this in Spec? if Spec is to become the standard way to build interfaces then it needs to provide a full widget set. If you constantly have to fall back on Morphs then you might as well build the whole thing with Morphs. I can see that one day Spec may justify the effort spent on it - we may get the promised UI builder, we may get an OpenGL backend or a MARS backend that allows us to build Spec interfaces with native widgets. When these things happen we can all rejoice. But right now I'm thinking that the effort might have been better spent on cleaning and documenting Morphic, or removing the one window restriction, or fully integrating MARS. I confess I've never really understood Spec. When I first heard about it I assumed a Spec would be a text description of an interface, like Mozilla XUL or Delphi DFM files. Instead Spec is just another layer of code on top of Morphic - a layer of code that is still some way from being complete. Not ready for prime time just yet, I'm afraid. |
then you might as well build the whole thing with Morphs." Whats stops you from using Morphic and Spec at the same time ? It is even possible to use Morphic + Spec + Athens + NBOpenGL + Mars + ....
personally I am making my own GUI API using Athens and Morphic. Athens for the actual drawing, Morphic for managing the widgets and the events.
I could throw some Spec in it as well if I figure out how it works and see that it fits my way of thinking. From what I have read on Spec recent documentation it has an API for making extensions to it so adding new Morphs to it and Widgets is already doable.
For me the main problem is that 90% of Pharo methods are not documented. I dont have a problem fighting with a messy library like Morphic , but taking a look at all these methods with no comments and no documentation just viewing the source is a huge waste of time and effort.
I found out that its far easier to implement my own GUI API with Athens which at least it comes with a lengthy tutorial and some basic knowledge of Morphic. Its sad to reject a library just because it does not offer much documentation but I have no choice.
So I have to disagree , documenting Morphic is far more important than cleaning it up. Because a method you know how to use but is difficult to use is far more useful than a method that is easy to use but you dont know how to use it.
|
2014-02-17 20:44 GMT+00:00 kilon alios <[hidden email]>:
I'd say that nothing, but I guess the point is that simplicity and homogeneity are good and desirable. Cheers,
Sergi |
In reply to this post by kmo
CONTENTS DELETED
The author has deleted this message.
|
In reply to this post by kilon.alios
CONTENTS DELETED
The author has deleted this message.
|
In reply to this post by hilaire
Le 18/02/2014 09:12, Hilaire Fernandes a écrit : > > > Le 17/02/2014 20:22, kmo a écrit : >> Yes - there's no problem with menus if you use Morphs. Here's an interface >> that uses a ToolDockingBarMorph to implement a menu. >> >> <http://forum.world.st/file/n4744441/PharoScreenshot.3.png> > > > It is already there as Morph: > > UITheme exampleWindowWithToolbars I knew it! Thanks Hilaire. Now I want to try something: populate the menu bar with all possible menu/shortcuts commands defined in my app (i.e. tree node contextual menu, code pane contextual menu, smart-suggestions type commands) to ensure discoverability, in as few lines as possible. Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95 |
In reply to this post by hilaire
Has been moved to:
WidgetExamples new exampleWindowWithToolbars in Pharo 3.0 Le 18/02/2014 09:12, Hilaire Fernandes a écrit : > UITheme exampleWindowWithToolbars -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95 |
In reply to this post by Goubier Thierry
CONTENTS DELETED
The author has deleted this message.
|
Le 18/02/2014 09:36, Hilaire Fernandes a écrit : > > > Le 18/02/2014 09:26, Goubier Thierry a écrit : >> >> Now I want to try something: populate the menu bar with all possible >> menu/shortcuts commands defined in my app (i.e. tree node contextual >> menu, code pane contextual menu, smart-suggestions type commands) to >> ensure discoverability, in as few lines as possible. > > I guess it should be a mission for Spec. Probably ;) > For DrGeo, I have to hand write it and it is no a few lines. Not to > mention I did not set up the keyboard short cut. Well, I lifted the Command framework of the OmniBrowser for my own needs, and building automatically the menu and the shortcuts is just a few lines (and the shortcuts are allways in sync with the menu). I just have to change a bit the isActive/isEnabled for the menu bar; it should do the trick. Longuest will probably be rebuilding the layout of the window to accomodate the menu bar. Oh, and some menu commands names depend on the name of the ast node at the cursor point in the text (such as 'create accessors on requestor' when selecting the 'requestor' instance variable name in the #subclass: class description), so I should have a way to handle that (have a default name when nothing is selected?) Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95 |
Goubier Thierry wrote:
> > > Le 18/02/2014 09:36, Hilaire Fernandes a écrit : >> >> >> Le 18/02/2014 09:26, Goubier Thierry a écrit : >>> >>> Now I want to try something: populate the menu bar with all possible >>> menu/shortcuts commands defined in my app (i.e. tree node contextual >>> menu, code pane contextual menu, smart-suggestions type commands) to >>> ensure discoverability, in as few lines as possible. >> >> I guess it should be a mission for Spec. > > Probably ;) > >> For DrGeo, I have to hand write it and it is no a few lines. Not to >> mention I did not set up the keyboard short cut. > > Well, I lifted the Command framework of the OmniBrowser for my own > needs, and building automatically the menu and the shortcuts is just a > few lines (and the shortcuts are allways in sync with the menu). > > I just have to change a bit the isActive/isEnabled for the menu bar; > it should do the trick. Longuest will probably be rebuilding the > layout of the window to accomodate the menu bar. > > Oh, and some menu commands names depend on the name of the ast node at > the cursor point in the text (such as 'create accessors on requestor' > when selecting the 'requestor' instance variable name in the > #subclass: class description), so I should have a way to handle that > (have a default name when nothing is selected?) > > Thierry toolbar at the top which is similar. It provide a very good example of a Spec application to learn from. cheers -ben |
In reply to this post by hilaire
I do agree with you all :)
The things is many people ask for more things into Spec, but at the end, I am still the only one implementing them :) And as you can imagine, my time is not infinite :P I will end up proposing a kickstarted project I think :P
Ben On 18 Feb 2014, at 09:36, Hilaire Fernandes <[hidden email]> wrote:
|
And I agree with Ben :-) Also, since a UI framework is something very large and complicated, with many possible uses, it's not realistic to expect a few developers to be able to do a 'big bang' release that is 100% feature complete. Spec, as is, is very complete and useful for a large variety of UIs. If the community uses it, it will become clear which features have been overlooked and hence which Spec improvements will need to be prioritized. So, use it and tell us about it :-) On Feb 18, 2014, at 6:53 AM, Benjamin <[hidden email]> wrote: > I do agree with you all :) > > The things is many people ask for more things into Spec, > but at the end, I am still the only one implementing them :) > > And as you can imagine, my time is not infinite :P > > I will end up proposing a kickstarted project I think :P > > Ben > > On 18 Feb 2014, at 09:36, Hilaire Fernandes <[hidden email]> wrote: > >> >> >> Le 18/02/2014 09:26, Goubier Thierry a écrit : >>> >>> Now I want to try something: populate the menu bar with all possible >>> menu/shortcuts commands defined in my app (i.e. tree node contextual >>> menu, code pane contextual menu, smart-suggestions type commands) to >>> ensure discoverability, in as few lines as possible. >> >> I guess it should be a mission for Spec. >> For DrGeo, I have to hand write it and it is no a few lines. Not to >> mention I did not set up the keyboard short cut. >> >> >> -- >> Dr. Geo http://drgeo.eu >> >> > ---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile |
Free forum by Nabble | Edit this page |