-
Notifications
You must be signed in to change notification settings - Fork 0
/
listshellP.h
74 lines (62 loc) · 1.79 KB
/
listshellP.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**** listshellP.h ****/ /**** formatted with 4-column tabs ****/
/**************************************************************************
A `ListShell' object is a Motif XmList widget in a shell. The
application can specify whether the pop-up shell should disappear
or stay active when the user selects an item from the list.
Because it's in a pop-up shell, the application must call the
list-shell realize function.
Sample usage:
#include "listshell.h"
...
...
void main(argc, argv)
int argc;
char *argv[];
{
void ListSelection(), ...;
Widget topLevel, ...;
ListShell list1, list2;
Arg args[10];
int i;
static char *seasons[] = {"Winter", "Spring", "Summer", "Fall", NULL};
XtAppContext app;
topLevel = XtAppInitialize(&app, "ApplicationClass",
(XrmOptionDescList) NULL, 0,
&argc, argv, (String *) NULL, (ArgList) NULL, 0);
list1 = listShell_create(topLevel, "ApplicationClass", "listShell1",
seasons, XmSTRING_DEFAULT_CHARSET, 0, 4, listShell_STAY_UP,
listShell_WIN_MGR_DECOR);
listShell_add_callback(list1, ListSelection, 1);
list2 = listShell_create(topLevel, "ApplicationClass", "listShell2",
seasons, XmSTRING_DEFAULT_CHARSET, 0, 2, listShell_NO_STAY_UP,
listShell_MIN_WIN_MGR_DECOR);
listShell_add_callback(list2, ListSelection, 2);
...
...
XtRealizeWidget(topLevel);
listShell_realize(list1);
listShell_realize(list2);
...
...
**************************************************************************/
#ifndef _listshellP_h
#define _listshellP_h
/*
Private structure:
*/
typedef struct {
void *self;
Widget listShell;
Widget instance;
Widget class;
Widget listPane;
Widget listPort;
Widget listList;
Widget listAction;
Widget listDismissButton;
XmString *list_items;
int num_items;
int stay_up_behavior;
int is_active;
} _ListShell;
#endif /* _listshellP_h */