removing a widget

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

removing a widget

Siemen Baader
Hi,

so ILWidget has #append: and #prepend: methods, but no #remove method to remove the current widget from the page. Or does it?

I could create an empty 'NullWidget' and use #show: or pass references to the containing widget to mark it dirty as in the ILTodoListApplication example, but these are cumbersome. Any ideas?

Thanks,
Siemen

--
You received this message because you are subscribed to the Google Groups "Iliad project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/iliad/CAM47ZxpVOAKYL%2BmU%2BS5Ds8GqAixKBO-JzYqxhvpZxKLh_z6fLA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: removing a widget

benoit
Hello Siemen,

  to remove a widget adder with #append: or #prepend: you just need to
send to the widget the message #answer:

  Here an example taken from one of my apps :

MyWidget>>contents
        ^ [ :e |
        e build: self quoiButton.
        e build: self emplacementButton.
        quoi isNotNil & emplacement isNotNil
                ifTrue: [ e build: self createButton ].
        e build: self cancelButton ]

MyWidget>>cancelButton
        | widget |
        widget := NUBButtonWidget new.
        widget
                text: 'Annuler';
                action: [ self answer: nil ].
        ^ widget


  MyWidget is added to MyApp with #append.
  NUBButtonWidget is just a widget wrapping a link or a form presented
as a button.
  When the user click on the button, MyWidget is removed from MyApp.

@+
Benoit

Le 06/01/20 à 08:53, Siemen Baader a écrit :

> Hi,
>
> so ILWidget has #append: and #prepend: methods, but no #remove method to
> remove the current widget from the page. Or does it?
>
> I could create an empty 'NullWidget' and use #show: or pass references
> to the containing widget to mark it dirty as in the
> ILTodoListApplication example, but these are cumbersome. Any ideas?
>
> Thanks,
> Siemen
>
> --
> You received this message because you are subscribed to the Google
> Groups "Iliad project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/iliad/CAM47ZxpVOAKYL%2BmU%2BS5Ds8GqAixKBO-JzYqxhvpZxKLh_z6fLA%40mail.gmail.com 
> <https://groups.google.com/d/msgid/iliad/CAM47ZxpVOAKYL%2BmU%2BS5Ds8GqAixKBO-JzYqxhvpZxKLh_z6fLA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "Iliad project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/iliad/0c4620a8-20af-9300-ec27-23992f4fb155%40free.fr.