Thanks, Bill.

For the Mac I'll try to guess something similar. I'll also experiment
with timer events to refresh wdq.

Ian


On Mon, Nov 29, 2010 at 4:22 PM, bill lam <[email protected]> wrote:
> for window you may get what you want by (untested)
> 1. retrieve the window handle of the child using wd'qhwnd id'
> 2. use PostMessageA winapi to post a message to that handle.
>
> Unless you run an infinite loop for polling, your code must reside
> in some event handlers. Since J single threaded, running an infinite loop,
> (even with sleep) will block all events.
>
> Пнд, 29 Ноя 2010, Ian Clark писал(а):
>> Thanks, Bill.
>>
>> Yes, I did take a close look at wdhandler before I asked my question.
>> And I think I see how that works. whandler calls wd 'q' from which it
>> populates what I've been calling the buffer nouns.
>>
>> But calling: wdhandler'' doesn't simulate the effect of a button-click
>> (say), as I'd hoped -- which would solve my problem.
>>
>> So what do I call to get back the value of what's actually showing on
>> the screen in control: 'id'? -- i.e. the reverse of wd 'set id ...'?
>>
>> I imagine you're going to say: wd 'q', or wd 'qd'. But that only gets
>> back a table of cached values, which can go out-of-date. No matter how
>> many times I call it.
>>
>> I take it from what you're saying (or not saying) that there's no way
>> I can post an event by means of a call from within the code of my
>> event-handler?
>>
>> Ian
>>
>>
>>
>> On Mon, Nov 29, 2010 at 8:39 AM, bill lam <[email protected]> wrote:
>> > The short answer is wd has zero knowledge of content in "buffer". This
>> > should also hold for most gui libraries. For example the content inside a
>> > c# text widget is unrelated to the variable with the same name.  Whenever
>> > the content of a widget is needed, one has to get the 'value' or 'text'
>> > property of that widget (I assumed c# works like vb).
>> >
>> > type inisde ide
>> >  wdhandler
>> > and examine the first few lines to see how and why "buffer" are set.
>> >
>> > Пнд, 29 Ноя 2010, Ian Clark писал(а):
>> >> Because my code is often rewriting the contents of input fields as a
>> >> result of user interactions with other fields, and controls. When this
>> >> happens, the end-user frequently finds unanticipated ways to fool it.
>> >>
>> >> IME these instances would arise less often if:
>> >>    wd 'set myfield *',newstring
>> >> simultaneously performed the equivalent of: myfield=: newstring
>> >> ...which it doesn't.
>> >>
>> >> I can't really understand why not. Surely no logical purpose is served
>> >> by permitting the noun: myfield ever to get out-of-step with what's
>> >> showing on the screen?  I'd guess it's just to save processor cycles.
>> >> But whatever the reason, it's a bug-farm.
>> >>
>> >> (Of course one can always remember to perform the assignment oneself
>> >> religiously after every use of wd 'set...' -which is what I find I'm
>> >> having to do.)
>> >>
>> >> Moreover I disagree that "It would be unusual to require the value of
>> >> a control before an event occurs." Or else I frequently need to do
>> >> "unusual" things. Like requiring to know what's actually showing in a
>> >> given edit field (which can get there from a variety of causes) in
>> >> order to handle some event correctly. As with the app I'm coding now.
>> >>
>> >> Ian
>> >>
>> >>
>> >> On Mon, Nov 29, 2010 at 4:50 AM, chris burke <[email protected]> wrote:
>> >> > On Mon, Nov 29, 2010 at 7:33 AM, Ian Clark <[email protected]> 
>> >> > wrote:
>> >> >> Is there a system verb I can call which simulates a button event? Or a
>> >> >> call I can make from my code to post a keyDown or mouseclick event?
>> >> >>
>> >> >> I've often met the need to do this, but most recently as one possible
>> >> >> solution to the following problem:
>> >> >
>> >> > ...
>> >> >
>> >> > Just curious - why do you often feel the need to do this?
>> >> >
>> >> > Typically, your program will respond to events, and these trigger read
>> >> > of the controls. It would be unusual to require the value of a control
>> >> > before an event occurs.
>> >> >
>> >> > Chris
>> >> > ----------------------------------------------------------------------
>> >> > For information about J forums see http://www.jsoftware.com/forums.htm
>> >> >
>> >> ----------------------------------------------------------------------
>> >> For information about J forums see http://www.jsoftware.com/forums.htm
>> >
>> > --
>> > regards,
>> > ====================================================
>> > GPG key 1024D/4434BAB3 2008-08-24
>> > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to