PtRemoveCallback

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `PtRemoveCallback`

`PtRemoveCallback` -- removes a callback.

## Syntax

    PtRemoveCallback (widget, callback_number, function)

## Arguments

`widget`

  The widget to remove the callback function from.

`callback_number`

  The callback type.

`function`

  The function to remove.

## Returns

t when successful.

## Example

This example, `ex_PtRemoveCallback.g`, is included in the `gamma_ph_`#`_examples_1_QNX4.tgz` file available on the Cogent Web Site.

    #!/usr/cogent/bin/phgamma

    /*
    This example attaches a callback to a button to start pfm (Photon File
    Manager).  After 10 seconds the callback is removed and the text on
    the face of the button is changed.
    */

    function start_pfm ()
    {
       system("pfm &");
    }

    function remove_callback (button)
    {
       button.text_string = "I no longer start PFM";
       PtRemoveCallback(but,Pt_CB_ACTIVATE,code);
    }

    PtInit(nil);
    win = new(PtWindow);
    but = new(PtButton);
    but.text_string = "Press Me to Start PFM";
    PtRealizeWidget(win);

    code = #start_pfm();

    PtAttachCallback(but,Pt_CB_ACTIVATE,code);
    after(10,#remove_callback(but));

    PtMainLoop();

## See Also

PtAttachCallback

Prev | Home | Next
`PtRealizeWidget` | Up | `PtResourceName`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.