Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-07

Events.

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller
>> The Software Company 07/22 1:45 AM >>>

I am having a few problems with the messages. Could some please explain how they work and if there is any catch that I should be aware of.

I Used the method used in buttons.pp. The difference is that I am applying them to TCombobox. How will this effect the events???

>>>>>

brent,

The messages are quite simple once you understand how they work. Each widget has certain messages (signals in GTK) that are sent to it. For example, the BUTTON widget gets a 'clicked' event. Notice, in the difinition for the class, there is a procedure....

Procedure DoClicked(var msg); message LM_CLICKED;
It is connected to that message by the call in TButton.Create SetCallBack(LM_CLICKED);

This is the procedure that receives the "HEY, the button was clicked!" message.

If you go and examine that Procedure, you'll notice that all it does is check to see if the user has assigned a procedure to the FOnCLicked property. The user does this by saying (after they crseate the button)

Button1.OnClicked := @ButtonClicked;

ButtonCLicked is a procedure defined by the user as

PRocedure ButtonClicked(Sender : TObject);

So, when the button is pressed, DoCLicked is called which calls ButtonClicked. If you need to add a message to a NEW component, see what widget you will be using, go to www.gtk.org and look at the gtk reference material and determine what signals it can handle.

Hope this helps....

Shane

Reply by email

The Software Company

I am having a few problems with the messages. Could some please explain how they work and if there is any catch that I should be aware of.
�
I Used the method used in buttons.pp. The difference is that I am applying them to TCombobox. How will this effect the events??? �
Brent.
�
May the source be with you!

Reply by email