Noe Dinnerstien writes 6th May 1999: >Hopefully this is elementary oversight #1001. > >I have a dialog box that I define as follows: [snip] Yes, a minor oversight, and with a few tweaks as below the dialog works as expected. The tweaks include moving the 'dispose $dlg' to the END block, adding parentheses round the list of references to the controls and adding a "WaitNextEvent" loop to keep the window alive. >When I run the script the dialog box come up, but fails on the >SelectDialogItemText call. > >It looks like I'm setting up the call correctly, but I am willing to admit >to brain damage, blindness, etc. What am I missing? "SelectDialogItemText" refers to selecting (i.e. highlighting) text in an edit box and for that you have to have some text to 'select'. I have added a line putting "Here is some text" into your box and modified the 'select' line to highlight the word 'some'. (Incidently if the selected 'start' and 'finish' are the same number, the caret is placed at that point.) Ironically there seems to be a bug in 'SelectDialogItemText()' such that it returns 'false' when it's 'true'; hence you 'die' even though the command succeeds. The only thing to do, I think, is remove the 'die' statement. Hope this helps. Alan Fry =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #!perl -w # use strict; use Mac::Windows; use Mac::QuickDraw; use Mac::Events; use Mac::StandardFile; use Mac::Dialogs; #****************************************************** my($DoSearch,$dlg); $DoSearch = 0; ShowDialog(); #dispose $dlg; #*************************************************** sub ShowDialog { #------ SET UP DIALOG FOR SEARCH $dlg = MacDialog->new( Rect->new(50,50,450,155), # dialog rectangle 'Search ACIP CD', # dialog title 1, # is visible? movableDBoxProc(), # window style 0, # has go away box? ( [ kButtonDialogItem(), Rect->new(300, 30,380,50), 'Cancel'], [ kButtonDialogItem(), Rect->new(300, 70, 380,90),'Search'], [ kStaticTextDialogItem(), Rect->new(10, 10, 220, 30), 'Search Any or All Directories'], [ kEditTextDialogItem(), Rect->new(15,50,180,65), ''] ) ); #-----Define dialog items SetDialogCancelItem ($dlg->window(), 1) or die "failed setting Cancel"; SetDialogDefaultItem($dlg->window(), 2) or die "failed setting Search"; $dlg->item_text(4, 'Here is some text'); SelectDialogItemText($dlg->window, 4, 8, 12); } WaitNextEvent while $dlg; END { $dlg->dispose if defined $dlg } =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org