PtWidgetChildren (widget)
This example, ex_PtWidgetChildren.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma /* The following example makes a window with a pane and a label, and prints the output of PtWidgetChildren() for the pane widget. It then prints the function output for the label widget, which is nil, as it has no children. */ require_lisp("PhotonWidgets"); PtInit(nil); win = new(PtWindow); win.SetDim(150,150); /* but = new(PtButton); but.text_string = "A button."; */ pane = new(PtPane); pane.SetArea(20,20,100,100); pane.fill_color = PgRGB(160,190,160); label = new(PtLabel); label.SetPos(25,25); label.text_string = "A label."; PtRealizeWidget(win); pretty_princ("\nThe children of the ", class_name(pane), " are:\n", PtWidgetChildren(pane),"\n"); pretty_princ("\nThe children of the ", class_name(label), " are:\n", PtWidgetChildren(label),"\n"); PtMainLoop();
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.