Title: | DECWINDOWS 26-JAN-89 to 29-NOV-90 |
Notice: | See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit |
Moderator: | STAR::VATNE |
Created: | Mon Oct 30 1989 |
Last Modified: | Mon Dec 31 1990 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3726 |
Total number of notes: | 19516 |
I have been trying to peek into the widget actions stored in the widget class record. I have actually managed to dump out the names of the actions, however, the format of the action tables is not as specified in the class record. Within the class record the Actions list is specified as ActionList actions There seems to be an extra long word inserted within the table after it is compiled at Widget class initialisation. Is this documented?? Steve PS Just for interest the code is posted as reply 1 to this note. It has to be recompiled to display the actions for each widget. Since it is hacked I won't be held responsible for any failures.
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1936.1 | Show_Widget_Actions.c | ISOSPN::HIRST | Lean, Mean, Fast | Mon Dec 18 1989 10:12 | 57 |
#include <decw$include:dwtappl.h> #include <decw$include:dwtwidget.h> main( int argc, char *argv[] ) { TextWidgetRec asdf; struct _TextRec *w; Widget shell; struct _CoreClassPart *class; int i, n_act; /* struct _XtActionsRec *actions;*/ /* XtActionList actions;*/ struct _MyRec { char *string; int proc1; int proc2; } *actions; shell = XtInitialize("Text", "text", NULL, 0, &argc, argv ); w = DwtSText( shell, "text", 0, 0, 1, 2, "a" ); XtManageChild( w ); XtRealizeWidget( shell ); do { XtProcessEvent( -1 ); } while ( XtPending( ) ); class = w->core.widget_class; for (;;){ n_act = class->num_actions; actions = class->actions; printf("Number of actions %d\n",n_act); printf("Widget class %s\n",class->class_name); printf("Widget translations '%s'\n",class->tm_table); /* for ( i = 0 ; i < n_act ; i++ ) { printf("%04x %04x\n",actions->string,actions->proc1); printf("action %d = '%s'\n",i,actions->string); actions += sizeof(_XtActionsRec);};*/ for ( i = 0 ; i < n_act ; i++ ) { printf("%04x %04x\n",actions[i].string,actions[i].proc1); printf("action %d = '%s'\n",i,actions[i].string);}; printf("Finished printing actions\n"); class = class->superclass; }; } | |||||
1936.2 | speculation only | SDSVAX::SWEENEY | International House of Workstations | Mon Dec 18 1989 17:37 | 6 |
(1) I believe that R4 intrinsics provide a way to extract this stuff through an interface. XtGetActionList or something like that. (2) The stuff in the class record is modified after the the intrinsics initialize the class. Only the pre-inited class record is going to have the action list unmodified. |