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

[MacPerl] pb with Macdialog



Hi,
i ve try a little script:

the pb is what is the param to 
$user = $PORT->item_text($itemsdialog);
where $PORT is Macdialog Object ???


sub CB_cancel
{
	$::cancel=1;
}

sub dialog
{
	$res = OpenResFile("test.rsc");
	if ( defined $res) 
	{
		print("res open\n");
  		$itemsdialog = GetResource("DITL", 128);
				
		if (( defined $itemsdialog ))
		{
			$r = pack("ssss",(50,50,210,410));
			$rect = bless(\$r,"Rect");
			$PORT = MacDialog->new($rect,"LOGIN -
IPBS",1,dBoxProc,-1,$itemsdialog);
			$::cancel =0;
			#$PORT->modal(\&myfilter2);
			#$PORT->modal();
			$PORT->item_hit(4,\&CB_cancel);
			$PORT->item_hit(5,\&CB_cancel);
			while ($::cancel ==0)
			{
			}
			#$nitem = Mac::Dialogs::GetDialogItem($PORT->{port},1);
--------------->	$user = $PORT->item_text($itemsdialog);

			#$pass = $PORT->item_text(2);
			#$zone = $PORT->item_text(3);
 			$PORT->dispose();
   			print "$user  \n";
		}		
  CloseResFile($res);		                
	}
	else
	{
		print("res not open\n");		  
	}
}
dialog;
i always obtain:

# Can't locate object method "_GetDialogItemText" via package "Handle",
<IN> chunk 11.
File 'MIC-MAC Horreur:MacPerl €:lib:Mac:Dialogs.pm'; Line 177
# 	Mac::Dialogs::GetDialogItemText('GrafPtr=SCALAR(0x1dcd714)',
'Handle=SCALAR(0x1dca070)') called
File 'MIC-MAC Horreur:MacPerl €:lib:Mac:Dialogs.pm'; Line 469
# 	MacDialog::item_text('MacDialog=HASH(0x1c42fc8)',
'Handle=SCALAR(0x1dca070)') called
File 'MIC-MAC Horreur:MacPerl €:test.pl'; Line 88
# 	main::dialog() called
File 'MIC-MAC Horreur:MacPerl €:test.pl'; Line 101


Many thanks in advance 
-- 

Laurent BARDI Ingenieur Systemes & Reseaux 
Centre National de la Recherche Scientifique
INSTITUT  de PHARMACOLOGIE et de BIOLOGIE STRUCTURALE
Tel : 05-61-17-59-47             http://www.ipbs.fr/
Fax : 05-61-17-59-94             lolo@ipbs.fr
CNRS-IPBS 205 Route de Narbonne 31400 TOULOUSE FRANCE 

///////////////////////////////////////////////////////////////////////////
/ There is worse than to have not succeded
:                              /
/ Not to have  tried
!                                                    /
///////////////////////////////////////////////////////////////////////////

If it stinks, it's chemistry. If it moves, it's biology.
If it does not work, It's computer science.

Linux the choice of a GNU generation

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch