home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume10
/
xt-examples
/
part02
/
fragments
/
extension.c
< prev
next >
Wrap
Text File
|
1990-11-04
|
2KB
|
50 lines
/***********************************************************
Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute these examples for any
purpose and without fee is hereby granted, provided that the above
copyright notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting documentation,
and that the name of Digital not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
DIGITAL AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT
OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
void MyDefineQueryMinimumSize(widget_class, proc)
WidgetClass widget_class;
MinimumSizeProc proc;
{
static Quark myWidgetSet = NULLQUARK;
MyCoreClassExtension extension;
if (myWidgetSet == NULLQUARK) {
myWidgetSet = XrmStringToQuark("MY_WIDGET_SET");
}
for (extension = widget_class->core_class.extension;
extension != NULL && extension->record_type != myWidgetSet;
extension = extension->next_extension) {}
if (extension == NULL) {
extension = XtNew(MyCoreClassExtensionRec);
extension->next_extension = widget_class->core_class.extension;
widget_class->core_class.extension = extension;
extension->record_type = myWidgetSet;
extension->version = @i[something];
extension->record_size = sizeof(MyCoreClassExtensionRec);
}
extension->query_minimum_size = proc;
}