[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Dialog item problem



Hi all,

Hopefully this is elementary oversight #1001.

I have a dialog box that I define as follows:



#!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";
SelectDialogItemText($dlg->window(), 4) or die "failed to set Dialog item
text";
}

__END__

When I run the script the dialog box come up, but fails on the
SelectDialogItemText call.   I looked the call up in Inside Macintosh and
got the following:

 PROCEDURE SelectDialogItemText (theDialog: DialogPtr;
                                                      itemNo: Integer;
			      strtSel: Integer;
			      endSel: Integer);


theDialog- A pointer to a dialog record.
itemNo	-A number corresponding to the position of an editable text item in
the dialog box's item list resource.
strtSel -	A number representing the position of the first character
to begin selecting.
endSel -	A number representing one position past the last character
to be selected.

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?



	Noe

	          \\\
	         (@v@)  W
	          (  O )  //
	            |  | //
	          /  ? |/
	         //     |
	         |||     \
	         M| /\ |
	            ||   ||
	            ||   ||
	            LL  LL
		



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org