Create a windows for a text Editor

Just starting out? Need help? Post your questions and find answers here.
sabater
User
User
Posts: 33
Joined: Wed Jul 13, 2005 3:40 am

Create a windows for a text Editor

Post by sabater »

I want make a window with a text area, for type texts.
I make the GUI using the PureBasic Visual Designer.

The code generated is this.

Code: Select all

; PureBasic Visual Designer v3.90 build 1361


;- Window Constants
;
Enumeration
  #Window_0
EndEnumeration

;- MenuBar Constants
;
Enumeration
  #MenuBar_0
EndEnumeration

Enumeration
  #MENU_1
  #MENU_6
  #MENU_8
  #MENU_10
  #MENU_13
  #MENU_3
  #MENU_5
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Editor_1
EndEnumeration


Procedure Open_Window_0()
  If OpenWindow(#Window_0, 259, 68, 599, 421,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered , "Zuret Carriet")
    If CreateMenu(#MenuBar_0, WindowID())
      MenuTitle("Arquivo")
      MenuItem(#MENU_1, "Novo")
      MenuItem(#MENU_6, "Abrir")
      MenuItem(#MENU_8, "Salvar")
      MenuItem(#MENU_10, "Salvar Como")
      MenuItem(#MENU_13, "Sair")
      MenuTitle("Editar")
      MenuTitle("Ajuda")
      MenuItem(#MENU_5, "Sobre...")
    EndIf




    
    If CreateGadgetList(WindowID())
      EditorGadget(#Editor_1, 0, 0, 600, 400)
      
    EndIf
 
  EndIf
EndProcedure
Have a problem. The windows not open.
How i may resolve this?[/code]
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

After the procedure:

Code: Select all


Open_Window_0()

Repeat
  
  select windowevent()
    case #PB_Event_CloseWindow
      Endit=1
  endselect

  delay(10)

Until Endit=1
~I see one problem with your reasoning: the fact is thats not a chicken~
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

i would rather use WaitWindow event than using the delay and windowevent!!

However, in Visual Designer select Project and then Project options, then activate "Include Event Loop"
Post Reply