PtUnrealizeWidget (widget)
This function makes a widget disappear. Actions associated with the widget are no longer available to the user. This function does not destroy the widget, it only hides it.
This example, ex_PtUnrealizeWidget.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma
/*
This example creates a small window with a button in it. The every()
and at() functions are used to create timers to realize and unrealize
the button every 2 seconds, and change the label correspondingly.
*/
require_lisp("PhotonWidgets");
PtInit(nil);
win = new(PtWindow);
win.SetDim(220, 150);
b = new(PtButton);
b.text_string = "The button is visible";
b.SetPos(40, 60);
label1 = new(PtLabel);
label1.SetPos(20,15);
label1.text_string = string("The button will realize and\n",
"unrealize every 2 seconds.");
label2 = new(PtLabel);
label2.SetPos(70,100);
label2.text_string = "Realized";
PtExtentWidget(win);
PtRealizeWidget(win);
function realize_wgt(wgt, label, secs)
{
PtRealizeWidget(wgt);
label.text_string = "Realized";
after(secs, `unrealize_wgt(@wgt, @label));
}
function unrealize_wgt(wgt, label)
{
PtUnrealizeWidget(wgt);
label.text_string = "Unrealized";
}
after(2, `unrealize_wgt(b, label2));
every(4,#realize_wgt(b, label2, 2));
PtMainLoop();
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.