Remove button and/or digit from panel

Posted By: Aku_Aku

Remove button and/or digit from panel - 08/05/10 19:47

How can i remove a button and/or a digit from panel?
Posted By: EvilSOB

Re: Remove button and/or digit from panel - 08/05/10 19:54

AFAIK, its not possible.

BUT, if I have the need, I set its data(digit) or bmaps(button) to NULLs,
and move it to x_pos = -100, y_pos = -100.



Posted By: Aku_Aku

Re: Remove button and/or digit from panel - 08/05/10 20:05

Could say, not so dynamic...
Anyway thank the quick reply.
Maybe another feature what should implement in A8.

What will happen if i create a digit to show the value of skill of entity, and i delete the entity?
It will cause a crash?
Posted By: Lukas

Re: Remove button and/or digit from panel - 08/05/10 20:34

"What will happen if i create a digit to show the value of skill of entity, and i delete the entity?
It will cause a crash?"
I guess so. If you are "lucky" it won't crash, but you get unpredictable behaviour.


If you want to be able to dynamically create and destroy buttons, you can use my LBGUI (link in my signature). wink
Posted By: EvilSOB

Re: Remove button and/or digit from panel - 08/05/10 20:35

I just tested the deleted-entity scenario, and the value just drops to Zero.
Posted By: Aku_Aku

Re: Remove button and/or digit from panel - 08/05/10 22:15

I observed a strange situation.
After i created and "deleted" more than 550 buttons and cca. 180 digits, my program was frozen. It was started from SED.
The program devoured cca. 900 MB memory.
What should be the solution?
Posted By: EvilSOB

Re: Remove button and/or digit from panel - 08/05/10 22:54

GAH!

Ok, if you are going to be creating and deleting that many,
it may be worth your while trying to find a way to 'remember'
any buttons or digits that have been hidden/deleted,
and re-using them instead of creating new ones...

Say, for example, creating an array for no-longer-used buttons,
and another for no-longer-used digits, storing their element number...

Then using pan_setbutton and pan_setdigits to "modify" the old, hidden
buttons/digits to their new use...
Posted By: Aku_Aku

Re: Remove button and/or digit from panel - 08/06/10 07:01

Nice work.
But actually i try to implement a treeview. As i can see, your demo doesn't contain such a form/control.

So i have to modify my application to work like EvilSOB proposed too.
Posted By: Roy

Re: Remove button and/or digit from panel - 08/06/10 12:36

I don't know exactly what is possible, but you could try to experiment with the pan_setbutton command. It's an easy way to empty button, but i don't think you can completely remove buttons with it..
Posted By: Aku_Aku

Re: Remove button and/or digit from panel - 08/07/10 11:44

I solved the problem with a constant button set, and redefines in loops.
© 2024 lite-C Forums