TuRisMo Posted December 9, 2012 Share Posted December 9, 2012 Errm Hi, I am making a script and this is the first time I deal with GUIs, I am getting a problem in this GUI, it doesn't even show up when I press F10 D: function guiToggleVisible ( ) if ( guiGetVisible ( musicwindow ) == true ) then guiSetVisible ( musicwindow, false ) else guiSetVisible ( musicwindow, true ) end end musicwindow = guiCreateWindow(0, 0, 461, 336, "Music Player", false) checkbox1 = guiCreateCheckBox(190, 285, 91, 31, "Enable Replay", false) edit1 = guiCreateEdit(20, 75, 421, 21, "", false) guiEditSetMaxLength(edit1, 32767) label2 = guiCreateLabel(20, 55, 141, 16, "Insert your Music Link here:", false) guiLabelSetHorizontalAlign(label2, "left", false) guiLabelSetVerticalAlign(label2, "center") label1 = guiCreateLabel(170, 25, 81, 16, "CIT Music Player", false) guiLabelSetHorizontalAlign(label1, "left", false) guiLabelSetVerticalAlign(label1, "center") gridlist1 = guiCreateGridList(20, 145, 421, 121} button1 = guiCreateButton(20, 105, 81, 31, "Add To Playlist", false) button2 = guiCreateButton(70, 285, 51, 31, "Play", false) button3 = guiCreateButton(130, 285, 51, 31, "Stop", false) button4 = guiCreateButton(280, 285, 41, 31, "-", false) button5 = guiCreateButton(330, 285, 41, 31, "+", false) bindKey ( "F10", "down", guiToggleVisible ) Link to comment
TwiX! Posted December 9, 2012 Share Posted December 9, 2012 musicwindow = guiCreateWindow(0, 0, 461, 336, "Music Player", false) checkbox1 = guiCreateCheckBox(190, 285, 91, 31, "Enable Replay", false) edit1 = guiCreateEdit(20, 75, 421, 21, "", false) guiEditSetMaxLength(edit1, 32767) label2 = guiCreateLabel(20, 55, 141, 16, "Insert your Music Link here:", false) guiLabelSetHorizontalAlign(label2, "left", false) guiLabelSetVerticalAlign(label2, "center") label1 = guiCreateLabel(170, 25, 81, 16, "CIT Music Player", false) guiLabelSetHorizontalAlign(label1, "left", false) guiLabelSetVerticalAlign(label1, "center") gridlist1 = guiCreateGridList(20, 145, 421, 121} button1 = guiCreateButton(20, 105, 81, 31, "Add To Playlist", false) button2 = guiCreateButton(70, 285, 51, 31, "Play", false) button3 = guiCreateButton(130, 285, 51, 31, "Stop", false) button4 = guiCreateButton(280, 285, 41, 31, "-", false) button5 = guiCreateButton(330, 285, 41, 31, "+", false) function guiToggleVisible ( ) if ( guiGetVisible ( musicwindow ) ) then guiSetVisible ( musicwindow, false ) else guiSetVisible ( musicwindow, true ) end end bindKey ( "F10", "down", guiToggleVisible ) Link to comment
TAPL Posted December 10, 2012 Share Posted December 10, 2012 musicwindow = guiCreateWindow(0, 0, 461, 336, "Music Player", false) guiSetVisible(musicwindow, false) checkbox1 = guiCreateCheckBox(190, 285, 91, 31, "Enable Replay", true, false, musicwindow) edit1 = guiCreateEdit(20, 75, 421, 21, "", false, musicwindow) guiEditSetMaxLength(edit1, 32767) label2 = guiCreateLabel(20, 55, 141, 16, "Insert your Music Link here:", false, musicwindow) guiLabelSetHorizontalAlign(label2, "left", false, musicwindow) guiLabelSetVerticalAlign(label2, "center") label1 = guiCreateLabel(170, 25, 81, 16, "CIT Music Player", false, musicwindow) guiLabelSetHorizontalAlign(label1, "left", false) guiLabelSetVerticalAlign(label1, "center") gridlist1 = guiCreateGridList(20, 145, 421, 121, false, musicwindow) button1 = guiCreateButton(20, 105, 81, 31, "Add To Playlist", false, musicwindow) button2 = guiCreateButton(70, 285, 51, 31, "Play", false, musicwindow) button3 = guiCreateButton(130, 285, 51, 31, "Stop", false, musicwindow) button4 = guiCreateButton(280, 285, 41, 31, "-", false, musicwindow) button5 = guiCreateButton(330, 285, 41, 31, "+", false, musicwindow) bindKey("F10", "down", function() guiSetVisible(musicwindow, not guiGetVisible(musicwindow)) showCursor(guiGetVisible(musicwindow)) end) You have forgot relative and parent arguments and more.. Link to comment
Kenix Posted December 11, 2012 Share Posted December 11, 2012 bindKey("F10", "down", function() guiSetVisible(musicwindow, not guiGetVisible(musicwindow)) showCursor(guiGetVisible(musicwindow)) end) Maybe i am finding fault of your code but anyway. Why you call function guiGetVisible 2 times instead of call only one time like this: bindKey( 'F10', 'down', function() local bVisible = not guiGetVisible( musicwindow ) guiSetVisible( musicwindow, bVisible ) showCursor( bVisible ) end ) It's little performance but anyway. It's good if you make it everywhere .. 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