[lazarus] Maybe.... gtk2
Vincent Snijders
VSDS at RND.VB.CBS.NL
Mon Dec 16 02:53:13 EST 2002
> -----Original Message-----
> From: matooo at email.si [mailto:matooo at email.si]
> Sent: maandag 16 december 2002 1:49
> To: lazarus at miraclec.com
> Subject: Re: [lazarus] Maybe.... gtk2
>
<snip>
>
> One more thing or two for fpc part of the group. I needed
> interfaces for many
> times 'till now. Especialy for my non-visual components that
> are controlling
> different types of components some of them are already
> implemented by fpc and
> some are mine, but they don't share other same ancestor than
> TComponent so
> passing them as a parameter to some function is a real pain
> (typeis, typeis,
> typeis).
> 1.1 should have interfaces, when is D-Day???
> if D-Day is not sometimes soon, I would like to propose a
> little (stupid one,
> but it would ease the job) solution (if there maybe exists
> something like that I
> would be really glad if you'd let me know). because function
> is originaly empty
> I don't think it would harm anything or anybody
>
> // this way all components have some blank and usable common point,
> // it remains only one part a little function that assigns registred
> // messages so they don't duplicate and can be applied and registred
> // from everywhere, but all of the registration can be
> applied in some
> // completely different unit so nothing would interfer with current
> // state of lcl or fcl
> function TComponent.CommonInterfaceMsg(Sender: TComponent;
> Msg: longInt; Data:
> pointer): longInt;
> begin
> end;
>
> // some completely different unit
> function RegisterMsg(Msg: string): longInt;
> function GetMsgID(aMsg: string): longInt;
>
> Something like that would really shorten my sources (pros and
> contras are
> appreciated).
>
> m.
>
Why don't you use dispatch and messages. See:
http://www.freepascal.org/docs-html/ref/node8.html#SECTION03533000000000000000
More information about the Lazarus
mailing list