Professional Web Applications Themes

Edit Text Field Not Working in OS9 - Mac Programming

Hi Everyone, I have spent a few hours on this problem and can't figure out how to fix this. I have a dialog box that gathers basic user registration information. The dialog is invoked from within a shared library and runs a ReceiveNextEvent() loop to temporarily block out the host. In OSX, everything works fine. However, running in OS9 (or Classic) the edit text fields no longer work. The dialog and controls display fine and all the buttons work, but I can't click or type in any of the edit fields. Does anyone know why this is? I thought it ...

  1. #1

    Default Edit Text Field Not Working in OS9

    Hi Everyone,

    I have spent a few hours on this problem and can't figure out how to
    fix this.

    I have a dialog box that gathers basic user registration information.
    The dialog is invoked from within a shared library and runs a
    ReceiveNextEvent() loop to temporarily block out the host. In OSX,
    everything works fine. However, running in OS9 (or Classic) the edit
    text fields no longer work. The dialog and controls display fine and
    all the buttons work, but I can't click or type in any of the edit
    fields.

    Does anyone know why this is? I thought it may be related to using
    ReceiveNextEvent, but my dialog handler function is being called.

    Do I need to install event handlers for each edit text box? Or do I
    need to propogate the events manually?

    Thanks for any input! :)

    Steven Walker
    [email]stevewalkereffects.com[/email]
    Steven Walker Guest

  2. #2

    Default Re: Edit Text Field Not Working in OS9

    In article <80ce5172.0308280748.7bb9de18posting.google.com >,
    [email]stevewalkereffects.com[/email] (Steven Walker) wrote:
    > I still can't figure this out. I have tried everything I can think
    > of... installing event handlers, removing event handlers, isolating
    > the control, sending events. But nothing works, the text edit field
    > just does not respond to user interaction.
    Do you have any other objects overlapping (above *or* below) that item?
    That's not really supported by the Control manager, and may thus cause a
    few problems.

    You might also want to check whether any of the fields is disabled,
    whether it is embedded/auto-embedded in any other control that may be
    disabled, things like that...

    Have you tried whether it makes a difference to call WaitNextEvent()
    instead of ReceiveNextEvent()? It may be that the EditText control still
    uses classic events on 9... I don't think the implementation of TextEdit
    in Carbon/9 is any different from the one in Toolbox/9.

    Finally, are you sure it doesn't react, or do you just fail to see the
    results? Are you messing with clipping rects/regions in any way? Is this
    in a DialogRef or in a "straight" WindowRef?

    Just a few thoughts.

    -- Uli
    [url]http://www.zathras.de[/url]
    Uli Kusterer Guest

  3. #3

    Default Re: Edit Text Field Not Working in OS9

    In article <80ce5172.0308301342.5c7778ecposting.google.com >, Steven
    Walker <stevewalkereffects.com> wrote:
    > As a test, I created a project from scratch using the C++ Toolbox
    > Carbon stationary. I replaced the default code with my own to
    > dynamically create a window with two controls: a button and a text
    > edit field (there are no resources). I installed no event handlers
    > (because the default behavior should work).
    >
    > Then I tried using both WaitNextEvent() and ReceiveNextEvent(), and
    > they produce identical results: the window appears, the button works,
    > but the text field does not in OS 9. In OSX everything works fine.
    >
    > In the chance that someone can see my blunder, the code is below
    Just a wild guess, maybe you need to call CreateRootControl before the
    other controls.
    James W. Walker Guest

  4. #4

    Default Re: Edit Text Field Not Working in OS9

    Thank you James and Uli, it was the root control! After putting in
    those two lines of code, it all works!!!

    I did not know about the root and would have never thought to look for
    it. Apparently, the root control is built-in to windows in OSX but not
    in OS9.

    Oddly, one of Apple's tech notes confirms that I was doing this right:
    [url]http://developer.apple.com/qa/qa2001/qa1215.html[/url]
    Excerpt from QA1215:
    "If you create controls in your window with the CreateFooControl APIs
    and pass a valid window parameter, then a root control will be
    automatically created for you, as in the past, so you don't need to
    call CreateRootControl yourself "
    Though apparently this is wrong as my little experiment just showed.
    > What are you trying to achieve with this code? Why don't you use
    > RunAppModalLoopForWindow() or some other method intended for doing modal
    > dialogs? And what does SendEventToEventTarget() return? Does it give you
    > any errors?
    For brevity of the example I removed all error handling. I could use
    RunAppModalLoopForWindow(), but I most often create my own loops to
    have more control. In this example it doesn't matter which is used.

    Thanks again, this fix has made my day!

    Steven J. Walker
    Steven Walker Guest

Similar Threads

  1. Forms: Text field - auto fill another field?
    By LDVDG@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 3
    Last Post: May 18th, 05:35 PM
  2. Text edit functions not working for text entry fields onMAC
    By Brij_Mohan in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 13th, 02:19 PM
  3. Defined text field in form -> subject field in e-mail
    By olaka in forum Dreamweaver AppDev
    Replies: 0
    Last Post: March 14th, 02:20 PM
  4. Replies: 2
    Last Post: February 22nd, 04:59 PM
  5. list component working with dynamic text field
    By hoz webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: January 20th, 06:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139