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. -- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
There is no such a morph existing (yet). You can do something based on button invoking popup menu (like here: https://github.com/BenjaminVanRyseghem/Triton/blob/master/Screenshots/Screen...) If you want some snippet based on this work around, just ask Ben On 16 Feb 2014, at 20:11, kmo <voxkmp@gmail.com> wrote:
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.
-- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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, btc@openinworld.com wrote:
Benjamin wrote:
There is no such a morph existing (yet).
You can do something based on button invoking popup menu (like here: https://github.com/BenjaminVanRyseghem/Triton/blob/master/Screenshots/Screen...)
If you want some snippet based on this work around, just ask
Ben
On 16 Feb 2014, at 20:11, kmo <voxkmp@gmail.com> wrote:
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.
-- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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
Le 17/02/2014 15:02, btc@openinworld.com 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, btc@openinworld.com 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
Cool. Thanks Thierry.
Le 17/02/2014 15:18, btc@openinworld.com 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. <http://forum.world.st/file/n4744441/PharoScreenshot.3.png> 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. -- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164p4744441.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
" If you constantly have to fall back on Morphs 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 <kilon.alios@gmail.com>:
" If you constantly have to fall back on Morphs 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 + ....
I'd say that nothing, but I guess the point is that simplicity and homogeneity are good and desirable. Cheers, Sergi
Le 17/02/2014 21:44, kilon alios a écrit :
Whats stops you from using Morphic and Spec at the same time ?
Entropy control? -- Dr. Geo http://drgeo.eu
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.
It is already there as Morph: UITheme exampleWindowWithToolbars
The question is - why can't you do this in Spec?
I guess Spec is not mature enough. Frankly, as long as, it is not "feature complete", will people developing application use it? Spec may deserve a planified effort to go through A to Z to make it feature complete to attract developer. -- Dr. Geo http://drgeo.eu
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.
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
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
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
Pharolauncher doesn't have a menu but it does have a an command icon toolbar at the top which is similar. It provide a very good example of a Spec application to learn from. cheers -ben
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 <hilaire.fernandes@gmail.com> 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
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 <benjamin.vanryseghem.pharo@gmail.com> 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 <hilaire.fernandes@gmail.com> 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
Le 18/02/2014 14:32, Johan Fabry a écrit :
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.
I do agree with the very large and complicated.
So, use it and tell us about it :-)
Which is exactly what's happening now :) 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
Spec can only get better and more complete as time goes on. I'm sure the effort will be turn out to be worthwhile. I'm just a bit disappointed that stuff like a menu widget is missing. It's not difficult to surmise what an application developer might want - there's probably less than a dozen basic widgets in a typical interface. Spec needs to have these covered. But is anyone even thinking of pharo for application developers? The Spec examples say it all - browsers, browsers, and more browsers - never anything that looks like an app. -- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164p4744702.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Just to motivate the browser example: we did try to find a different example but it's not so easy. If you want an application example, you need to explain the application and its' needs. The advantage of the browser is that you do not need to explain it. Also the browser has all the elements that you want to show in a simple example, including the reuse of models. Moreover this is without needing to provide (and explain) a bunch of application-specific code. If you have an example that shows the same things than what we have now, taking into account the above requirements, and ending up at approx the same number of pages I would be most happy to write it up! On Feb 18, 2014, at 4:03 PM, kmo <voxkmp@gmail.com> wrote:
Spec can only get better and more complete as time goes on. I'm sure the effort will be turn out to be worthwhile.
I'm just a bit disappointed that stuff like a menu widget is missing. It's not difficult to surmise what an application developer might want - there's probably less than a dozen basic widgets in a typical interface. Spec needs to have these covered. But is anyone even thinking of pharo for application developers? The Spec examples say it all - browsers, browsers, and more browsers - never anything that looks like an app.
-- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164p4744702.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
I takes a long time and a lot of work to write decent documentation: once again, thanks Johan and Ben. There is nothing to prevent others from writing extra tutorials, blog posts or whatever, showing how to build cool stuff using Spec. You can refer to the base documentation and then get going. We really need stuff like that, written by non-core developers, possibly taken other approaches to the subject. Please contribute, you will be amazed at how much you will learn while doing so. On 18 Feb 2014, at 20:17, Johan Fabry <jfabry@dcc.uchile.cl> wrote:
Just to motivate the browser example: we did try to find a different example but it's not so easy. If you want an application example, you need to explain the application and its' needs. The advantage of the browser is that you do not need to explain it. Also the browser has all the elements that you want to show in a simple example, including the reuse of models. Moreover this is without needing to provide (and explain) a bunch of application-specific code.
If you have an example that shows the same things than what we have now, taking into account the above requirements, and ending up at approx the same number of pages I would be most happy to write it up!
On Feb 18, 2014, at 4:03 PM, kmo <voxkmp@gmail.com> wrote:
Spec can only get better and more complete as time goes on. I'm sure the effort will be turn out to be worthwhile.
I'm just a bit disappointed that stuff like a menu widget is missing. It's not difficult to surmise what an application developer might want - there's probably less than a dozen basic widgets in a typical interface. Spec needs to have these covered. But is anyone even thinking of pharo for application developers? The Spec examples say it all - browsers, browsers, and more browsers - never anything that looks like an app.
-- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164p4744702.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
Spec provides today a new missing feature: a menu toolbar. As recently suggested in the mailing list, a menu toolbar is often a requirement to build an application. In order to provide an easy way to add a menu toolbar, Spec reuse **MenuModel** to generate the toolbar entries. So now, a **MenuModel** can be used in two cases: to define a toolbar, or to define a contextual menu. An example can be opened via ApplicationWithToolbar new openWithSpec Ben
Great to see that application menus have arrived in Spec! Many thanks Benjamin. I suppose it shows how well Spec has been designed and coded that the menus could be added so quickly. -- View this message in context: http://forum.world.st/Spec-and-an-application-menu-tp4744164p4745357.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Le 18/02/2014 20:17, Johan Fabry a écrit :
Just to motivate the browser example: we did try to find a different example but it's not so easy. If you want an application example, you need to explain the application and its' needs. The advantage of the browser is that you do not need to explain it. Also the browser has all the elements that you want to show in a simple example, including the reuse of models. Moreover this is without needing to provide (and explain) a bunch of application-specific code.
I think this is where the issue is. Smalltalk Browsers are very specific GUI applications, and very old in their shape (old as an example of a GUI from the 80's). They do showcase very well the strength of the Spec component composition, but, at the same time, they are quite different from an average GUI application these days. Note that all "Business" Smalltalks I know off these days (Dolphin, ST/X, Cincom) have menu bars and tool bars in their browsers.
If you have an example that shows the same things than what we have now, taking into account the above requirements, and ending up at approx the same number of pages I would be most happy to write it up!
Your typical text or model editor? But it doesn't showcase Spec composition as well as the Browser. 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
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
participants (9)
-
Benjamin -
btc@openinworld.com -
Goubier Thierry -
Hilaire Fernandes -
Johan Fabry -
kilon alios -
kmo -
Sergi Reyner -
Sven Van Caekenberghe