On 02/01/12 09:31, Forough Mehralian wrote:
> thanks for your help but I don't know what to write in my
> callback and how should I understand which scroll bar was moved
> and then how should I add my all labels to just e.g. vertical scroll bar?

        (Please follow up to the group though, not just in private email,
        so the thread doesn't splinter into private email)

        Fl_Scroll is really a group with two Fl_Scrollbar's in it.
        Each of Fl_Scroll's scrollbars is accessible via Fl_Scroll's API;

        scroll->scrollbar();    // the vertical scrollbar
        scroll->hscrollbar();   // the horiz scrollbar

        Each Fl_Scrollbar has a callback() that you can set to
        point to your own callback. Be sure to preserve the old
        callback() so that when your callback takes control to do
        what it needs, it can also call the original callback (if any)
        so that Fl_Scroll can do what IT needs with it.

        To do the idea I was describing (which I can't really recommend,
        you should really use Fl_Table instead) is to create a widget
        arrangement like this:

--------------------------------------------------------------------
| Fl_Group col_head                                                |
--------------------------------------------------------------------
|                   |                                              |
|                   |                                              |
|                   |                                              |
| Fl_Group row_head | Fl_Scroll with your input widgets            |
|                   |                                              |
|                   |                                              |
|                   |                                              |
|                   |                                              |
--------------------------------------------------------------------

        ..and set the Fl_Scroll's scrollbar callbacks to rearrange
        the col_head and row_head widgets to display headers that
        properly 'line up' with your scrolled content.

        This is NOT easy to do, though.. this is basically trying
        to emulate what Fl_Table does with a simplified hack.

> we are using FLTK 1 not 3..

        I'm not suggesting FLTK 3, I'm suggesting FLTK 1, specifically FLTK 
1.3.x
        which is compatible with 1.x.x.

> .. and in this there is not something like scroll_to

        By having access to Fl_Scroll's two scrollbar widgets, you can
        access all the methods of both scrollbars, because they're public.

> what may cause my chart to display just one time (what are the possible 
> problems if you know)?

        Again, no idea.
        It could be any of a number of things, would have to see code.

        The order of creation of the chart widget in the window,
        the use of begin() and end(), the toggling of hide() vs show(),
        the position of the child in the parent window, and many other reasons.


_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to