9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] libcontrol focus question
@ 2007-11-29  6:47 Anthony Sorace
  2007-11-29  7:02 ` Federico G. Benavento
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony Sorace @ 2007-11-29  6:47 UTC (permalink / raw)
  To: 9fans

In my first experiment with control(2),  I'm trying to get fgui to
give the first entry box focus when the window is created (since in
better than 90% of my cases, all that's needed is a password). I've
tried a few methods, all of which basically boil down to:
	chanprint(cs->ctl, "%s focus 1", entry[i].val);
It seems like it should be possible to explicity tell a control that
it has focus, separate from the clicktotype flag, which I understand
to determine how the controlset normally decides to send those
messages. That's my reading of control(2)'s discussion of messages,
anyway.

It's entirely possible I'm missing something with the interaction
between direct updates to the Controls, activate, and
resizecontrolset, which is what I'm going to look at in the morning,
but it seems prudent to ask if this is even possible.

Can one explicitly determine which Control in a set has focus?
Anthony


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] libcontrol focus question
  2007-11-29  6:47 [9fans] libcontrol focus question Anthony Sorace
@ 2007-11-29  7:02 ` Federico G. Benavento
  0 siblings, 0 replies; 2+ messages in thread
From: Federico G. Benavento @ 2007-11-29  7:02 UTC (permalink / raw)
  To: 9fans

> Can one explicitly determine which Control in a set has focus?
> Anthony

try this and tell me how it goes :)

	clicktotype = 1;
	_ctlprint(cs->focus, "focus 0");
	cs->focus = control;				/* I want the focus on this control! */
	_ctlprint(cs->focus, "focus 1");


Federico G. Benavento

---
/bin/fortune:
A watched terminal never prints.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-29  7:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29  6:47 [9fans] libcontrol focus question Anthony Sorace
2007-11-29  7:02 ` Federico G. Benavento

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).