Re: [gtk-list] NEWBIE: Getting a Handle to an entry.



Hi Matt !

>I am building a dialog based application in which there are three text
>fields (entries). I am trying to implement a Clear button that clears
>all of those fields. I understand how to use gtk_signal_connect to
>connect to a callback function and pass data (which would be an entry)
>to that callback, but I am unsure as to how I can pass three entries to
>that callback so that I can set them all to an empty string.
>
>I would prefer to learn how to get a handle to the particular object
>whether entry or anything else (e.g. checkbox, radio, etc.). I am
>guessing that, if it is actually possible, you can do this by accessing
>the children of the parent window and then testing for the Widget type,
>but I am not sure how to do that. I can't find anything in the GTK
>Tutorial that explains


    The GTK programmer interface does not use handles (GTK is not
    Windows). Instead, it uses pointers to widgets. 

    When you create your entries, just add them to a GList. Then pass
    the glist object as the data argument of your gtk_signal_connect()
    call.
    In your callback, all you'll have to do is to run through the list and
    empty them.

    Check out the FAQ on gtk.org for a brief explaination on working
    with GList if you don't know how to do that.

    Yours,

    pixel@epita.fr
>
>Any pointers, tips, etc.
>
>Thanks in advance.
>
>-Matt




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]