tim260 Posted January 12, 2012 Share Posted January 12, 2012 What is wrong with this it doesnt create it and doesnt close ( im not so good in GUI ) function build_Form() local gui = {} gui._placeHolders = {} local dicht = guiSetVisible ( build_Form, false ) local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 842, 498 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 showCursor(true) gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "Form", false) guiWindowSetSizable(gui["_root"], false) gui["tabWidget"] = guiCreateTabPanel(0, 75, 821, 431, false, gui["_root"]) gui["tab"] = guiCreateTab("United States Department of Homeland Security ", gui["tabWidget"]) gui["plainTextEdit"] = guiCreateMemo(10, 10, 401, 361, "The Department of homeland security was founded in this server by tim260.\n\nIts now lead by tim260 and is not active yet we are devloping it.", false, gui["tab"]) guiMemoSetReadOnly(gui["plainTextEdit"], true) gui["label_2"] = guiCreateLabel(460, 90, 271, 221, "", false, gui["tab"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["tab_3"] = guiCreateTab("Joining", gui["tabWidget"]) gui._placeHolders["line"] = {left = 27, top = 180, width = 751, height = 20, parent = gui["tab_3"]} gui["tab_2"] = guiCreateTab("Members", gui["tabWidget"]) gui["label"] = guiCreateLabel(290, 25, 411, 31, "Homeland security info panel", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") return gui, windowWidth, windowHeight end end addCommandHandler ( "homeland", build_Form ) function close() guiSetVisible(build_Form, false) showCursor(false) end end addCommandHandler ( "closehomeland", close ) Link to comment
codeluaeveryday Posted January 12, 2012 Share Posted January 12, 2012 Working local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 842, 498 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "Form", false) guiWindowSetSizable(gui["_root"], false) guiSetVisible(gui["_root"], false) gui["tabWidget"] = guiCreateTabPanel(0, 75, 821, 431, false, gui["_root"]) gui["tab"] = guiCreateTab("United States Department of Homeland Security ", gui["tabWidget"]) gui["plainTextEdit"] = guiCreateMemo(10, 10, 401, 361, "The Department of homeland security was founded in this server by tim260.\n\nIts now lead by tim260 and is not yet active, as we are developing it.", false, gui["tab"]) guiMemoSetReadOnly(gui["plainTextEdit"], true) gui["label_2"] = guiCreateLabel(460, 90, 271, 221, "", false, gui["tab"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["tab_3"] = guiCreateTab("Joining", gui["tabWidget"]) gui._placeHolders["line"] = {left = 27, top = 180, width = 751, height = 20, parent = gui["tab_3"]} gui["tab_2"] = guiCreateTab("Members", gui["tabWidget"]) gui["label"] = guiCreateLabel(290, 25, 411, 31, "Homeland security info panel", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") function OpenClose() if guiGetVisible(gui["_root"]) == true then guiSetVisible(gui["_root"], false) showCursor(false) elseif guiGetVisible(gui["_root"]) == false then guiSetVisible(gui["_root"], true) showCursor(true) end end addCommandHandler ( "homeland", OpenClose ) Link to comment
Kenix Posted January 12, 2012 Share Posted January 12, 2012 Try local gui = { } function build_Form( ) gui._placeHolders = { } local screenWidth, screenHeight = guiGetScreenSize( ) local windowWidth, windowHeight = 842, 498 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 showCursor( true ) gui["_root"] = guiCreateWindow( left, top, windowWidth, windowHeight, "Form", false ) guiWindowSetSizable( gui["_root"], false ) gui["tabWidget"] = guiCreateTabPanel( 0, 75, 821, 431, false, gui["_root"] ) gui["tab"] = guiCreateTab( "United States Department of Homeland Security ", gui["tabWidget"] ) gui["plainTextEdit"] = guiCreateMemo( 10, 10, 401, 361, [[The Department of homeland security was founded in this server by tim260. Its now lead by tim260 and is not active yet we are devloping it. ]], false, gui["tab"] ) guiMemoSetReadOnly( gui["plainTextEdit"], true ) gui["label_2"] = guiCreateLabel( 460, 90, 271, 221, "", false, gui["tab"] ) guiLabelSetHorizontalAlign( gui["label_2"], "left", false ) guiLabelSetVerticalAlign( gui["label_2"], "center" ) gui["tab_3"] = guiCreateTab( "Joining", gui["tabWidget"] ) gui._placeHolders["line"] = { left = 27, top = 180, width = 751, height = 20, parent = gui["tab_3"] } gui["tab_2"] = guiCreateTab( "Members", gui["tabWidget"] ) gui["label"] = guiCreateLabel( 290, 25, 411, 31, "Homeland security info panel", false, gui["_root"] ) guiLabelSetHorizontalAlign( gui["label"], "left", false ) guiLabelSetVerticalAlign( gui["label"], "center" ) return gui, windowWidth, windowHeight end addCommandHandler ( "homeland", build_Form ) function close( ) destroyElement( gui["_root"] ) gui["_root"] = nil showCursor( false ) end addCommandHandler ( "closehomeland", close ) Link to comment
codeluaeveryday Posted January 12, 2012 Share Posted January 12, 2012 Mine works, and its /homeland to open and /homeland to close Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now