Can Widgets point to free-form data?



  
  Can an instance of a widget carry around (a pointer to) a chunk 
of free-form, user-defined data, in its "pocket"?  
  
  For example say I have a combo box to choose a file.  Whenever a new
file is picked, a callback examines the file's structure and sets an
integer accordingly.
  Then, I'd like the widget to remember what type of file it found
*without* having to re-read the same file every time, by accessing its
filetype-integer. Some local continuity data between all its callbacks. 
  (And without having to define a whole new species of widget for one
pointer-to-an-integer.)
  
  If it doesn't exist, it would be very simple to add in principle, just
have a generic pointer in the primal typedef struct of `widget`:
{ .  .  .
  gpointer freedata; 
  .  .  .
} 
   
  It couldn't possibly interfere with anything, unless the programmer was
an idiot with pointers, in which case all hope is lost anyway. ;)
  
  John  
  
  
  

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]