View Single Post
Old 09-29-2013, 02:17 PM   #13
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by brianinmaine View Post
Looking through xform.c from mancala, it looks to me like all the objects have hard-coded sizes for everything - text size, even.

Code:
 fdui->holeT0 = obj = fl_add_button(FL_NORMAL_BUTTON,65,60,40,40,"");
    fl_set_object_boxtype(obj,FL_DOWN_BOX);
    fl_set_object_lcol(obj,FL_SLATEBLUE);
    fl_set_object_lsize(obj,FL_HUGE_SIZE);
    fl_set_object_lstyle(obj,FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
    fl_set_object_callback(obj,doHole,100);
  fdui->holeT1 = obj = fl_add_button(FL_NORMAL_BUTTON,105,60,40,40,"");
    fl_set_object_boxtype(obj,FL_DOWN_BOX);
    fl_set_object_lcol(obj,FL_SLATEBLUE);
    fl_set_object_lsize(obj,FL_HUGE_SIZE);
    fl_set_object_lstyle(obj,FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
    fl_set_object_callback(obj,doHole,101);
  fdui->holeT2 = obj = fl_add_button(FL_NORMAL_BUTTON,145,60,40,40,"");
    fl_set_object_boxtype(obj,FL_DOWN_BOX);
    fl_set_object_lcol(obj,FL_SLATEBLUE);
    fl_set_object_lsize(obj,FL_HUGE_SIZE);
    fl_set_object_lstyle(obj,FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
    fl_set_object_callback(obj,doHole,102);
the hole size seems to be 40x40 and the others must be placement on a grid. To make this bigger, I would guess it would be a total rewrite of this file PITA! Even though I LOVE mancala, this would be a very time consuming job...
It might be no more work than to re-write it to read those values from a configuration file.

In fact, it looks like that layout could be 'normalized' to calculate at start-up time from a few configuration file key values.
(grid size x.y, stride x, stride y - something like that)
knc1 is offline   Reply With Quote