I'll amend my previous post. You can init the field prior to displaying the form with FrmDoDialog and I "think" that you can set the focus too but I am not sure since I haven't done that.
"Ralph Curtis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Might be crashing because you can't get the popup form pointer. Manual says: > > "You should not call the FrmGetActiveForm function when a popup window is > open. There is no active form while a popup is displayed, and the value > returned from FrmGetActiveForm in this situation has no meaning." > > In any event, the popup form probably isn't opened yet since FrmPopupForm > creates and sends the events to create the form. > > Do you really need to set the focus on the field? If you don' t need special > processing of the filename in your popup - so you don't need an event > handler - you might be better off using FrmDoDialog like this: > > FormPtr form = FrmInitForm(MySimpleDialogForm); > FormPtr curForm = FrmGetActiveForm(); > if(curForm) > FrmSetActiveForm(form); > UInt16 selection = FrmDoDialog(form); // this is modal > Boolean deleteJob = false; > if(selection == MySimpleDialogFormOkButton) { > // Get the filename from your dialog form > // Process it or store it away to process after deleting the > dialog form > } > FrmDeleteForm(form); > if(curForm) FrmSetActiveForm(curForm); > > Ralph > > "Tony Janke" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Is it possible to set the focus in a field on a pop up form? I am popping > up a form for the user to enter a "file name". > > > case 1003: // CREATE NEW > // get filename from user > FrmPopupForm(SaveFileNameForm); > pForm = FrmGetActiveForm(); > > // PROGRAM CRASHES HERE CUS THERE IS NO EVENT HANDLER???? > FrmSetFocus(pForm, 1003); > > > I would prefer not to create an event handler for this simple task, but I > will if I have to. Any help would be greatly appreciated! > > thanks, > > ~Tony > > > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
