If you don't even know what gui you are using what chance do you or anyone trying to help have

Looks like it could be
this
You have loads of duplicated code, variables that are not used.
ctrl is not defined
if int(ctrl.getX()) != 375: # undefined variable ctrl
continue
In this part
if int(program_width) == 691: # width of button1
programs_width = 344
program_button_1.setWidth(int(programs_width)) # set button one width
program_width = program_button_1.getWidth() # changed the width to 344
nextprogram_width = program_button_2.getWidth()
print "catch this goright 1"
You set button1 to width 344, then you ask the control what its width is that you already know as you just set it and change variable
program_width to that width.
In the next part you check for the value of
program_width is inside your condition which it is because you just set it to be and then you change button1 width to the width of button2
elif int(program_width) >= 342 and int(program_width) <= 344:
#print "you are working on 342 and 344 button"
print "catch this goright 2"
program_button_1.setLabel(nextprogram_label)
program_button_1.setWidth(nextprogram_width)