feature req - ui.destroy(id)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

feature req - ui.destroy(id)

David McNab
Hi,

At the moment, individual UI controls can only be removed from the
window via ui.destroy(), which removes everything and takes hundreds
of milliseconds to clear the screen.

So I'm writing here to request if ui.destroy() could be changed to
optionally accept an argument, the ID of an individual control, or
even multiple IDs.

So then:
  ui.destroy()
    - destroys the whole UI
  ui.destroy(ctlID)
    - removes an individual control from the window, and frees
      up all Plua data structures associated with the control
  ui.destroy(sometable)
    - removes all controls in table 'sometable'

I thought of using libkit to implement a C routine that uses
FrmGetActiveForm() to find the form ptr, then FrmGetObjectIndex(ID) to
get the control's index on the form, then FrmRemoveObject(idx) to
remove the object.

But I don't feel happy with that because:
 - this doesn't free up any data structures which plua might be
   using to represent the control internally
 - FrmRemoveObject changes the frmPtr, which could crash Plua

Any thoughts?

Cheers
David






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: feature req - ui.destroy(id)

migueletto
Hi,

> So I'm writing here to request if ui.destroy() could be changed to
> optionally accept an argument, the ID of an individual control, or
> even multiple IDs.

This is not easily done, as explained below.

> I thought of using libkit to implement a C routine that uses
> FrmGetActiveForm() to find the form ptr, then FrmGetObjectIndex(ID) to
> get the control's index on the form, then FrmRemoveObject(idx) to
> remove the object.
>
> But I don't feel happy with that because:
>  - this doesn't free up any data structures which plua might be
>    using to represent the control internally
>  - FrmRemoveObject changes the frmPtr, which could crash Plua

The way controls are implemented in Plua makes FrmRemoveObject very
hard to use. FrmRemoveObject rebuilds the form from which the object
is beeing removed, making it incompatible with Plua internal
representation, as you guessed. So a indiviual control removal is not
going to happen.

Regards,
Marcio.





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: feature req - ui.destroy(id)

David McNab
--- In [hidden email], "migueletto" <mmand@...> wrote:

>
> Hi,
>
> > So I'm writing here to request if ui.destroy() could be changed to
> > optionally accept an argument, the ID of an individual control, or
> > even multiple IDs.
>
> The way controls are implemented in Plua makes FrmRemoveObject very
> hard to use. FrmRemoveObject rebuilds the form from which the object
> is beeing removed, making it incompatible with Plua internal
> representation, as you guessed. So a indiviual control removal is not
> going to happen.

Any way you might be persuaded to change your mind on this?

It would prove a huge boost to Plua if you can do it. I'm sure other
users would greatly appreciate it as well.

Cheers
David







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

Re: Re: feature req - ui.destroy(id)

Cameron Kaiser
> > > So I'm writing here to request if ui.destroy() could be changed to
> > > optionally accept an argument, the ID of an individual control, or
> > > even multiple IDs.
> >
> > The way controls are implemented in Plua makes FrmRemoveObject very
> > hard to use. FrmRemoveObject rebuilds the form from which the object
> > is beeing removed, making it incompatible with Plua internal
> > representation, as you guessed. So a indiviual control removal is not
> > going to happen.
>
> Any way you might be persuaded to change your mind on this?

From what Marcio said, it sounds like a lot of bookwork to accomplish it, if
it can be made to do so at all. If it means having to change Plua's internals
sufficiently to make forms construction less dynamic or flexible, I would not
support it.

--
--------------------------------- personal: http://www.armory.com/~spectre/ ---
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * [hidden email]
-- Please dispose of this message in the usual manner. -- Mission: Impossible -


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

Re: feature req - ui.destroy(id)

David McNab
--- In [hidden email], Cameron Kaiser <spectre@...> wrote:
> If it means having to change Plua's internals
> sufficiently to make forms construction less dynamic or flexible,
> I would not support it.

Admittedly I don't know the Plua internals, but it would surprise me
if this was the case. My gut feeling leans more towards the notion
that changing Plua's internals to support ui.destroy() of individual
widgets would either not affect Plua's forms construction interface,
or it might make it /more/ dynamic and flexible.

Cheers
Daivd






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: feature req - ui.destroy(id)

migueletto
In reply to this post by David McNab
Hi,

> > The way controls are implemented in Plua makes FrmRemoveObject very
> > hard to use. FrmRemoveObject rebuilds the form from which the object
> > is beeing removed, making it incompatible with Plua internal
> > representation, as you guessed. So a indiviual control removal is not
> > going to happen.
>
> Any way you might be persuaded to change your mind on this?
>
> It would prove a huge boost to Plua if you can do it. I'm sure other
> users would greatly appreciate it as well.

Sorry, but this feature is not going to be implemented. As explained
before, it would require rewriting some Plua internals, which I am not
doing.

Regards,
Marcio.






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/