PureBasic code does not work (Form Builder)

Just starting out? Need help? Post your questions and find answers here.
ClueLess
Enthusiast
Enthusiast
Posts: 345
Joined: Sun Jan 11, 2009 1:04 am

PureBasic code does not work (Form Builder)

Post by ClueLess »

Hi

I'm trying to build an application and started with main screen, but it doesn't work. Howhever, if I copy/paste the code into the forme builder it does work. What is wrong with this code?

Code: Select all

; Form Designer for Purebasic - 6.01
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.

;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;

Enumeration
  #Main_Window
  #Project_Code_Lbl
  #Project_Code_Text
EndEnumeration

;IncludeFile "procedures.pbi"
;Open_DataBase()

Procedure OpenMain(x = 0, y = 0, width = 793, height = 493)
  OpenWindow(#Main_Window, x, y, width, height, "", #PB_Window_SystemMenu)
  TextGadget(#Project_Code_Text, 20, 47, 133, 20, "")
  SetGadgetColor(#Project_Code_Text, #PB_Gadget_BackColor,RGB(255,255,255))
  StringGadget(#Project_Code_Lbl, 20, 27, 133, 20, "Project Code", #PB_String_BorderLess)
EndProcedure

Procedure Main_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure

Best regards


// Code Tags added (Kiffi)
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureBasic code does not work (Form Builder)

Post by infratec »

I don't know form builder,
but you have no main code.

Code: Select all

OpenMain()
Repeat
  Event = WaitWindowEvent()
Until Main_Events(Event) = #False
ClueLess
Enthusiast
Enthusiast
Posts: 345
Joined: Sun Jan 11, 2009 1:04 am

Re: PureBasic code does not work (Form Builder)

Post by ClueLess »

The IDE form builder...

Thanks it was the problem
Post Reply