Trouble with tables..

After quite some break from coding, I wanted to clean up the sources and wrap a v2.0 label around them ;). For a final test I built e-uae with GTK gui again, and it had one big layout problem. I enhanced the table layouting, so that you could have both tables with homogeneous cells or not. Although this worked with my small test cases, it totally blew up with many nested tables :(.

So I did, what I should have done from the beginning. Look how GTK layouts its tables. Funny thing is, that in GTK you have the same basic methods as in MUI. You first do a MUILM_MINMAX to calculate the wanted sizes of your object and after that you reach MUILM_LAYOUT in which you are told, which space you got for your children and have to place them.

In GTK this is done through a size_request and a size_allocation. So I wanted to call gtk_table_size_request from MUILM_MINMAX and gtk_table_size_allocate from MUILM_LAYOUT. It compiled without problems, good to see, how close my environment is to the original. I had to patch gtk_widget_get_child_requisition, to send reasonable sizes of the table children to the size request and gtk_widget_size_allocate, which now calls MUI_Layout.

GTK doesn't have min, def and max size values like MUI, but this was trivial to fix by doing the size request three times with different child sizes (min, def and max).

I searched for a bug, of which I thought was inside the GTK stuff, but I just got the parameters for MUI_Layout wrong. The simplest Bugs are sometimes the hardest to find...

At the moment, tables work fine and look really good. E-uae looks better than before, but still has some (minor) issues with tables in frames.. So still something to debug left..


Post a Comment

<< Home