Sorry, you all are right!
I'm using inheritance with Fl_Menu_. I did a simple test with all basic
components(related to menus), and the error had not been manifested. So, the
problem is in my component. The reason we made it is because we need more
control in focus color(background and foreground) and also to distinguish
between focus and selecting, and I saw that background was hardcoded in fltk
1.3... anyway, I'm very sorry for loosing your time.
Thanks!
J.Marcelo Auler
Just for curiosity, bellow is the code that I made to reproduce...
#include <iostream.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Menu_Bar.H>
static Fl_Window* m_pWindow = NULL;
static void Tick(void*)
{
if ( m_pWindow != NULL )
{
m_pWindow->hide();
delete m_pWindow;
}
m_pWindow = new Fl_Window(0,0,100,100,"testPopup");
m_pWindow->show();
Fl::repeat_timeout(2.0f, Tick, NULL);
}
int main(int argc, char** argv)
{
Fl_Window * window = new Fl_Window(0,0,200,200);
window->begin();
Fl_Menu_Bar* c = new Fl_Menu_Bar(0,0,100,100,"test");
c->add("dummy1");
c->add("dummy2");
c->add("dummy3");
window->end();
Fl::repeat_timeout(2.0f, Tick, NULL);
window->show();
Fl::run();
}
> Jose Marcelo Auler wrote:
> > Hello!
> > I am having problem with Fl_Menu_. When the menu is open and the software
> > creates a new screen, requesting the focus, all the focus loose forever!
> > Also, in a similar situation, when I'm debugging the software and the
> > debugger stops the application exactly when menu is open, the focus is lost
> > and it doesn't come back, just when I go to terminal e kill the application
> > via keyboard the focus gets back. Does anyone have any experience with
> > something like this. Simple ideas to solve?
>
> If you're using Fl_Menu_, that's a low level widget meant to be used
> only for creating other menu widgets. If you're designing your own
> menu widget, give us more details about what it does and what approach
> you're taking.
>
> If what you're trying to do is just open a menu, use a higher level
> menu widget like Fl_Menu_Button or Fl_Menu_Bar, and don't use Fl_Menu_.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk