> Is it possible to send text typed into an Fl_Input box to another box
> without using a callback via an enter button?  

Sure; pretty much any fltk widget (including the windows themselves) can be 
associated with a callback.

So for a Fl_Input you can set the when() as FL_WHEN_ENTER_KEY, then if you hit 
the enter key, the callback for the input widget should run.

> If this can work, what functions would be used and could you provide a
> short statement for syntax?
> 
> Also, if I am wanting to loop this series of events, how would I go
> about this if the Input box and the other text box are dynamically
> allocated? Should they be destroyed and recreated with each iteration
> to avoid memory leaks?

Can you clarify; I'm not clear what you are asking here, can you outline what 
you are trying to achieve, then we can suggest some ways you might implement 
that.

Anyway, here's a little fluid file that might show how the enter key stuff 
works...
----------------------
# data file for the Fltk User Interface Designer (fluid)
version 1.0302 
header_name {.h} 
code_name {.cxx}
decl {\#include <stdio.h>} {selected private local
} 

Function {} {open
} {
  Fl_Window main_win {open
    private xywh {856 299 543 337} type Double visible
  } {
    Fl_Button quit_bt {
      label Quit
      callback {main_win->hide();}
      private xywh {455 280 80 45} box THIN_UP_BOX
    }
    Fl_Browser brws {
      private xywh {40 80 405 245} box THIN_DOWN_BOX
    }
    Fl_Input input_widget {
      label {input:}
      callback {printf("Enter key hit: value is %s\\n", input_widget->value());
fflush(stdout);
brws->add( input_widget->value());}
      private xywh {65 31 190 28} box THIN_DOWN_BOX when 10
    }
  }
} 
----------------------

Ian



Selex ES Ltd
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