Re: making accessible to my gtk application in different platforms designed in c language



My understanding is that GTK is not accessible with screen readers under Microsoft Windows, but it can be under Linux. Support for non-Linux environments is on the development agenda for GTK 4.

On 5/6/21 6:05 am, chandan dora via gnome-accessibility-list wrote:
hello friends, I need to learn the concept, of how the gtk gui
applications designed in c language can be accessible in different
platforms, especially in microsoft windows and linux. to make a clear
understand of this concept, I implemented a very simple gtk gui
applications in c as follows:


#include <gtk/gtk.h>

int main (int argc, char *argv [] )
{
GtkWidget *window;
GtkWidget *button;

gtk_init (&argc, &argv);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Accessible program");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 150);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);



/* I am going to creat a button element and add it to display it on
the toplevel window */
button = gtk_button_new_with_label ("OK");
gtk_widget_set_halign (button, GTK_ALIGN_START+20);
gtk_widget_set_valign (button, GTK_ALIGN_START+20);
/* also I am going to display a tooltip on this buttonr, when I drag a
mouse pointer on it. */
gtk_widget_set_tooltip_text (button, "this is a small descriptive text
related to this button element");

gtk_container_add (GTK_CONTAINER (window), button);

gtk_widget_show_all (window);

g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK
(gtk_main_quit), NULL);

gtk_main ();

return 0;
}


after implementing this program, I compiled it on linux (kali linux
distro) as follows:
gcc main.c -o main.out `pkg-config --cflags --libs gtk+-3.0`

and run it as follows:
./main.out

before running the main.out program, I had enabled the orca screen
reader to test whether the program is accessible by screen reader or
not. and then run the main.out program.
after running this program, I noted that, a new window was opened
which displayed a button element with a tooltip on the screen.
simultaneously, I heard that of orca is announcing, "accessible
program frame. OK push button. this is a small descriptive text
related to this button element". it means that, a new window created
in a frame, whose title is "accessible program". "ok push button"
means, currently the focus is on the OK button element of the window.
"this is a small descriptive text related to this button" means, the
orca announces this message because I added a tooltip to this button
while implementing this program, and since the main focus is on this
button, right now, hence the orca announces this tooltip.
everything was fine till now in the linux environment. one moment!
let's move a bit for a while to the microsoft windows desktop
environment.
I compiled this source code in the microsoft windows desktop
environment version 10, using gcc compiler as follows:
on the windows command prompt, I executed the following commands to
compile the source code:
echo gcc main.c -o main.exe > run.bat
pkg-config --cflags --libs gtk+-3.0 >> run.bat
then, on the command prompt:
run

I got no error and my program was compiled successfully. then I simply
type main on the command prompt and press enter.
note: before I run the main.exe file on my windows 10 environment, I
had installed JAWS (job access with speech) screen reader, which is
the most popular screen reader for windows operating system. however,
I also used the narator screen reader to test the accessibility of my
program using screen reader.
actually, the problem is there, after running the main.exe program on
this platform. it runs successfully, and a new window is open. it
displays all the elements of the window. but no screen reader neither
JAWS nor narator can properly interact with this application. while
opening a new window, the screen readers are announcing just the title
of the window, "accessible program" in my case. but nothing else.
the screen readers are neither announcing the button element, nor
announcing the tooltip of the button. this is the problem. if I will
take orca into my consideration, it was fine with this main.out
program.
to understand this problem more clearly, on the command prompt, I run
another program called notepad.exe. to run the notepad, on the command
prompt, I type "notepad" without quotation mark, and press enter.
but its so amazing !! the screen readers are announcing everything
after opening notepad. some questions stuck  in my mind:
  1.    why can the screen readers not access my program correctly in
windows platform?
2. the orca screen reader in linux can properly interact with my
program. but in windows, the JAWS and narator aren't. why?
3. the other programs like ms word, notepad, etc are accessible by
screen readers in windows platform. but it cannot access my program
properly. what should I do to my program, to make it properly
accessible by screen readers in windows platform?

having these questions in my mind, I investigated somewhere, and find
that ATK library and microsoft active accessibility (MSAA). I know
about the purpose of these interfaces. but still it confused me.
further it add some new questions in my mind:

1.      I have not used ATK library in my program. still, the orca screen
reader in linux can access my program properly. how?
2. the same program in windows platform runs properly. but could not
be accessible by screen readers such as JAWS and narator. but the
screen readers can peoperly access other programs like notepad ms
word, etc. how?
when the second question comes into my mind, I think about MSAA
(microsoft active accessibility). but I don't know how can I use MSAA
in my program. so the third probable question comes into my mind:
3.      can i use ATK (accessibility toolkit) with gtk to build an
accessible program in windows platform?

I hope, someone can help me. as soon as I will be a best programmer, I
will contribute much to the open source community.


regards
_______________________________________________
gnome-accessibility-list mailing list
gnome-accessibility-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-accessibility-list


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