Hi,

 What I suggest does not need to use CD to draw on the canvas. The idea is
to use the canvas just to handle mouse messages, and use BGCOLOR to set a
background color for the handler.

 Something like this:

IupCbox(
   IupVbox(
      IupCanvas(NULL),
      IupText(NULL),
      NULL),
   NULL);

If the cbox is not occupying the whole dialog then you can place it inside
a IupFrame or a IupBackgroundBox, so you can set the background to white.

Then set BGCOLOR of the IupCanvas to something different then white to use
it as a handler, to move the vbox around the cbox.

You must set CX and CY on the vbox so it will be positioned inside the cbox.

Then implement the button_cb and motion_cb callbacks of the canvas, and use
the drag delta of the canvas to change cx and cy. Take a look at the source
code of the IupSbox or the IupSplit that both use this same approach to
implement a moving handler.

Best,
Scuri





On Sat, Aug 16, 2014 at 12:51 PM, Karagy <[email protected]> wrote:

> I ran this example using iuplua5.1.exe version 3.11.
>
> 8/16/2014 18:16, Milind Gupta пишет:
> > Hi Karagy,
> >            Thanks for looking at it. I tried running the file you send
> but I
> > get the following error:
> >
> > lua: cd_buttons.wlua:112: attempt to call field 'backgroundbox' (a nil
> > value)
> > stack traceback:
> >          cd_buttons.wlua:112: in main chunk
> >          [C]: ?
> >
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to