Re: the inner view class of Dialog

2005-06-20 Thread Duke Briscoe
In both cases of your code, the dialogs do not yet have associated Views 
because they have not been shown yet, so get-view is returning null.


I think you should follow Friedger's advice which was "Note that 
dialog.show will create a new view whenever it is shown.  I would write 
a subclass that has one instance of View that is always reused when the 
dialog should be shown."


takanobu maekawa wrote:


Hi gurus,


If you need to get to the view created by dialog.show, you can use
code like this:

{on ae:AttachEvent at v:Visual do
{dump {v.get-view}} || Here is where you can access the view
}

A good place for it might be the outermost object in the dialog,
but it could be on almost any object shown in the dialog.

  - Mike



I have been trying according to your advise, but I can't.
I'm getting confused.

the following is the code I used for trying.
Please tell me what is wrong to get the view class of Dialog.
Or, after all, is it impossible with Dialog as Friedger said?
--

||
||the first class I had expected to run with no problem
||(but it doesn't run with Dialog's view)
||
{define-class public AAA
  field private v:#View

  || need a View class
  || expects to get the View class from Dialog with {Dialog.get-view}
  ||
  {constructor public {default v:#View}
set self.v = v
  }

  {method public {show}
{self.v.show}
  }
}


||
||the second class that I tried according to Mike's advise.
||
{define-class public BBB
  field private v:#View
  {constructor public {default v:#Visual}

{v.add-event-handler
  {on ae:AttachEvent at vs:Visual do
set self.v = {vs.get-view}
  }
}
  }

  {method public {show}
{self.v.show}
  }
}


{do
  let d:Dialog = {Dialog}
  let v:VBox = {VBox "I am one."}
  {d.add v}

  let d2:Dialog = {Dialog}
  let v2:VBox = {VBox "I am here."}
  {d2.add v2}

  let a:AAA = {AAA {d.get-view}}
  let b:BBB = {BBB d2}

  ||the both bellow lines cause NullDereferenceException
  {a.show}
  {b.show}
}
--

Regards.

--Takanobu Maekawa


***
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]



***
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]



Re: the inner view class of Dialog

2005-06-18 Thread takanobu maekawa

Hi gurus,


If you need to get to the view created by dialog.show, you can use
code like this:

{on ae:AttachEvent at v:Visual do
{dump {v.get-view}} || Here is where you can access the view
}

A good place for it might be the outermost object in the dialog,
but it could be on almost any object shown in the dialog.

  - Mike


I have been trying according to your advise, but I can't.
I'm getting confused.

the following is the code I used for trying.
Please tell me what is wrong to get the view class of Dialog.
Or, after all, is it impossible with Dialog as Friedger said?
--

||
||the first class I had expected to run with no problem
||(but it doesn't run with Dialog's view)
||
{define-class public AAA
  field private v:#View

  || need a View class
  || expects to get the View class from Dialog with {Dialog.get-view}
  ||
  {constructor public {default v:#View}
set self.v = v
  }

  {method public {show}
{self.v.show}
  }
}


||
||the second class that I tried according to Mike's advise.
||
{define-class public BBB
  field private v:#View
  {constructor public {default v:#Visual}

{v.add-event-handler
  {on ae:AttachEvent at vs:Visual do
set self.v = {vs.get-view}
  }
}
  }

  {method public {show}
{self.v.show}
  }
}


{do
  let d:Dialog = {Dialog}
  let v:VBox = {VBox "I am one."}
  {d.add v}

  let d2:Dialog = {Dialog}
  let v2:VBox = {VBox "I am here."}
  {d2.add v2}

  let a:AAA = {AAA {d.get-view}}
  let b:BBB = {BBB d2}

  ||the both bellow lines cause NullDereferenceException
  {a.show}
  {b.show}
}
--

Regards.

--Takanobu Maekawa


***
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]



Re: the inner view class of Dialog

2005-06-13 Thread Michael Gordon
If you need to get to the view created by dialog.show, you can use
code like this:

{on ae:AttachEvent at v:Visual do
{dump {v.get-view}} || Here is where you can access the view
}

A good place for it might be the outermost object in the dialog,
but it could be on almost any object shown in the dialog.

  - Mike


--- [EMAIL PROTECTED](B <[EMAIL PROTECTED]> wrote:

> Hi gurus,
> 
> Perhaps as you know,
> Dialog.get-view seems not to return the valid View's instance before
> it is called with {Dialog.show} method.
> 
> I didn't know that fact and have designed a class
> which is a very important in the system my team is developping.
> 
> The class requires a View class's instance for its default constructor,
> because the class wants to operate the other class's window remotely
> as it want to do.
> 
> Is there any event or something to get the Dialog's valid View class
> instance before {Dialog.show}?
> Otherwise is there any alternative way?
> 
> Please tell me about this issue.
> Regards.
> 
> -- 
> -
> Maekawa Takanobu
> e-mail:[EMAIL PROTECTED]
> CANSOFT,INC.Tel:044(969)9747 Fax:044(969)9748
> http://www.cansoft.co.jp/
> 
> ***
> To unsubscribe from this list, send a mail to:
> mailto:[EMAIL PROTECTED]
> To contact a human list administrator, send a mail to:
> mailto:[EMAIL PROTECTED]
> To recieve a list of other options for this list, send a mail to:
> mailto:[EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

***
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]



Re: the inner view class of Dialog

2005-06-13 Thread Friedger

> Is there any event or something to get the Dialog's valid View class
> instance before {Dialog.show}?
> Otherwise is there any alternative way?
Note that dialog.show will create a new view whenever it is shown.
I would write a subclass that has one instance of View that is always
reused when the dialog should be shown.

Friedger

***
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]

the inner view class of Dialog

2005-06-13 Thread =?ISO-2022-JP?B?GyRCQTBAbjV9P04bKEI=?=
Hi gurus,

Perhaps as you know,
Dialog.get-view seems not to return the valid View's instance before
it is called with {Dialog.show} method.

I didn't know that fact and have designed a class
which is a very important in the system my team is developping.

The class requires a View class's instance for its default constructor,
because the class wants to operate the other class's window remotely
as it want to do.

Is there any event or something to get the Dialog's valid View class
instance before {Dialog.show}?
Otherwise is there any alternative way?

Please tell me about this issue.
Regards.

-- 
-
Maekawa Takanobu
e-mail:[EMAIL PROTECTED]
CANSOFT,INC.Tel:044(969)9747 Fax:044(969)9748
http://www.cansoft.co.jp/

***
To unsubscribe from this list, send a mail to:
mailto:[EMAIL PROTECTED]
To contact a human list administrator, send a mail to:
mailto:[EMAIL PROTECTED]
To recieve a list of other options for this list, send a mail to:
mailto:[EMAIL PROTECTED]