Greg Ercolano <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Robert Atwood wrote:
>> Hi again:
>> here's the new question.
>> I have a similar object as described previously but more complex: a
>> Tabs widget in which I use a class derived from Group as the object
>> in a tab. 
> 
>      Can you include an .fl file with just the bare minimum widgets
>      showing the problem?
> 
>      It sounds like some issue with the MySlider widget definition.
> 
Hi:

Okay, I pared it down to a single tab and a button that adds the slider, 
and made it stand-alone. Here's the .fl inserted below. I just use

c++ -o vinter_min vinter_min.cxx -lfltk 

(after using Fluid to 'write code' )

on Red Hat EL-4 on a x86-64, but I've compiled FLTK from svnversion 5937
I tried also with MySlider not resizable, then the size is fixed but 
still outside the Pack it's supposed to be in. The size corresponds to 
the original layout, I think. 
So, I (here) tried making the "pitch" also resizable, then instead of 
shrinking to fit into the Pack, it expands to some unknown size. If the 
"pitch" is  not resizable, then the "sample" Light_Button expands instead  
(not what I want!) 

Thanks for having a look!
Robert



#//BEGINNING OF .FL FILE
# data file for the Fltk User Interface Designer (fluid)
version 1.0108 
header_name {.h} 
code_name {.cxx}
decl {\#include <stdio.h>} {public global
} 

decl {\#include <stdlib.h>} {public global
} 

widget_class MySlider {
  label MySlider open
  xywh {56 781 132 270} type Single box NO_BOX resizable
  code0 {my_num=ntot;}
  code1 {ntot++;}
  code2 {printf("X %i Y %i W %i H %i\\n",X,Y,W,H);}
  class Fl_Pack visible position_relative
} {
  decl {int ntot;} {}
  decl {int my_num;} {public
  }
  Fl_Light_Button sample {
    label button
    xywh {0 0 25 20} labeltype NO_LABEL
  }
  Fl_Value_Slider pitch {
    label {slider:}
    xywh {0 20 25 200} labeltype NO_LABEL resizable
  }
  Fl_Slider octave {
    label {slider:}
    callback {double val;
val = o->value();
o->color((int)(val));}
    xywh {0 220 25 45} labeltype NO_LABEL
    code0 {octave->minimum(5);}
    code1 {octave->maximum(0);}
    code2 {octave->step(1);octave->value(2);}
  }
} 

widget_class TrackTab {
  label Track
  xywh {195 686 530 365} type Double
  class Fl_Group visible position_relative
} {
  Fl_Scroll TrackScroll {open
    xywh {25 18 470 218} type BOTH_ALWAYS
  } {
    Fl_Pack track {
      xywh {30 18 455 201} type HORIZONTAL box DOWN_FRAME color 93 
selection_color 158
      code0 {track->size(TrackScroll->w()-30,TrackScroll->h()-30);}
    } {}
  }
} 

class tabsUI {open
} {
  Function {tabsUI()} {open
  } {
    Fl_Window mainWindow {
      label TabsInterface open
      xywh {672 434 560 475} type Double align 65 resizable visible
    } {
      Fl_Tabs Tabs {open
        xywh {0 34 530 418} box ENGRAVED_BOX
      } {
        Fl_Group TtOne {
          label Track
          xywh {0 76 530 369}
          class TrackTab
        } {}
      }
      Fl_Button addSlider {
        label {Add Slider}
        callback {static int cnum=0;
MySlider * w;
Fl_Pack * t;
//Fl_Slider *w;
t=TtOne->track;
printf("adding slider %i\\n",cnum);
w = new MySlider(0,0,25,25);
//w->size(w->w(),t->h());
//w = new Fl_Slider(0,0,20,163);
w->sample->selection_color(0);
//w->sample->callback(sampbt_cb,choose);
cnum++;
    t->add(w);
    w->show();
    t->init_sizes();
    t->redraw();
mainWindow->redraw();}
        xywh {315 30 75 20} color 47 selection_color 4
      }
    }
  }
  Function {show(int argc,char**argv)} {} {
    code {mainWindow->show(argc,argv);} {}
  }
} 

Function {} {open return_type int
} {
  code {int retval=0;
   tabsUI * xrwin = new tabsUI();
   xrwin->show(argc, argv);
   retval=Fl::run();
   return(retval);} {}
} 
#//END OF .FL FILE

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to