FormDesigner - OpenWindow should return ID

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

FormDesigner - OpenWindow should return ID

Post 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
User avatar
mhs
Enthusiast
Enthusiast
Posts: 101
Joined: Thu Jul 02, 2015 4:53 pm
Location: Germany
Contact:

Re: FormDesigner - OpenWindow should return ID

Post by mhs »

Great idea

+1
Post Reply