[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] SV: SV: some gem question



> From: Miro Kropacek [mikro@hysteria.sk]
> Sent: 2005-10-02 13:34:48 CEST
>
> I'm not sure if I understand you correctly - do you mean something like 
> this?

Rather something like this:

x_graf_slidebox()
{
   EVENT e;

   while mousebutton is not released
   {
      e = evnt_multi();

      if mouse is moved (use evnt_multi to watch a rectangle that's just one pixel wide in the direction the slider moves)
         move slider;

      if any other event
         eventhandler(e); (the eventhandler you normally call from the main evnt_multi-loop)
   }
}

You then call x_graf_slidebox() whenever the mousebutton is clicked (but not released ofcourse) on a slider-object.

I haven't implemented a slider this way, but I did this to implement a multitasking-friendly version of graf_watchbox(), and it works very well.

Jo Even