[comp.windows.x] Need help with Wcl

apple@nprdc.navy.mil (Jim Apple) (03/21/91)

	I'm trying associate a "C" structure with a XmList widget.  
In the examples the resource "*slist" is used, however I need to 
get the list from a database query.  

	I've tried all the obvious stuff ( I think ),  am I missing
something ?? or is this something that Wcl can't handle ??

Any help would be great

Thanks in advance


	Jim Apple 			apple@nprdc.navy.mil
	WB1DOG				...}ucsd!nprdc!apple

randy@erik.UUCP (Randy Brown) (03/22/91)

	From: uunet!nprdc.navy.mil!apple (Jim Apple)
	Message-Id: <13611@arctic.nprdc.navy.mil>

	In the examples the resource "*slist" is used, however I need to 
	get the list from a database query.  

		I've tried all the obvious stuff ( I think ),  am I missing
	something ?? or is this something that Wcl can't handle ??

If you need to query only at widget creation time, use wcCallback to 
specify a callback routine (which you must write and register with Wcl).
This callback will be called by Wcl once only just after the widget is
created.  YOu may then do your query and use XtSetValues to set the 
items and related resources.

Alternatively, if you so far need only Mri and don't want to add that
first user-supplied callback, you can run a separate program first to 
do the database query and store the resources you need in the display's
resource database, something like this:

	# store results of query in Xrm database
	dbquery -display aDisplayName -classname Foo query-parameters 
		creates resources like Foo*list1.items
		                       Foo*list1.itemcount
		                       Foo*list2.items
	# display & interact with results of query
	foo -display aDisplayname

where foo is a link to or a copy of Mri; the application class is generated
by Mri by changing the case of the first letter of argv[0].