in reply to fork() and global variables

You fork()ed, meaning you copied the internal state of the program. All data of the program is copied, and each process goes its merry way - the only relationship they have is that the child's PPID is the parent's PID, and when the child terminates, the parent gets signalled.

Separate processes do not share data, unless they specifically set up a shared memory segment.

You should question yourself if you really want to fork in this case. Your goal is probably to do two things simultaneously. Traditionally there are three ways of doing so: separate processes (fork()), a select/event-loop, and threading (which is somewhere in between, it depends on the threading implementation where in between it is). Since graphical toolkits like Gtk already have some form of an event-loop, you are probably better off using that.

Abigail