4.1 GUI Changes - Buttons not working in my code

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

4.1 GUI Changes - Buttons not working in my code

Jon Hylands

Hi Everyone,

So, the new Cog VM has finally given me a reason to jump onto 4.1. I
downloaded Andreas' 4.1 Windows zip file, installed it on my robot,
and it starts up and runs with no issues.

I loaded my Brainbot server code from my Monticello repository, but
whenever I try and open any of my GUIs, the buttons are non-clickable.
In fact, I can't even bring up their halo - when I right click, it
switches between the system window and the alignment morph, but never
the buttons. If I explore the alignment morph, I can of course see all
the submorphs where they should be.

This code works in a 3.10.2 image, which is what I've been using up
until now.

I'm adding PluggableButtonMorph objects to an AlignmentMorph, which is
then added to a SystemWindowWithButton.

Has something about these things changed between 3.10.2 and 4.1?

Thanks,
Jon


Reply | Threaded
Open this post in threaded view
|

Re: 4.1 GUI Changes - Buttons not working in my code

Jon Hylands
On Wed, 23 Jun 2010 17:36:58 -0400, Jon Hylands <[hidden email]> wrote:

>So, the new Cog VM has finally given me a reason to jump onto 4.1. I
>downloaded Andreas' 4.1 Windows zip file, installed it on my robot,
>and it starts up and runs with no issues.
>
>I loaded my Brainbot server code from my Monticello repository, but
>whenever I try and open any of my GUIs, the buttons are non-clickable.
>In fact, I can't even bring up their halo - when I right click, it
>switches between the system window and the alignment morph, but never
>the buttons. If I explore the alignment morph, I can of course see all
>the submorphs where they should be.
>
>This code works in a 3.10.2 image, which is what I've been using up
>until now.
>
>I'm adding PluggableButtonMorph objects to an AlignmentMorph, which is
>then added to a SystemWindowWithButton.
>
>Has something about these things changed between 3.10.2 and 4.1?

Just as a followup - without the alignment morph, buttons work fine.
But I really like being able to group together things like buttons...

Later,
Jon


Reply | Threaded
Open this post in threaded view
|

Re: 4.1 GUI Changes - Buttons not working in my code

Chris Muller-3
I think the LayoutPolicy's replaced AlignmentMorph...

On Thu, Jun 24, 2010 at 8:23 AM, Jon Hylands <[hidden email]> wrote:

> On Wed, 23 Jun 2010 17:36:58 -0400, Jon Hylands <[hidden email]> wrote:
>
>>So, the new Cog VM has finally given me a reason to jump onto 4.1. I
>>downloaded Andreas' 4.1 Windows zip file, installed it on my robot,
>>and it starts up and runs with no issues.
>>
>>I loaded my Brainbot server code from my Monticello repository, but
>>whenever I try and open any of my GUIs, the buttons are non-clickable.
>>In fact, I can't even bring up their halo - when I right click, it
>>switches between the system window and the alignment morph, but never
>>the buttons. If I explore the alignment morph, I can of course see all
>>the submorphs where they should be.
>>
>>This code works in a 3.10.2 image, which is what I've been using up
>>until now.
>>
>>I'm adding PluggableButtonMorph objects to an AlignmentMorph, which is
>>then added to a SystemWindowWithButton.
>>
>>Has something about these things changed between 3.10.2 and 4.1?
>
> Just as a followup - without the alignment morph, buttons work fine.
> But I really like being able to group together things like buttons...
>
> Later,
> Jon
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 4.1 GUI Changes - Buttons not working in my code

Hannes Hirzel
Hello Jon,

Alignment issues are handled in class Morph. So instead of using an
AlignmentMorph you just use a regular instance of class Morph.

Something like

   m := Morph new.
   s1 := SimpleButtonMorph newWithLabel: 'start engine'.
   s2 := SimpleButtonMorph newWithLabel: 'stop engine'.
   m addMorphBack: s1.
   m addMorphBack: s2.
   m changeTableLayout.
   m hResizing: #shrinkWrap.
   m vResizing: #shrinkWrap.
   m openInWorld.

Or to get you started putting it into a SystemWindow

   model := Model new.
   w := SystemWindow labelled: 'Example'.
   w model: model.
   "A SystemWindow needs a model."

   m := Morph new.
   s1 := SimpleButtonMorph newWithLabel: 'start engine'.
   s2 := SimpleButtonMorph newWithLabel: 'stop engine'.
   m addMorphBack: s1.
   m addMorphBack: s2.
   m changeTableLayout.
   m hResizing: #shrinkWrap.
   m vResizing: #shrinkWrap.

   w addMorph: m frame: (0.0@0 corner: 1@1).
   w openInWorld.


--Hannes

On 7/2/10, Chris Muller <[hidden email]> wrote:

> I think the LayoutPolicy's replaced AlignmentMorph...
>
> On Thu, Jun 24, 2010 at 8:23 AM, Jon Hylands <[hidden email]> wrote:
>> On Wed, 23 Jun 2010 17:36:58 -0400, Jon Hylands <[hidden email]> wrote:
>>
>>>So, the new Cog VM has finally given me a reason to jump onto 4.1. I
>>>downloaded Andreas' 4.1 Windows zip file, installed it on my robot,
>>>and it starts up and runs with no issues.
>>>
>>>I loaded my Brainbot server code from my Monticello repository, but
>>>whenever I try and open any of my GUIs, the buttons are non-clickable.
>>>In fact, I can't even bring up their halo - when I right click, it
>>>switches between the system window and the alignment morph, but never
>>>the buttons. If I explore the alignment morph, I can of course see all
>>>the submorphs where they should be.
>>>
>>>This code works in a 3.10.2 image, which is what I've been using up
>>>until now.
>>>
>>>I'm adding PluggableButtonMorph objects to an AlignmentMorph, which is
>>>then added to a SystemWindowWithButton.
>>>
>>>Has something about these things changed between 3.10.2 and 4.1?
>>
>> Just as a followup - without the alignment morph, buttons work fine.
>> But I really like being able to group together things like buttons...
>>
>> Later,
>> Jon
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 4.1 GUI Changes - Buttons not working in my code

Jon Hylands
On Sat, 3 Jul 2010 13:59:25 +0000, Hannes Hirzel
<[hidden email]> wrote:

>Alignment issues are handled in class Morph. So instead of using an
>AlignmentMorph you just use a regular instance of class Morph.

Yeah, as it happened I ended up using BorderedMorph, which worked
fine.

Thanks,
Jon