[lazarus] Patches to Shanes files

Michael A. Hess mhess at miraclec.com
Wed Jul 7 16:02:25 EDT 1999


Shane Miller wrote:
> 
> OK, i am still having that problem so any help would be appreciated.

I'll start to look at it.
 
> Tell me why this wouldn't be better.


> TMsg : record
>   Name : String;
>   Sender : TControl;
>   end;
> pMsg = ^TMsg;
> 
> Var
>  Msg : pMsg;
> 
> Begin
> 
> Msg.Name := Signal;
> Msg.Sender := Sender;
> 
> gtk_signal_connect(gobject,gsignal,gtk_signal_func(GlobalSignalFunction), Msg)

No this won't work. I thought about this when I was doing it ans it
would be nice but no.

The information that is being passed to the gti_signal_connect in the
Msg variable is a pointer. Not the actual information but a pointer TO
the information.

If you wanted to pass a pointer to a record as shown above, then you
would have to alloc memory for each one of those separately for every
signal that you are sending. The problem is that you need to free that
memory at a later time. However, we don't have a connection between a
signal that needs to be destroyed and the message pointer so we can't
tell which one that was created that needs to be freed.

So basically no we can't do it this way.

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list