
On get, the arguments remain the same, the array passed in gets filled in by the PANEL_LIST
package. The return value is the number of rows that were successfully filled in.
Example D-3 shows a portion of a program which uses the new PANEL_LIST insertion
method.
Example D-3. Program that adds values to a panel list
/*
* Demonstrate the use of the PANEL_LIST_ROW_VALUES attribute
*/
#include <stdio.h>
#include <xview/xview.h>
#include <xview/font.h>
#include <xview/panel.h>
static Attr_attribute MY_KEY;
static void my_clear_proc();
static void my_load_proc();
static void my_print_proc();
typedef struct {
Frame frame;
Panel_list_item list;
Xv_font font;
} My_ui;
void
main ( argc, argv )
int argc;
char **argv;
{
Panel panel;
My_ui ui;
(void) xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
MY_KEY = xv_unique_key();
ui.frame = xv_create ( XV_NULL, FRAME,
XV_LABEL, "New Load",
FRAME_SHOW_FOOTER, TRUE,
NULL );
panel = xv_create ( ui.frame, PANEL, NULL );
(void) xv_create ( panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Load",
PANEL_NOTIFY_PROC, my_load_proc,
XV_KEY_DATA, MY_KEY, &ui,
NULL );
(void) xv_create ( panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Clear",
692 Version 3.2 and the File Chooser