Page 1 of 1

FormDesigner - OpenWindow should return ID

Posted: Sat Oct 10, 2015 2:43 pm
by GPI
at the moment the formdesigner return nothing:

Code: Select all

Procedure OpenWin_Main(x = 0, y = 0, width = 760, height = 590)
  Win_Main = OpenWindow(#PB_Any, x, y, width, height, "Minecraft Server Launcher", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
  LV_Gesamt = ListViewGadget(#PB_Any, 10, 10, 740, 540)
  STR_Command = StringGadget(#PB_Any, 10, 560, 740, 20, "")
EndProcedure
my suggestion return the ID from OpenWindow - and include a Check

Code: Select all

Procedure OpenWin_Main(x = 0, y = 0, width = 760, height = 590)
  Win_Main = OpenWindow(#PB_Any, x, y, width, height, "Minecraft Server Launcher", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
  if Win_Main
    LV_Gesamt = ListViewGadget(#PB_Any, 10, 10, 740, 540)
    STR_Command = StringGadget(#PB_Any, 10, 560, 740, 20, "")
  endif
  Return Win_Main
EndProcedure

Re: FormDesigner - OpenWindow should return ID

Posted: Fri Oct 16, 2015 8:04 am
by mhs
Great idea

+1