Re: [g-a-devel]test-simple in at-spi



On Wed, 2003-01-15 at 15:57, Padraig O'Briain wrote:
> When running this program I came across a problem because GailButton now 
> implements AtkText interface.
> 
> The attached patch gets around that problem. OK to commmit?

I think the root of the problem is that test-simple assumes, due to
historical accident, that it knows which widget implements AtkText and
assumes some things about that widget's state.

A better fix (especially in light of test-simple's "poke" option) would
be to only run those state-assuming parts of test_text if the AtkObject
in question 'matches' the one we expect.  So perhaps calling
atk_object_set_name () on the entry widget in the main() routine that
creates the UI, and comparing the AtkText-implementing object's name to
that... etc.

-Bill

> Padraig
> 
> ______________________________________________________________________
> 
> Index: test-simple.c
> ===================================================================
> RCS file: /cvs/gnome/at-spi/test/test-simple.c,v
> retrieving revision 1.31
> diff -u -p -r1.31 test-simple.c
> --- test-simple.c	17 Nov 2002 13:54:00 -0000	1.31
> +++ test-simple.c	15 Jan 2003 15:59:26 -0000
> @@ -295,7 +295,16 @@ static void
>  test_text (AccessibleText *text)
>  {
>  	char *str;
> +	static gboolean done = FALSE;
>  
> +	if (done)
> +		return;
> +	done = TRUE;
> +	/*
> +	 * A GtkButton now supports the Text interface so only want
> +	 * to call this function once.
> +	 */
> +	
>  	fprintf (stderr, "Testing text ...\n");
>  
>  	g_assert (AccessibleText_getCharacterCount (text) ==
-- 
Bill Haneman <bill haneman sun com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]