PtRemoveCallback (widget, callback_number, function)
The widget to remove the callback function from.
The callback type.
The function to remove.
This example, ex_PtRemoveCallback.g, is included in the product distribution.
#!/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();
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.