Hi!

I have a list and a textfield.
Each time the list is klicked, I put the selected name into a textfield.
Then if a button is pushed I do some action.
If no listItem is klicked, I show a Custom Alert.

The strange effect:
After displaying the Alert, the content of the textfield is changed.

Any ideas?

Here is the Code:
case DocManagementRenameButton:
        aktBook = LstGetSelection( GetObjectPtr( 
                                        DocManagementDBsList ) );
        if ( aktBook > -1 )
        {
                Handle textH;
                CharPtr textP;
                Word stringLen;

                stringLen = FldGetTextLength( 
                                GetObjectPtr( 
                                DocManagementDocNameField ) );
                if ( stringLen > 0 )
                {
                        textH = FldGetTextHandle( 
                                GetObjectPtr( 
                                DocManagementDocNameField ) );
                        textP = MemHandleLock( textH );
                        MemMove( dbName, textP, stringLen );
                        MemHandleUnlock( textH );
                        dbName[stringLen] = 0;
        
                        DmSetDatabaseInfo( 0, dbIDs[aktBook], 
                        &dbName[0], NULL, NULL, NULL, NULL, NULL, 
                        NULL, NULL, NULL, NULL, NULL );

                        // update the db lookup table
                        InitDBLookup( );
                        // init the list
                        DocManagementInit();
                        // no update the list
                        LstDrawList( GetObjectPtr( 
                                DocManagementDBsList ) );
                }
                else
                {
                        FrmCustomAlert( UserErrorAlert, 
                                "Rename a Document with no title? 
                                You're kidding...", "","");
                }
        }
        else
                FrmCustomAlert( UserErrorAlert, 
                        "Please select a document", "","");
handled = true;
break;


Ofcourse I can set the content of the textfield with a zerolength
string, but I just want to know why ;-)

bexxx

Reply via email to