> > It will display one color and after button has selected it 
> > display another
> > color in given below code
> > 
> > Similar manner instead of color and it should display image.
> 
> 
> If it were me, I'd make a derived widget from a radio-button, 
> but which
> also had a simple Fl_Box attached to put the image in.
> Then when the radio-button changes state, update the image in the box
> accordingly.


Actually, it needed even be that sophisticated - you can do this
entirely in fluid. Code attached. You'll need to provide two small png
files to see this work, one called up.png, one called dn.png.
The images I used were 40x40 pixels.

=============================================================
# data file for the Fltk User Interface Designer (fluid)
version 1.0109 
header_name {.h} 
code_name {.cxx}
Function {} {open
} {
  Fl_Window {} {open
    xywh {523 161 452 401} type Double visible
  } {
    Fl_Group {} {open
      xywh {25 25 300 275} box ENGRAVED_FRAME
    } {
      Fl_Round_Button b1 {
        callback {int i = b1->value();

if(i)
{
  b1->image(hidden->image());
  b2->image(hidden->deimage());
}
else
{
  b1->image(hidden->deimage());
  b2->image(hidden->image());
}
b1->redraw();
b2->redraw();}
        image {up.png} deimage {dn.png} xywh {50 40 64 45} type Radio
down_box ROUND_DOWN_BOX value 1 when 1
      }
      Fl_Round_Button b2 {
        callback {int i = b1->value();

if(i)
{
  b1->image(hidden->image());
  b2->image(hidden->deimage());
}
else
{
  b1->image(hidden->deimage());
  b2->image(hidden->image());
}
b1->redraw();
b2->redraw();} selected
        image {dn.png} deimage {dn.png} xywh {55 158 64 53} type Radio
down_box ROUND_DOWN_BOX
      }
    }
    Fl_Button hidden {
      image {up.png} deimage {dn.png} xywh {40 310 64 70} when 0 hide
    }
  }
} 

=============================================================









SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to