[erlang-questions] Background wx_object set_id/2
Mon Aug 6 15:27:45 CEST 2018
On Mon, Aug 6, 2018 at 2:56 PM Frans Schneider <fchschneider@REDACTED>
> 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?
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.
> 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 <fchschneider@REDACTED
> > <mailto:fchschneider@REDACTED>> 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
> > erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> > http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions