Tagor Posted March 25, 2005 Share Posted March 25, 2005 I created a GUI with the given code. Also I added some tabs to the GUI with some text on all tabs. However when I release GuiSetState() on the top, it doesn't show the text. I first need to navigate to another tab before it shows anything. Can someone tell me what I am doing wrong? If I don't use GuiSetState(), I don't see the GUI. Link to comment Share on other sites More sharing options...
layer Posted March 25, 2005 Share Posted March 25, 2005 we would be able to help if you supplied some code FootbaG Link to comment Share on other sites More sharing options...
Tagor Posted March 25, 2005 Author Share Posted March 25, 2005 Here is the important part of the code: GuiCreate ($title, 396, 396) GuiSetIcon ("ico.ico", 0) GuiSetState () GuiCtrlCreateTab (5, 5, 385, 385, $WS_EX_WINDOWEDGE) GuiCtrlCreateTabItem (" " & $status & " ") GuiCtrlCreateTabItem (" " & $information & " ") GuiCtrlCreateGroup ("Test text", 8, 32, 376, 84) $Label_1 = GuiCtrlCreateLabel("click me to run", 300, 300, 10, 10) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg= $Label_1 MsgBox (0, "test", "test") Case Else ;;; EndSelect WEnd While GuiGetMsg () <> $GUI_EVENT_CLOSE WEnd Link to comment Share on other sites More sharing options...
layer Posted March 25, 2005 Share Posted March 25, 2005 i dont understand your problem, but try this: #include <GUIConstants.au3> $title = "hey" GuiCreate ($title, 396, 396) GuiSetIcon ("ico.ico", 0) GuiSetState () GuiCtrlCreateTab (5, 5, 385, 385, $WS_EX_WINDOWEDGE) GuiCtrlCreateTabItem (" " & "tab1" & " ") GuiCtrlCreateTabItem (" " & "tab2" & " ") GuiCtrlCreateGroup ("Test text", 8, 32, 376, 84) $Label_1 = GuiCtrlCreateLabel("click me to run", 20, 50, 100, 20) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg= $Label_1 MsgBox (0, "test", "test") EndSelect WEnd FootbaG Link to comment Share on other sites More sharing options...
Tagor Posted March 25, 2005 Author Share Posted March 25, 2005 The problem is that it only shows the first tab of "GuiCtrlCreateTabItem". Link to comment Share on other sites More sharing options...
layer Posted March 26, 2005 Share Posted March 26, 2005 im still unclear of what the problem is, when i ran the above script i provided everything worked fine, when i was on "tab1", nothing was in it, which is supposed to happen unless you tell it to put labels etc in it, then when i hit "tab2", i saw the Group control and the label in it, now if you could be a little mor specific, then i could help.. FootbaG Link to comment Share on other sites More sharing options...
Tagor Posted March 26, 2005 Author Share Posted March 26, 2005 Sorry, I forgot an item:GuiCreate ($title, 396, 396)GuiSetIcon ("ico.ico", 0)GuiSetState ()GuiCtrlCreateTab (5, 5, 385, 385, $WS_EX_WINDOWEDGE)GuiCtrlCreateTabItem (" " & $status & " ")GuiCtrlCreateGroup ("Test text", 8, 32, 376, 84)GuiCtrlCreateTabItem (" " & $information & " ")GuiCtrlCreateGroup ("Test text", 8, 32, 376, 84)$Label_1 = GuiCtrlCreateLabel("click me to run", 300, 300, 10, 10)While 1$msg = GuiGetMsg()SelectCase $msg = $GUI_EVENT_CLOSEExitLoopCase $msg= $Label_1MsgBox (0, "test", "test")Case Else;;;EndSelectWEndWhile GuiGetMsg () <> $GUI_EVENT_CLOSEWEnd -------------------------------------------------The bold code doesn't show up. Link to comment Share on other sites More sharing options...
sylvanie Posted March 26, 2005 Share Posted March 26, 2005 Hello, I have moved the GUISETSTATE just before the while to draw all components of the window : GuiCreate ($title, 396, 396) GuiSetIcon ("ico.ico", 0) GuiCtrlCreateTab (5, 5, 385, 385, $WS_EX_WINDOWEDGE) GuiCtrlCreateTabItem (" " & $status & " ") GuiCtrlCreateGroup ("Test text", 8, 32, 376, 84) GuiCtrlCreateTabItem (" " & $information & " ") GuiCtrlCreateGroup ("Test text", 8, 32, 376, 84) $Label_1 = GuiCtrlCreateLabel("click me to run", 300, 300, 10, 10) GuiSetState ();<----------------- here While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg= $Label_1 MsgBox (0, "test", "test") Case Else ;;; EndSelect WEnd While GuiGetMsg () <> $GUI_EVENT_CLOSE WEnd So the group is drawn at th begining Link to comment Share on other sites More sharing options...
Tagor Posted March 26, 2005 Author Share Posted March 26, 2005 Thanks, that works. However you will need to press the "X" two times to close the program. Do you also know how to solve that? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 26, 2005 Developers Share Posted March 26, 2005 Thanks, that works. However you will need to press the "X" two times to close the program. Do you also know how to solve that?<{POST_SNAPBACK}>just remove the last 2 lines....While GuiGetMsg () <> $GUI_EVENT_CLOSE WEnd SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sylvanie Posted March 26, 2005 Share Posted March 26, 2005 Yes, You're right. I hvan't notice that. Supress the 2 last lines : While GuiGetMsg () <> $GUI_EVENT_CLOSE WEnd Because when your press the cross one time, you're leaving from the 1st loop; then the 2nd loop call GuigetMsg() a second Time. So you need to press the cross another time. Link to comment Share on other sites More sharing options...
sylvanie Posted March 26, 2005 Share Posted March 26, 2005 Sorry JDeb, I was writing my post, when you've posted yours ;-) Link to comment Share on other sites More sharing options...
Tagor Posted March 26, 2005 Author Share Posted March 26, 2005 Ah, thanks, I see! Link to comment Share on other sites More sharing options...
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