[lazarus] Problem found

Shane Miller SMiller1 at stvgb.org
Tue Jun 29 11:43:26 EDT 1999


Thanks for the idea.  I was hoping to find a "Delphi-like" way of handling it.  By doing that I would need to set Self = the gtk object data and that (I think) would start to cause some trouble when I wanted to remove the code from the units and place them into seperate units for GTK.....

Here's another thought.....I was in the shower this morning, like I often am, when I thought of this.  Perhaps if I used methods as the procedure to assign the signal to instead of generic procedures then perhaps it would retain it's information.  For example:

I tried to move the gtkOnChange and gtkMoveToRow procedures into the TCustomMemo class.  Once I did that I added  TCUSTOMMEMO. in front of the names of the proceures and tried to compile.  I got this error again:

ERROR: Method (variable) and Procedure (variable) are not compatable.

Is there anyway to assign a signal to a METHOD instead of an ordinary procedure?  

Shane


>>> <Jan.Schmidt at advitech.com.au> 06/28 10:58 PM >>>





Shane Miller <smiller at lakefield.net> on 29/06/99 15:14:25
I have set up TMemo to use the "changed" signal and when GTK fires that
      signal I do :
      If assigned FChanged then FChanged(Self);

Obviously when the callback is used, the connection to self is lost and
therefore it's children no longer retain their values.


You can associate an arbitrary piece of data with a GTK widget. In programming
      with GTK in the past, I have used something like

  gtk_object_set_data(widget,"Self",self)

In the signal handler you can just do

  sig_handler(Widget widget....)

    ...

    self = gtk_object_get_data(GTK_OBJECT(widget),"Self");

This works well in C, but I haven't had any reason to do it under fpc...

OR we could port gtk-- to pascal :-)



J.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jan Schmidt
Information Technologist - Business Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Advitech Pty Limited - Industry's Technology Resource Centre
1 Elizabeth Street, Tighes Hill NSW, Newcastle, Australia
PO Box 207, Mayfield 2304 NSW, Australia
Phone +61 2 49616544
Fax +61 2 49693530
http://www.advitech.com.au 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


_________________________________________________________________
     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
    archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list