[comp.sys.mac.programmer] Help - editText in modeless dialog

txhou@mcs.drexel.edu (Xinjun Hou) (05/20/91)

I am new to Mac interface programming. 

I am using a modeless dialog to prompt user enter some numbers, but I
could not get the caret blinking when a editable item is seleted. Has
anyone have this problem before?

I followed the instruction in the Inside Mac, that is
1) call GetNextEvent;
2) check IsDialogEvent, regardless what value GetNextEvent returned;
3) check keydown and autokey to check if the key is valid key
4) if it is valid, for example, a number keys, then passed to
   DialogSelect().

But the cursor in editText field is not blinking!

Could someone give me a hit, or give me a direction to look for
reference, or other way of handling dialog?

Thanks you very much.

Xj

gurgle@well.sf.ca.us (Pete Gontier) (05/22/91)

txhou@mcs.drexel.edu (Xinjun Hou) writes:

>I am using a modeless dialog to prompt user enter some numbers, but I
>could not get the caret blinking when a editable item is seleted. Has
>anyone have this problem before?

The dialog manager needs to see a null event every once in a while.
When you pass a null event to the dialog manager, it's like saying
"I don't have anything to do right now -- do you have any editText items
which need their carets blinking?"

(BTW, a null event is when one of the event calls returns FALSE.)
-- 
 Pete Gontier, gurgle@well.sf.ca.us
 Software Imagineer, Kiwi Software, Inc.

vrm@babcock.cerc.wvu.wvnet.edu (Vasile R. Montan) (05/22/91)

From article <24931@well.sf.ca.us>, by gurgle@well.sf.ca.us (Pete Gontier):
> txhou@mcs.drexel.edu (Xinjun Hou) writes:

>>I am using a modeless dialog to prompt user enter some numbers, but I
>>could not get the caret blinking when a editable item is seleted. Has
>>anyone have this problem before?

> The dialog manager needs to see a null event every once in a while.
> When you pass a null event to the dialog manager, it's like saying
> "I don't have anything to do right now -- do you have any editText items
> which need their carets blinking?"
> (BTW, a null event is when one of the event calls returns FALSE.)

Well, what about a case where it's a modal dialog-- the most straightforward
modal dialog you can imagine, with one button, one disabled static text
item, and one editable text item?  From the behavior of the text as I
click and type, I can see that the selection point/range is being properly
selected, but the feedback to the user has two problems:
1.  The blinking caret never appears.  It never even makes one blink.
2.  When I select a range of text with the mouse, the text becomes
    inverted (white on black),as normal.  However, if I click the mouse down in
    the text again, the text is not re-inverted back to normal.  If I
    select a smaller range within the original larger range, the smaller
    range is inverted back to normal (black on white);  the formerly
    selected text to the left and right of the new selection stays
    inverted, even though it isn't selected.
Is there something I'm not doing right?  The modal in question has no
filter proc, no user items, nothing.

--Kurisuto
un020070@vaxa.wvnet.edu

txhou@mcs.drexel.edu (Xinjun Hou) (05/23/91)

In article <24931@well.sf.ca.us> gurgle@well.sf.ca.us (Pete Gontier) writes:
>txhou@mcs.drexel.edu (Xinjun Hou) writes:
>
>>I am using a modeless dialog to prompt user enter some numbers, but I
>>could not get the caret blinking when a editable item is seleted. Has
>>anyone have this problem before?
>
>The dialog manager needs to see a null event every once in a while.
>When you pass a null event to the dialog manager, it's like saying
>"I don't have anything to do right now -- do you have any editText items
>which need their carets blinking?"
>
>(BTW, a null event is when one of the event calls returns FALSE.)
>-- 
> Pete Gontier, gurgle@well.sf.ca.us
> Software Imagineer, Kiwi Software, Inc.

I did called IsDialogEvent regardless the return value of WaitNextEvent
or SystemTask/GetNextEvent.

One more strange thing, when I tryed to check the event return
from WaitNextEvent, I never found a nullEvent(I have a break in the
program when a nullEvent is found) What happened?

System : MacClassic, THINK pascal 3.0.1

---
Xinjun Hou, txhou@king.mcs.drexel.edu