[KWWidgets] Problem with MultiColumnList and FileBrowserDialog

Kevin Teich kteich at nmr.mgh.harvard.edu
Mon Jun 11 17:39:55 EDT 2007


If I make a MultiColumnList, click on an item in it, and then open a
FileBrowserDialog, after closing the dialog, whenever I move the mouse
in or out of the window, I get these errors:

ERROR:
In /usr/pubsw/packages/KWWidgets/CVS/src/KWWidgets/vtkKWApplication.cxx,
line 1182
vtkKWExampleApp (0x8d201f0): TclTk error: invalid command name
"vtkTemp40"
invalid command name "vtkTemp40"
    while executing
"vtkTemp40 FocusInCallback"
    (command bound to event)


ERROR:
In /usr/pubsw/packages/KWWidgets/CVS/src/KWWidgets/vtkKWApplication.cxx,
line 1182
vtkKWExampleApp (0x8d201f0): TclTk error: invalid command name
"vtkTemp39"
invalid command name "vtkTemp39"
    while executing
"vtkTemp39 FinishEditing"
    (command bound to event)

vtkTemp39 and 40 are objects created within the dialog box (I figured
this by creating dummy objects before and after creating the dialog box
and noting the object numbers). FinishEditing appears to be a callback
in the MCL.

Below is the code to make an app to reproduce this. If you'd like, I can
send a tar.gz CMake project.

As a workaround, if you don't delete the dialog at the end of
LoadFromDlog(), the errors don't occur.

Any ideas? Should I not be deleting the dialog? Thanks.



void
vtkKWExampleApp::Start ( int argc, char** argv ) {

  vtkKWWindowBase* wMain = vtkKWWindowBase::New();
  this->AddWindow( wMain );
  wMain->Create();

  wMain->GetFileMenu()->InsertCommand( wMain->GetFileMenuInsertPosition
(),
 				       "Load...", this, "LoadFromDlog" );

  vtkKWMultiColumnList* list = vtkKWMultiColumnList::New();
  list->SetParent( wMain->GetViewFrame() );
  list->Create();
  
  this->Script( "pack %s -side top -fill both -expand yes",
		list->GetWidgetName() );
  
  list->AddColumn( "" );
  list->InsertCellText( 0, 0, 
			"Click me, the open the dialog box, then cancel it" );
  
  wMain->Display();

  this->Superclass::Start( argc, argv );
}

void
vtkKWExampleApp::LoadFromDlog () {

  vtkKWLoadSaveDialog* dialog = vtkKWLoadSaveDialog::New();
  dialog->SetApplication( this->GetApplication() );
  dialog->Create();
  if( dialog->Invoke() ) {
    string fn( dialog->GetFileName() );
    cerr << fn << endl;
  }

  dialog->Delete();
}



-- 
Kevin Teich



More information about the KWWidgets mailing list