Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#4610) CMA frontend for Xaw
Home

[Freeciv-Dev] Re: (PR#4610) CMA frontend for Xaw

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4610) CMA frontend for Xaw
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Jul 2003 22:25:37 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Jul 20, 2003 at 10:47:20AM -0700, andrearo@xxxxxxxxxxxx wrote:
> On Fri, 18 Jul 2003, Mike Kaufman wrote:
> > On Fri, Jul 18, 2003 at 09:58:59AM -0700, andrearo@xxxxxxxxxxxx wrote:
> > > I've written a CMA frontend for the Xaw client, since I usually
> >
> > looks nice, has some problems though:
> 
> I've fixed these issues now. It should have the same functionality as
> the gtk version.
 
much slicker. still has some problems.

o The food factor slider works, but the rest of the factor sliders don't.
o moving the sliders blanks out the results (--- on all)
o along with this, if you move the sliders to a duplicate of a preset, it
  should tell you which preset, else custom.
o i can't believe that you can't crash your client every time with your
  patch. Here's the problem:

+  for (i = 1; i < NUM_STATS; i++) {
+    surplus_slider[i] = 
+      I_L(XtVaCreateManagedWidget("cmapresetscroll",
       ^^^
   this is not a label, so it shouldn't be here.
+                                  scrollbarWidgetClass, form,
+                                  XtNfromHoriz, stat_surplus_label[i],
+                                  XtNfromVert, stat_surplus_label[i - 1],
+                                  NULL));

same for all the other sliders.

o doing this construction is pretty messy:

  /* Create scrollbars in the factor column. */
  factor_slider[0] = 
    XtVaCreateManagedWidget("cmapresetscroll",
                                scrollbarWidgetClass, form,
                                XtNfromHoriz, stat_factor_label[0],
                                XtNfromVert, factor_header,
                                NULL);
  
  for (i = 1; i < NUM_STATS; i++) {
    factor_slider[i] = 
    XtVaCreateManagedWidget("cmapresetscroll",
                                scrollbarWidgetClass, form,
                                XtNfromHoriz, stat_factor_label[i],
                                XtNfromVert, stat_factor_label[i - 1],
                                NULL);
  }
  
  factor_slider[NUM_STATS] = 
    XtVaCreateManagedWidget("cmapresetscroll",
                                scrollbarWidgetClass, form,
                                XtNfromHoriz, stat_factor_label[NUM_STATS -1],
                                XtNfromVert, stat_factor_label[NUM_STATS - 1],
                                NULL);

See messagedlg.c, here's the idea:

  Widget temp;

  temp = factor_header;

  for (i = 0; i <= NUM_STATS; i++) {
    factor_slider[i] = XtVaCreateManagedWidget("cmapresetscroll",
                                scrollbarWidgetClass, form,
                                XtNfromHoriz, stat_factor_label[i],
                                XtNfromVert, temp
                                NULL);
    temp = factor_slider[i];
  }

-mike



[Prev in Thread] Current Thread [Next in Thread]