updating the state of a state button

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

updating the state of a state button

Hilaire Fernandes
In a dialog, I found the state of a button is not updated, even after
self changed. See the code bellowm with methodes defnied in the dialog:

newMySketchesButton
        ^ self
                newButtonFor: self
                getState: #isMySketches
                action: #sketches
                arguments: nil
                getEnabled: #beMySketches "alway return true"
                label: 'MySketches' translated
                help: 'View my sketches' translated

sketches
        self isExamples: false.

isExamples: boolean
        isExamples := boolean.
        self changed

isMySketches
        ^self isExamples not


There is no #update at the dialog level, how should the button state
updated? (I know I can do it by-hand) Implementing myself an #update or
do I miss something?

Thanks

Hilaire



--
Education 0.2 -- http://blog.ofset.org/hilaire


Reply | Threaded
Open this post in threaded view
|

Re: updating the state of a state button

Gary Chambers-4
Need to send

    self changed: #isMySketches

Regards, Gary

----- Original Message -----
From: "Hilaire Fernandes" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, August 02, 2011 12:11 PM
Subject: [Pharo-project] updating the state of a state button


> In a dialog, I found the state of a button is not updated, even after
> self changed. See the code bellowm with methodes defnied in the dialog:
>
> newMySketchesButton
> ^ self
> newButtonFor: self
> getState: #isMySketches
> action: #sketches
> arguments: nil
> getEnabled: #beMySketches "alway return true"
> label: 'MySketches' translated
> help: 'View my sketches' translated
>
> sketches
> self isExamples: false.
>
> isExamples: boolean
> isExamples := boolean.
> self changed
>
> isMySketches
> ^self isExamples not
>
>
> There is no #update at the dialog level, how should the button state
> updated? (I know I can do it by-hand) Implementing myself an #update or
> do I miss something?
>
> Thanks
>
> Hilaire
>
>
>
> --
> Education 0.2 -- http://blog.ofset.org/hilaire
>
>

Reply | Threaded
Open this post in threaded view
|

Re: updating the state of a state button

Hilaire Fernandes
Yeah, I just figure out
Thanks

Hilaire

Le 02/08/2011 13:36, Gary Chambers a écrit :

> Need to send
>
>    self changed: #isMySketches
>
> Regards, Gary
>
> ----- Original Message ----- From: "Hilaire Fernandes"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, August 02, 2011 12:11 PM
> Subject: [Pharo-project] updating the state of a state button
>
>
>> In a dialog, I found the state of a button is not updated, even after
>> self changed. See the code bellowm with methodes defnied in the dialog:
>>
>> newMySketchesButton
>> ^ self
>> newButtonFor: self
>> getState: #isMySketches
>> action: #sketches
>> arguments: nil
>> getEnabled: #beMySketches "alway return true"
>> label: 'MySketches' translated
>> help: 'View my sketches' translated
>>
>> sketches
>> self isExamples: false.
>>
>> isExamples: boolean
>> isExamples := boolean.
>> self changed
>>
>> isMySketches
>> ^self isExamples not
>>
>>
>> There is no #update at the dialog level, how should the button state
>> updated? (I know I can do it by-hand) Implementing myself an #update or
>> do I miss something?
>>
>> Thanks
>>
>> Hilaire
>>
>>
>>
>> --
>> Education 0.2 -- http://blog.ofset.org/hilaire
>>
>>
>
>


--
Education 0.2 -- http://blog.ofset.org/hilaire