[lazarus] GtkInt Help

Michael A. Hess mhess at miraclec.com
Thu Jul 29 13:04:11 EDT 1999


Curtis White wrote:
> 
> Can someone please explain some things to me about how the GtkInt
> units are setup to work?

A bit confusing isn't it.  ;-)

> I am having trouble figuring out the purpose/difference between the
> different IntSendMessage procedures. Right now, there are 3
> IntSendMessage procedures and they each take different parameters. How
> do we know which one to use to do what we need?

Hopefully as things move along we can combine some of the IntSendMessage
methods into just one or 2. I created the Message3 to allow more
information to be pulled from the TControl class instead of passing a
lot of parameters. I didn't modify the other Message methods for fear of
breaking something else.
 
> I have a lot of Gtk functions I am going to need to call in the
> TNotebook component. So do I setup new methods in the GtkInt object
> for each of the different things I need to do? Or do I adapt them to
> some of the existing methods/functions? And if I adapt them to the
> existing functions, what if they need more parameters to be passed?

At this point if you need more or different parameters then are passed
in the existing Message methods, create another one. As we start
finalizing more of the components we will be able to see which is the
most likely optimized Message method structure. Then we can combine them
into 1 or 2 methods. But for now so that you don't break someone elses
code make an IntSendMessage4 if you need it.
 
> Are we only calling methods in the GtkInt object by sending messages
> with the IntSendMessage procedures and then having them call the
> methods, or are we calling methods directly?

This is the prefered method. This helps separate the class library all
the more from the GUI API being used. If you create a method that you
call directly from your unit then it just means one more thing that
needs to be addressed if we make a version for a different API. If at
all possible try to use the SendMessage method found in TControl. This
method calls the actual IntSendMessage method but since you are already
inheriting TControl it means that you don't need to place the interface
unit in your uses clause. Hopefully we can end up with TControl being
the only unit that actually does any calls to the interface unit. Again
this just helps isolate the class libraries from the GUI API.


-- 
==== 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