Does X work fine as a normal user. If you are switching to root from a normal user account and need to run gui apps, then do
Code:
$xhost +localhost (or $xhost +)
$su
#gedit filename
To save you the hassle why not use a text based editor e.g. pico (nano), vim or emacs.