Operating System - HP-UX
1832316 Members
2067 Online
110041 Solutions
New Discussion

Problem calling XmTextField Action Proc

 
Joan Coleman
Occasional Contributor

Problem calling XmTextField Action Proc

I would like the contents of an XmTextField widget to appear selected when the widget is displayed.(i.e. as if the user had held and dragged the left mouse over the field). I see the textfield widget has an action proc called select-all and assume this is what needs to be called. I tried calling it using the XtCallActionProc, but can find no documentation on what the contents of the event argument should be, nor its structure. I am assuming that no other parameters need to be passed, besides the widget and the name of the action routine. I would appreciate any suggestions. Thanks in advance.
2 REPLIES 2
Wodisch
Honored Contributor

Re: Problem calling XmTextField Action Proc

Hello Joan,

if you go for action proc callbacks you will have to register
a "Binding" to some "Event" or Combination of "Events"
to be bound to that "Action", like in your ".Xdefaults":

yourprg*Translations: #overrride \n Ctrla: select-all() \n
And, as you see, it does NOT take any parameters...

But you are looking for a solution from within your
C-program, right? So you would not go for "ActionProcs"
but for the "ICCCM" (Inter Client Communication
Convention Manual, which is quite complicated) or you
do simply use the "XtSetValue" method to set the
values of the "XmNsectionArray" and the
"XmNselectionArrayCount" for that widget. You seem
to go for the action "XmSELECTION_LINE" to select
the whole line of text in your widget...

HTH,
Wodisch
Joan Coleman
Occasional Contributor

Re: Problem calling XmTextField Action Proc

Thank you for taking the time to read and acknowledge my question. You are correct, I am trying to casue the action from a C program. The XtSetValue suggested didn't seem to work. I have also tried the XmTextFieldSetHighlight and XmtextFieldSetSelection calls. The appearance as a result of these two calls seems to be the same as the user dragging the left mouse over the field; however, when you hit the keyboard delete key the text is not deleted like it is when first holding down the left mouse and dragging it over the field yourself.
Thanks again for your time.