Menubar at the top of Pharo's main window

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

Menubar at the top of Pharo's main window

Christian Caldeiro-3
Hi,

First of all, congratulations for the new 1.4 release.

I’m not new to Smalltalk but I am to Pharo’s UI. All I did until now in Pharo was using it as server (Seaside).

I saw some applications done with Pharo that show a menu bar at the very top of its main window (lets say, above Pharo’s logo). I’m wandering how to do that. All samples I saw (and correct me if I’m wrong) first create a new window (ie a StandardWindow) and then add the menubar and menu to it.

Any sample I can look at?

Thanks

Christian

Reply | Threaded
Open this post in threaded view
|

Re: Menubar at the top of Pharo's main window

laurent laffont

On Mon, Apr 23, 2012 at 8:01 PM, Christian Caldeiro <[hidden email]> wrote:
Hi,

First of all, congratulations for the new 1.4 release.

I’m not new to Smalltalk but I am to Pharo’s UI. All I did until now in Pharo was using it as server (Seaside).

I saw some applications done with Pharo that show a menu bar at the very top of its main window (lets say, above Pharo’s logo). I’m wandering how to do that. All samples I saw (and correct me if I’m wrong) first create a new window (ie a StandardWindow) and then add the menubar and menu to it.

Any sample I can look at?


Something like that ?

|dock|
dock := DockingBarMorph new
adhereToTop;
openInWorld.
dock
addMorph: ( PluggableButtonMorph new
label: 'Hello';
model: [UIManager inform: 'Hello Pharo !']; 
actionSelector: #value);
addMorph: ( PluggableButtonMorph new
label: 'Close';
model: [dock delete]; 
actionSelector: #value);
addMorph: ( MenuItemMorph new
contents: 'A menu';
subMenu: (MenuMorph new 
add: 'Hello' target: [UIManager inform: 'Hello from menu'] action: #value;
add: 'Goodbye' target: [dock delete] action: #value;
yourself)).



Laurent Laffont - @lolgzs

Blog: http://magaloma.blogspot.com/
Developer group: http://www.cara74.org
Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Pharo web deployment: http://www.alpha.smallharbour.org 



 

Thanks

Christian


Reply | Threaded
Open this post in threaded view
|

Re: Menubar at the top of Pharo's main window

Christian Caldeiro-3
Exactly that! Thanks, Laurent!

Regards,
Christian

On Mon, Apr 23, 2012 at 4:42 PM, laurent laffont <[hidden email]> wrote:

On Mon, Apr 23, 2012 at 8:01 PM, Christian Caldeiro <[hidden email]> wrote:
Hi,

First of all, congratulations for the new 1.4 release.

I’m not new to Smalltalk but I am to Pharo’s UI. All I did until now in Pharo was using it as server (Seaside).

I saw some applications done with Pharo that show a menu bar at the very top of its main window (lets say, above Pharo’s logo). I’m wandering how to do that. All samples I saw (and correct me if I’m wrong) first create a new window (ie a StandardWindow) and then add the menubar and menu to it.

Any sample I can look at?


Something like that ?

|dock|
dock := DockingBarMorph new
adhereToTop;
openInWorld.
dock
addMorph: ( PluggableButtonMorph new
label: 'Hello';
model: [UIManager inform: 'Hello Pharo !']; 
actionSelector: #value);
addMorph: ( PluggableButtonMorph new
label: 'Close';
model: [dock delete]; 
actionSelector: #value);
addMorph: ( MenuItemMorph new
contents: 'A menu';
subMenu: (MenuMorph new 
add: 'Hello' target: [UIManager inform: 'Hello from menu'] action: #value;
add: 'Goodbye' target: [dock delete] action: #value;
yourself)).



Laurent Laffont - @lolgzs

Blog: http://magaloma.blogspot.com/
Developer group: http://www.cara74.org
Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Pharo web deployment: http://www.alpha.smallharbour.org 



 

Thanks

Christian



Reply | Threaded
Open this post in threaded view
|

Beginner Question on PetitParserMarkdown

Kristinn
In reply to this post by laurent laffont
Hello,
I'm trying to use the PetitParserMarkdown package. I run the code below in a
workspace and get an array. I'm not sure how to turn the array into HTML.
Any help is greatly appreciated.
Thanks, Kris
| doc parsedDoc|
doc := '
This is Markdown!
=================
and another header
------------------

This is a normal paragraph.
And this too!
'.

parsedDoc := PPMarkdownParser new parse: doc .
parsedDoc .


Reply | Threaded
Open this post in threaded view
|

Re: Beginner Question on PetitParserMarkdown

Camillo Bruni
hi kris,

beware that the markdown parser isn't complete yet :/.

normally you would write a visitor which walks over the
returned data (markdown nodes in this case). If you inspect further the
returned elements you will see how they reflect the different markdown
entities...

I didn't add a default implementation to the petit-markdown package yet, but
you can find an implementation for seaside in the following repos

http://ss3.gemstone.com/ss/webdoc

look for the CommentFormatter class.

hope that helps a bit
cami

On 2012-04-29, at 14:49, Kristinn wrote:

> Hello,
> I'm trying to use the PetitParserMarkdown package. I run the code below in a
> workspace and get an array. I'm not sure how to turn the array into HTML.
> Any help is greatly appreciated.
> Thanks, Kris
> | doc parsedDoc|
> doc := '
> This is Markdown!
> =================
> and another header
> ------------------
>
> This is a normal paragraph.
> And this too!
> '.
>
> parsedDoc := PPMarkdownParser new parse: doc .
> parsedDoc .
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Beginner Question on PetitParserMarkdown

Kristinn
Yes, that helps a lot. Thank you. I'll take a look at webdoc. I do want
to use it with Seaside, so that may be just what I'm looking for.
Cheers,
Kris

On 04/29/2012 04:53 PM, Camillo Bruni wrote:

> hi kris,
>
> beware that the markdown parser isn't complete yet :/.
>
> normally you would write a visitor which walks over the
> returned data (markdown nodes in this case). If you inspect further the
> returned elements you will see how they reflect the different markdown
> entities...
>
> I didn't add a default implementation to the petit-markdown package yet, but
> you can find an implementation for seaside in the following repos
>
> http://ss3.gemstone.com/ss/webdoc
>
> look for the CommentFormatter class.
>
> hope that helps a bit
> cami
>
> On 2012-04-29, at 14:49, Kristinn wrote:
>
>> Hello,
>> I'm trying to use the PetitParserMarkdown package. I run the code below in a
>> workspace and get an array. I'm not sure how to turn the array into HTML.
>> Any help is greatly appreciated.
>> Thanks, Kris
>> | doc parsedDoc|
>> doc := '
>> This is Markdown!
>> =================
>> and another header
>> ------------------
>>
>> This is a normal paragraph.
>> And this too!
>> '.
>>
>> parsedDoc := PPMarkdownParser new parse: doc .
>> parsedDoc .
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Beginner Question on PetitParserMarkdown

Kristinn
In reply to this post by Camillo Bruni
I tried to load webdoc and got an error. I'm using Pharo 1.4.  "The
symbolic version #stable is not defined in...for the current platform"
was the error message.
Kris

On 04/29/2012 04:53 PM, Camillo Bruni wrote:

> hi kris,
>
> beware that the markdown parser isn't complete yet :/.
>
> normally you would write a visitor which walks over the
> returned data (markdown nodes in this case). If you inspect further the
> returned elements you will see how they reflect the different markdown
> entities...
>
> I didn't add a default implementation to the petit-markdown package yet, but
> you can find an implementation for seaside in the following repos
>
> http://ss3.gemstone.com/ss/webdoc
>
> look for the CommentFormatter class.
>
> hope that helps a bit
> cami
>
> On 2012-04-29, at 14:49, Kristinn wrote:
>
>> Hello,
>> I'm trying to use the PetitParserMarkdown package. I run the code below in a
>> workspace and get an array. I'm not sure how to turn the array into HTML.
>> Any help is greatly appreciated.
>> Thanks, Kris
>> | doc parsedDoc|
>> doc := '
>> This is Markdown!
>> =================
>> and another header
>> ------------------
>>
>> This is a normal paragraph.
>> And this too!
>> '.
>>
>> parsedDoc := PPMarkdownParser new parse: doc .
>> parsedDoc .
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Beginner Question on PetitParserMarkdown

S Krish
In reply to this post by Kristinn
This may offer a way to convert data into HTML.. from a seaside app..




On Mon, Apr 30, 2012 at 2:42 AM, Kristinn <[hidden email]> wrote:
Yes, that helps a lot. Thank you. I'll take a look at webdoc. I do want to use it with Seaside, so that may be just what I'm looking for.
Cheers,
Kris


On 04/29/2012 04:53 PM, Camillo Bruni wrote:
hi kris,

beware that the markdown parser isn't complete yet :/.

normally you would write a visitor which walks over the
returned data (markdown nodes in this case). If you inspect further the
returned elements you will see how they reflect the different markdown
entities...

I didn't add a default implementation to the petit-markdown package yet, but
you can find an implementation for seaside in the following repos

http://ss3.gemstone.com/ss/webdoc

look for the CommentFormatter class.

hope that helps a bit
cami

On 2012-04-29, at 14:49, Kristinn wrote:

Hello,
I'm trying to use the PetitParserMarkdown package. I run the code below in a
workspace and get an array. I'm not sure how to turn the array into HTML.
Any help is greatly appreciated.
Thanks, Kris
| doc parsedDoc|
doc := '
This is Markdown!
=================
and another header
------------------

This is a normal paragraph.
And this too!
'.

parsedDoc := PPMarkdownParser new parse: doc .
parsedDoc .







Reply | Threaded
Open this post in threaded view
|

Re: Beginner Question on PetitParserMarkdown

Camillo Bruni
In reply to this post by Kristinn
try

ConfigurationOfWebDoc loadDevelopment

AFAIK that should load all the dependencies...

On 2012-04-29, at 23:36, Kristinn wrote:

> I tried to load webdoc and got an error. I'm using Pharo 1.4.  "The symbolic version #stable is not defined in...for the current platform" was the error message.
> Kris
>
> On 04/29/2012 04:53 PM, Camillo Bruni wrote:
>> hi kris,
>>
>> beware that the markdown parser isn't complete yet :/.
>>
>> normally you would write a visitor which walks over the
>> returned data (markdown nodes in this case). If you inspect further the
>> returned elements you will see how they reflect the different markdown
>> entities...
>>
>> I didn't add a default implementation to the petit-markdown package yet, but
>> you can find an implementation for seaside in the following repos
>>
>> http://ss3.gemstone.com/ss/webdoc
>>
>> look for the CommentFormatter class.
>>
>> hope that helps a bit
>> cami
>>
>> On 2012-04-29, at 14:49, Kristinn wrote:
>>
>>> Hello,
>>> I'm trying to use the PetitParserMarkdown package. I run the code below in a
>>> workspace and get an array. I'm not sure how to turn the array into HTML.
>>> Any help is greatly appreciated.
>>> Thanks, Kris
>>> | doc parsedDoc|
>>> doc := '
>>> This is Markdown!
>>> =================
>>> and another header
>>> ------------------
>>>
>>> This is a normal paragraph.
>>> And this too!
>>> '.
>>>
>>> parsedDoc := PPMarkdownParser new parse: doc .
>>> parsedDoc .
>>>
>>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Beginner Question on PetitParserMarkdown

Kristinn
Hello,
I get an error. Could not resolve WebDoc[WebDoc-DamienPollet-70] in my
local package-cache.  I got it trying a few different images (with and
without Seaside loaded and on Vista and Ubuntu using Pharo 1.4).
Kris

On 5/1/2012 4:54 AM, Camillo Bruni wrote:

> try
>
> ConfigurationOfWebDoc loadDevelopment
>
> AFAIK that should load all the dependencies...
>
> On 2012-04-29, at 23:36, Kristinn wrote:
>
>> I tried to load webdoc and got an error. I'm using Pharo 1.4.  "The symbolic version #stable is not defined in...for the current platform" was the error message.
>> Kris
>>
>> On 04/29/2012 04:53 PM, Camillo Bruni wrote:
>>> hi kris,
>>>
>>> beware that the markdown parser isn't complete yet :/.
>>>
>>> normally you would write a visitor which walks over the
>>> returned data (markdown nodes in this case). If you inspect further the
>>> returned elements you will see how they reflect the different markdown
>>> entities...
>>>
>>> I didn't add a default implementation to the petit-markdown package yet, but
>>> you can find an implementation for seaside in the following repos
>>>
>>> http://ss3.gemstone.com/ss/webdoc
>>>
>>> look for the CommentFormatter class.
>>>
>>> hope that helps a bit
>>> cami
>>>
>>> On 2012-04-29, at 14:49, Kristinn wrote:
>>>
>>>> Hello,
>>>> I'm trying to use the PetitParserMarkdown package. I run the code below in a
>>>> workspace and get an array. I'm not sure how to turn the array into HTML.
>>>> Any help is greatly appreciated.
>>>> Thanks, Kris
>>>> | doc parsedDoc|
>>>> doc := '
>>>> This is Markdown!
>>>> =================
>>>> and another header
>>>> ------------------
>>>>
>>>> This is a normal paragraph.
>>>> And this too!
>>>> '.
>>>>
>>>> parsedDoc := PPMarkdownParser new parse: doc .
>>>> parsedDoc .
>>>>
>>>>
>>>
>
>