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

Re: Access Canvas from Modeless Dialog? Lessons Learned'



Tom Hilinski wrote:
> 
> Mathias has the solution I would use, though I would modify it slightly to make it more const-correct:
> 
> class MyDialog : public vDialog
> {
> public:
>     MyDialog (
>         const vBaseWindow* baseWindow,
>         const char* title,
>         const MyCmdWindow* pParent)
>         : cmdWin (pParent),
>           vDialog (baseWindow, 0, title)
>     {
>         // constructor code here
>     }
> 
> private:
>     const MyCmdWindow* cmdWin;
> };
> 
> cheers... Tom Hilinski
> 
> ----- Original Message -----
> From: Matthias Klingel <gh31@mailhost.rz.uni-karlsruhe.de>
Ouch, Ouch. It hurts when you shoot yourself in the foot. I could not figure out
why this would not work, until I compared some of the v/test files with those I
had generated from Appgen. I had been incorrectly entering my working directory
into the HOMEV field instead of "v's home". Big difference!

This already sets up a pointer to _myCmdWin in the modeless dialog constructor.
The Canvas object is declared in cmdw.h, but is private. Lazy, lazy Phil moved
it to public. I can send text to the TextCanvas by:

_myCmdWin->ETCanvas->DrawText("alsdj;\n");

How bad is having the canvas public?

Phil

--
pmoors@phillips.com | Speaking for himself only.
--------------------------------------------------------
Don't get mad;  get congruent to zero mod two.


Reply to: