Background wx_object set_id/2

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Background wx_object set_id/2

Frans Schneider-2
Dear list,

I am wondering what purpose the wx_object:set_pid/2 function serves? Why
would one use this?

Thanks,

Frans
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Background wx_object set_id/2

Dan Gudmundsson-2
If you use wx_object module the pid is used to access the corresponding erlang process/server.

If you fetch the "object" from wxWidgets for example 
from Parent = wxWindow:getParent(Window) you will get an object without the pid set and you can manually set it with wx_object:set_pid/2.

/Dan

On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider <[hidden email]> wrote:
Dear list,

I am wondering what purpose the wx_object:set_pid/2 function serves? Why
would one use this?

Thanks,

Frans
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Background wx_object set_id/2

Frans Schneider-2
I am not really sure I get the full picture yet. So, it is not tinkering
with the wx_object process itself but just sets an attribute in the data
structure of the wxWidget object? But why are the wx_object functions
stop, call and cast using that Pid than?

Frans

On 08/06/2018 02:29 PM, Dan Gudmundsson wrote:

> If you use wx_object module the pid is used to access the corresponding
> erlang process/server.
>
> If you fetch the "object" from wxWidgets for example
> from Parent = wxWindow:getParent(Window) you will get an object without
> the pid set and you can manually set it with wx_object:set_pid/2.
>
> /Dan
>
> On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Dear list,
>
>     I am wondering what purpose the wx_object:set_pid/2 function serves?
>     Why
>     would one use this?
>
>     Thanks,
>
>     Frans
>     _______________________________________________
>     erlang-questions mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Background wx_object set_id/2

Dan Gudmundsson-2
On Mon, Aug 6, 2018 at 2:56 PM Frans Schneider <[hidden email]> wrote:
I am not really sure I get the full picture yet. So, it is not tinkering
with the wx_object process itself but just sets an attribute in the data
structure of the wxWidget object?

Yes
 
But why are the wx_object functions
stop, call and cast using that Pid than?

I don't think I understand the question, stop, call and cast needs to know which pid to send the messages to.

Normally the pid attribute is set in wx_object init before it is returned to the user.

But if you get the wxWidget object via another call to wx the pid attribute may not be set, and this gave an option to associate the pid with the wxWidgets object without tinkering with internal opaque record.

I needed to set it somewhere/sometime and added the function so I could keep the record definition internal to wx.

/Dan
 

Frans

On 08/06/2018 02:29 PM, Dan Gudmundsson wrote:
> If you use wx_object module the pid is used to access the corresponding
> erlang process/server.
>
> If you fetch the "object" from wxWidgets for example
> from Parent = wxWindow:getParent(Window) you will get an object without
> the pid set and you can manually set it with wx_object:set_pid/2.
>
> /Dan
>
> On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Dear list,
>
>     I am wondering what purpose the wx_object:set_pid/2 function serves?
>     Why
>     would one use this?
>
>     Thanks,
>
>     Frans
>     _______________________________________________
>     erlang-questions mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://erlang.org/mailman/listinfo/erlang-questions
>

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Background wx_object set_id/2

Frans Schneider-2
Thanks Dan, clear now. Somehow the mentioning of setting a controlling
process in the documentation made me expect something more magic.

Frans

On 08/06/2018 03:27 PM, Dan Gudmundsson wrote:

> On Mon, Aug 6, 2018 at 2:56 PM Frans Schneider <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I am not really sure I get the full picture yet. So, it is not
>     tinkering
>     with the wx_object process itself but just sets an attribute in the
>     data
>     structure of the wxWidget object?
>
>
> Yes
>
>     But why are the wx_object functions
>     stop, call and cast using that Pid than?
>
>
> I don't think I understand the question, stop, call and cast needs to
> know which pid to send the messages to.
>
> Normally the pid attribute is set in wx_object init before it is
> returned to the user.
>
> But if you get the wxWidget object via another call to wx the pid
> attribute may not be set, and this gave an option to associate the pid
> with the wxWidgets object without tinkering with internal opaque record.
>
> I needed to set it somewhere/sometime and added the function so I could
> keep the record definition internal to wx.
>
> /Dan
>
>
>     Frans
>
>     On 08/06/2018 02:29 PM, Dan Gudmundsson wrote:
>      > If you use wx_object module the pid is used to access the
>     corresponding
>      > erlang process/server.
>      >
>      > If you fetch the "object" from wxWidgets for example
>      > from Parent = wxWindow:getParent(Window) you will get an object
>     without
>      > the pid set and you can manually set it with wx_object:set_pid/2.
>      >
>      > /Dan
>      >
>      > On Mon, Aug 6, 2018 at 1:42 PM Frans Schneider
>     <[hidden email] <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>>
>     wrote:
>      >
>      >     Dear list,
>      >
>      >     I am wondering what purpose the wx_object:set_pid/2 function
>     serves?
>      >     Why
>      >     would one use this?
>      >
>      >     Thanks,
>      >
>      >     Frans
>      >     _______________________________________________
>      >     erlang-questions mailing list
>      > [hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > http://erlang.org/mailman/listinfo/erlang-questions
>      >
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions