Jump to content




[QUESTION][HELP] Nothing happens when i press button!


  • You cannot reply to this topic
6 replies to this topic

#1 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 30 March 2013 - 03:16 AM

Hi! I'm currently rewriting my Os to be a GUI. But when I press the button nothing happens but I have programmed that...

The code:

Spoiler


#2 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 30 March 2013 - 03:22 AM

No one is gonna look through 200 lines of code for you. Paste the relevant code.

#3 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 30 March 2013 - 03:23 AM

View PostMads, on 30 March 2013 - 03:22 AM, said:

No one is gonna look through 200 lines of code for you. Paste the relevant code.

ok...

while true do
local event, button, X, Y = os.pullEventRaw()
 if slc == 0 then
  if event == "mouse_click" then
   if X >= 2 and X <= 8 and Y == 1 and button == 1 then
    drawMenu1()
    slc = 1     
    drawDesktop()
   end
  end
 elseif slc == 1 then
  if X >= 1 and X <= 11 and button == 1 and Y == 3 then slc = 0
    login()
   elseif X >= 1 and X <= 11 and Y == 4 and button == 1 then slc = 0
   register()
   elseif X >= 1 and X <= 11 and Y == 5 and button == 1 then slc = 0        
   os.reboot()
   elseif X >= 1 and X <= 11 and Y == 6 and button == 1 then slc = 0
   os.shutdown()
   elseif X >= 1 and X <= 11 and Y == 7 and button == 1 then slc = 0
   passgen()
   elseif X >= 1 and X <= 11 and Y == 8 and button == 1 then slc = 0
   credits()
   else slc = 0
   drawDesktop() 

  end
  elseif slc == 2 then
  if X >= 1 and X <= 11 and button == 1 and Y == 3 then slc = 3
  elseif X >= 2 and X <= 5  and Y >= 3 and Y <= 9 and button == 1 then
     shell.run("file")

  else slc = 2
  drawDesktop2()
 end
 elseif slc == 3 then
   if X >= 2 and X <= 8 and Y == 1 and button == 1 then
    drawMenu2()
    slc = 2     
    drawDesktop2()
 end

end
end


#4 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 30 March 2013 - 03:32 AM

Also, what button is not responding?

#5 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 30 March 2013 - 03:38 AM

The very first one.
It should draw a "dropdown" menu beneath it and when you click outside of the menu it should dissapear.

#6 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 30 March 2013 - 03:46 AM

Oh, the first button is [Begin] (If you want to know)

#7 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 30 March 2013 - 03:52 AM

NVM! I got it fixed! It was responding but it instantly closed it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users