Sponsored Content
The Lounge What is on Your Mind? How can I get some interesting books? Post 77150 by virmin on Tuesday 5th of July 2005 07:51:48 AM
Old 07-05-2005
Computer

Thank u so much. By the way, I am a c programmer.
 

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

interesting problem

After a server reboot for regular mainatanance we face the following situation: 1/ user accounts with ksh can't start the korn shell 2/ korn shell scripts do work however, if executed from bash 3/ normal users with bash can't run ksh 4/ root can run ksh 5/ if I switch the default shell to... (3 Replies)
Discussion started by: rein
3 Replies

2. UNIX for Dummies Questions & Answers

Some interesting questions

Hello All, I have some questions; 1) process1 | process2, A)now if I kill process2 what happens to process1? B) if I kill process1 what happens to process2? 2) Why kill -9 is a strong kill? If possible I would like to know what happens internally. 3) What a pipe actually do, in... (3 Replies)
Discussion started by: willhunter
3 Replies

3. UNIX for Dummies Questions & Answers

Interesting question :-D

first off, i LOVE unix to death, but i really only like the text/console side of it. im not big into the XFree86/Xwindows side of things.. so with that known... im in search of really old *nix's.. like way outdated, floppy OS's from way back in the day. im kinda in search of the pure'r UNIX's.... (0 Replies)
Discussion started by: 01000101
0 Replies

4. Shell Programming and Scripting

Here is an interesting idea...

Does anyone know how to test if an ethernet interface is alive, or accepting connections? Here is the scenario - I have rsc and sc console interfaces on some Suns. There are some sporadic vulnerability scans that send them out to lunch when they run the scans. I have to login to the host and reset... (0 Replies)
Discussion started by: lm_admin_dh
0 Replies
get_values_hook()														 get_values_hook()

Name
  get_values_hook - Object class method for obtaining values of resources that do not appear in the resource list.

Synopsis
  typedef void (*XtArgsProc)(Widget, ArgList, Cardinal *);
	 Widget w;
	 ArgList args;
	 Cardinal *num_args;

Inputs
  w	    Specifies the widget or object that is having its resources queried.

  args	    Specifies the argument list that was passed to XtGetValues().

  num_args  Specifies the number of arguments in the argument list.

Description
  The get_values_hook() method is registered on the get_values_hook field of the Object, RectObj, or Core class part structure, and is called
  by XtGetValues() to give the widget a chance to supply the value of any resources that do not appear in  the	widget's  resource  list  (by
  calling XtGetSubvalues() on a subpart, for example) or to modify any of the returned values.

  The  get_values_hook()  method  is  chained  in  superclass-to-subclass  order,  and	cannot	be  inherited.	 Classes  that	do not need a
  get_value_hook() method should specify NULL in the get_values_hook field of their class structure.

  See XtGetValues(1) for more information on when this method is invoked.

Usage
  If a widget or object has subparts with resources that do not appear in the resource list of the object itself, it  can  use	the  get_val-
  ues_hook()  method to call XtGetSubvalues() passing a pointer to the subpart, the subpart resource list, and the args and num_args argument
  list.  Using this technique, the application programmer will be able to query the value of subpart resources as if they were normal  widget
  resources.

  Note	that  since the Object class was added in Release 4, it is often easier to use objects rather than subparts, because objects get more
  automatic resource handling by the Intrinsics than subparts do.  A get_values_hook() procedure is not limited to calling  XtGetSubvalues();
  it  can call XtGetValues() on a widget or object, as shown in the examples below.  When using objects rather than subparts, it is also pos-
  sible to give the application programmer direct control over creating those objects.	If the programmer keeps  a  pointer  to  the  created
  object, then she can directly set and query the resource values of the object, and no get_values_hook() is necessary in the parent.

  The get_values_hook() method can also be used to modify the resource values in args that would otherwise be returned to the user.  A widget
  that displays a string, for example, might want to return a copy of that string to the programmer rather than the string itself, so that if
  the  programmer  modifies the string, the widget will not be affected.  Widgets that use the get_values_hook() method in this way should be
  sure to document which resources are copied in this way and must be freed by the user.  (None of the Intrinsics widgets nor the Xaw widgets
  do this.)

  Note that the get_values_hook() method is not obsolete as are the other hook methods, initialize_hook() and set_values_hook().

Example
  The two procedures below are the get_values_hook() methods of the Xaw Dialog and Xaw Text widget classes.  Note that both use XtGetValues()
  to obtain resources of a child widget or object, which they "export" as one of their own resources.

  The Dialog method checks the incoming argument list for a resource named XtNvalue, and only queries the child  for  that  single  resource.
  The Text method simply passes the entire argument list in XtGetValues() calls to two different child objects.  This method assumes that the
  Text widget and its two children objects do not have any resources by the same name, so there is not potential  for  name  conflicts.   The
  Text	widget	controls  the  types  of  its  subobjects,  so this is a reasonable assumption.  Since all objects have an XtNdestroyCallback
  resource, however, if you were to query the value of this resource for the Text widget, you would get the callback  list  for  one  of  its
  internal  objects  instead.	(This  is not a practical problem because the callback list is in an internal compiled form and should not be
  queried anyway.)

     static void
     GetValuesHook(w, args, num_args)
     Widget w;
     ArgList args;
     Cardinal * num_args;
     {
       Arg a[1];
       String s;
       DialogWidget src = (DialogWidget) w;
       register int i;

       for (i=0; i < *num_args; i++)
	 if (streq(args[i].name, XtNvalue)) {
	   XtSetArg(a[0], XtNstring, &s);
	   XtGetValues(src->dialog.valueW, a, 1);
	   *((char **) args[i].value) = s;
	 }
     }

     static void
     GetValuesHook(w, args, num_args)
     Widget w;
     ArgList args;
     Cardinal * num_args;
     {
       XtGetValues( ((TextWidget) w)->text.source, args, *num_args );
       XtGetValues( ((TextWidget) w)->text.sink, args, *num_args );
     }

See Also
  XtGetSubvalues(1), XtGetValues(1),
  Core(3).

Xt - Intrinsics Methods 													 get_values_hook()
All times are GMT -4. The time now is 08:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy