I'm using fltk-1.1.7 version.

I'm doing something like
I create a new window (base class Fl_Double_Window).class name is CMyClass. 
This class contains complete view area.
Now in constructor of this class i creates  menu, buttons(below menu), and 2 
more view classes (View1 and View2 both derived from Fl_Double_Window). i.e. in 
some part of main view window is view1 and view2.

If i don't use following line in CMyClass::draw() function then menu and button 
areas display black.
Fl_Double_Window::draw()

Now there is not important code in CMyClass::draw().
But code in View1::draw() and view2::draw() is like

In view1 user can draw a line. and in view2 an image is display.
Code in view1 and view2 is

view1::draw()
{
     make_current();
     Fl_Double_Window::draw();
     fl_line(px,py,cx,cy);
where px,py are previous point. cx,cy are current points. I took these in mouse 
click,drag and release functions.

}

view2::draw()
{
make_current();
     Fl_Double_Window::draw();

// here i create a image class object and load in view(by using bitmap)
}

Now when i run program and draw the lines then flickering occur.
If i remove the code Fl_Double_Window::draw() in draw function of both 
classes(view1 and view2) then i get new problem.
When i just move the mouse on outside view area(in main view window: CMyClass) 
without drawing any line then both view windows(view1 and view2) becomes empty.
If i click on any view window then their data display again.
I'm new to FLTK so please give any link for its documentation and some programs.
>
> > void MyClass::draw()
> > {
> >     make_current();
> >     Fl_Double_Window::draw();
> >=20
> >    // here is the code to draw lines using fl_line function
> > ..
> > ..
> > }
>
>
> I think you need to give us more context - such as what is in your draw
> method, and how you are calling it. You are *not* calling draw directly,
> I hope!?
>
> Also, which version of fltk, what platform etc...
>
>
> > void MyClass::draw()
> > {
> >     make_current();
>
>
> Ooh, no! You really should not call make_current from within the draw
> method... The draw method will only be scheduled when the correct window
> *is* current - calling make_current in that state is unlikely to be a
> Good Thing...!
>
> >=20
> > if(count=3D=3D0)
> > {
> >    Fl_Double_Window::draw();   //  call only once
> >    count++;
>
> Why only call the base class draw the first time? I would think it is
> generally a Good Thing to call the base class methid every time, uless
> there is some specific reason NOT to do so.
>
>
> 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-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to