Page 1 of 1

Create a windows for a text Editor

Posted: Sat Aug 06, 2005 1:52 pm
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]

Posted: Sat Aug 06, 2005 2:28 pm
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

Posted: Sat Aug 06, 2005 3:59 pm
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"