You initialize x
with the value of GPIO.input(17)
at the time of the initialization. It won't change after that unless you assign something new to it, e.g.:
x = GPIO.input(17)
while x == True:
print ("ONONONONONONONONONON")
x = GPIO.input(17)
Now x will be updated for each iteration. You could also just use:
while GPIO.input(17) == True:
print ("ONONONONONONONONONON")
You should put some kind of passive delay into the loop too, however, or else this will busy loop the processor (i.e., run it up to 100% constantly). How long that can be depends on how you are changing the value of the GPIO; if you are turning it off, 1 or 2 seconds is fine. However, if it is just a momentary change you are looking for (e.g., a button push), the gap will have to be shorter (say 200 ms) so you don't miss it.