krakjoe / ui

Cross platform UI development in PHP
Other
519 stars 39 forks source link

disabling box causes crash #12

Open Stricted opened 7 years ago

Stricted commented 7 years ago

in gallery example when i set $numbersHbox->disable(); then it crashen when i go to the Numbers and Lists tab

wen i set $numbersHbox->destroy(); then php crashes instantly

maybe its a great idea to add to UI\Controls\Tab a method to get the current tabs/boxes to modify them later?

krakjoe commented 7 years ago

I assume you are using Windows, as I can't reproduce the disable issue on nix ?

There is an open issue regarding controls with children, tabs are included in that.

Control::destroy should only be executed in shutdown/closing handler for Windows, the results of using it at other times on other controls are undefined.

Stricted commented 7 years ago

yep im on windows the idea behind this was to dynamically add/remove/change the ui but i get only crashes

an example what im using on an c# wpf projekt: i have multiple tabs/pages and disanle all except an login/logout page, depends on the login state in activate or deactivate all other tabs/pages when i try doing it here im unable to get the tab/box objects and when i try to change the state before adding the (disable it before adding) it crashes

krakjoe commented 7 years ago

Tab has a method for deleting pages.

Disabling it should work, I'll check upstream.

Stricted commented 7 years ago

deleting dosent work -> resulting in crash on ubuntu i call $tab->delete(0); after appending the first box

Thread 1 "php" received signal SIGSEGV, Segmentation fault. 0x00007ffff27bf83d in childSetFlag (c=0x736c6f72746e, flag=1) at /home/stricted/libui/unix/child.c:109 109 c->flag = flag; (gdb) bt

0 0x00007ffff27bf83d in childSetFlag (c=0x736c6f72746e, flag=1)

at /home/stricted/libui/unix/child.c:109

1 0x00007ffff27ca9cd in uiTabSetMargined (t=0x555555f476f0, n=1, margined=1)

at /home/stricted/libui/unix/tab.c:78

2 0x00007ffff29ec042 in zim_Tab_setMargin (execute_data=,

return_value=<optimized out>) at /home/stricted/ui/classes/tab.c:141

3 0x00005555557a3b5a in dtrace_execute_internal ()

4 0x0000555555839080 in ?? ()

5 0x00005555557f442b in execute_ex ()

6 0x00005555557a3af8 in dtrace_execute_ex ()

7 0x0000555555848367 in zend_execute ()

8 0x00005555557b3db3 in zend_execute_scripts ()

9 0x00005555557540b0 in php_execute_script ()

10 0x000055555584a00c in ?? ()

11 0x000055555563814e in main ()

krakjoe commented 7 years ago

You didn't adjust any of the indexes on calls to Tab::setMargin ... I'll do something about it though ...

EDIT: I think I'll introduce exceptions ...