Hi, all -

I am trying to create a little widget/group made of an Fl_Input (or text 
editor) and a drop-down-menu-like suggestions box. The end goal is to make 
something similar to an AJAX-y suggestions box found on google, or the firefox 
sites suggestions, etc.

It's easy for me to create/fill/show a popup made of an Fl_Select_Browser 
inside an Fl_Menu_Window. If I use an Fl_Menu_Window, though, show() steals 
focus and the mouse cursor from my Fl_Input widget. I can't send back focus 
because the menu is a new window ... or at least I haven't figured out how to 
send it back ... ?

In short, I have something like the pseudo-code below. I'm happy to post my 
full test/draft if that helps.

Maybe someone else has been through this before?

Denton


// a 'drop down or popup' box with suggested text completions
class SuggestionsBox : public Fl_Menu_Window {

  Fl_Select_Browser *browser_; // ideally ...

  int handle(int event) {




}

class SuggestionsInput : public Fl_Input {

..

  Fl_Input *input_;
  ... etc etc ...

  browser_cb_() {
   // when user clicks a browser item, add to input_
   // then, hide browser_
  }

  int handle(int event) {

  // on keypress, take input_->value() as prefix.
  // search db/tree of terms, put those into browser_.
  // show browser_.

  }

public:

  InputWithSuggestionsBox(..) {

   // always display input_

   Fl_Group::end();

   win_ = new Fl_Menu_Window(...)
   browser_ = new Fl_Select_Browser(...)
   browser_->callback(browser_cb_, this)
   win_->end();

   ... etc

  }

  // etc etc

};


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

Reply via email to