Jump to content

Why doesn't a particular label (GUI) show?


Recommended Posts

The code below was taken from a script I recently wrote. What I want to know is why $lblDisplay doesn't show up once the GUI/Canvas gets painted onto the screen? I first thought it was because $lblDisplay is actually empty since it is not displaying anything, but then - $lblBackground shows up and it is also "empty". To solve this, I actually had to move the $lblDisplay below "GUISetState(@SW_SHOW)". I'm just curious why this is happening.

Thanks for your insights.

#include <GUIConstants.au3>

; Create the canvas
$frmMain = GUICreate("ICP Workstation GUI", 616, 434, 327, 174)
; Set the icon to be used at the top left corner of the window
    GUISetIcon("C:\Documents and Settings\Koua Lo\My Documents\icons\Mac Hardware\iMac.ico")
; Create the "System Information" group
        $grpDisplay = GUICtrlCreateGroup(" System Information ", 240, 8, 368, 417)
        $lblDisplay = GUICtrlCreateLabel("", 254, 56, 340, 356, $WS_VSCROLL)
        $txtLookup = GUICtrlCreateInput("", 246, 24, 281, 21)
        $btnSearch = GUICtrlCreateButton("Search", 530, 24, 70, 21, 0)
        $lblBackground = GUICtrlCreateLabel("", 247, 48, 353, 372, -1, $WS_EX_STATICEDGE)
        GUICtrlCreateGroup("", -99, -99, 1, 1)
; Individual buttons
    $btnMySys = GUICtrlCreateButton("My System Info", 8, 13, 89, 21, 0)
    $btnPing = GUICtrlCreateButton("Test Network", 8, 36, 89, 21, 0)
    $lstMain = GUICtrlCreateList("", 104, 13, 129, 409); List viewer
    $btnExit = GUICtrlCreateButton("E&xit", 8, 400, 89, 21, 0)
    $btnClear = GUICtrlCreateButton("&Clear", 8, 59, 89, 21, 0)

; Paint the canvas onto the screen
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btnExit
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

Maybe I'm missing something but it appears that since you have your background 'drawing' after the lbldisplay its 'drawing' over it.

#include <GUIConstants.au3>

; Create the canvas
$frmMain = GUICreate("ICP Workstation GUI", 616, 434, 327, 174)
; Set the icon to be used at the top left corner of the window
    GUISetIcon("C:\Documents and Settings\Koua Lo\My Documents\icons\Mac Hardware\iMac.ico")
; Create the "System Information" group
    $lblBackground = GUICtrlCreateLabel("", 247, 48, 353, 372, -1, $WS_EX_STATICEDGE)
        $grpDisplay = GUICtrlCreateGroup(" System Information ", 240, 8, 368, 417)
        $lblDisplay = GUICtrlCreateLabel("54654654654654", 254, 56, 340, 356, $WS_VSCROLL)
        $txtLookup = GUICtrlCreateInput("", 246, 24, 281, 21)
        $btnSearch = GUICtrlCreateButton("Search", 530, 24, 70, 21, 0)
        ;$lblBackground = GUICtrlCreateLabel("", 247, 48, 353, 372, -1, $WS_EX_STATICEDGE)
        GUICtrlCreateGroup("", -99, -99, 1, 1)
; Individual buttons
    $btnMySys = GUICtrlCreateButton("My System Info", 8, 13, 89, 21, 0)
    $btnPing = GUICtrlCreateButton("Test Network", 8, 36, 89, 21, 0)
    $lstMain = GUICtrlCreateList("", 104, 13, 129, 409); List viewer
    $btnExit = GUICtrlCreateButton("E&xit", 8, 400, 89, 21, 0)
    $btnClear = GUICtrlCreateButton("&Clear", 8, 59, 89, 21, 0)

; Paint the canvas onto the screen
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btnExit
            Exit
    EndSwitch
WEnd

EDIT: I should probably be a bit more descriptive... sorry hunger talking. I moved the $lblBackgroung to the top, allowing the lbldisplay to draw over it. I commented out the original line so you could see what I did.

Edited by someone
While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd
Link to comment
Share on other sites

Duh me!!

Thanks.

Maybe I'm missing something but it appears that since you have your background 'drawing' after the lbldisplay its 'drawing' over it.

#include <GUIConstants.au3>

; Create the canvas
$frmMain = GUICreate("ICP Workstation GUI", 616, 434, 327, 174)
; Set the icon to be used at the top left corner of the window
    GUISetIcon("C:\Documents and Settings\Koua Lo\My Documents\icons\Mac Hardware\iMac.ico")
; Create the "System Information" group
    $lblBackground = GUICtrlCreateLabel("", 247, 48, 353, 372, -1, $WS_EX_STATICEDGE)
        $grpDisplay = GUICtrlCreateGroup(" System Information ", 240, 8, 368, 417)
        $lblDisplay = GUICtrlCreateLabel("54654654654654", 254, 56, 340, 356, $WS_VSCROLL)
        $txtLookup = GUICtrlCreateInput("", 246, 24, 281, 21)
        $btnSearch = GUICtrlCreateButton("Search", 530, 24, 70, 21, 0)
        ;$lblBackground = GUICtrlCreateLabel("", 247, 48, 353, 372, -1, $WS_EX_STATICEDGE)
        GUICtrlCreateGroup("", -99, -99, 1, 1)
; Individual buttons
    $btnMySys = GUICtrlCreateButton("My System Info", 8, 13, 89, 21, 0)
    $btnPing = GUICtrlCreateButton("Test Network", 8, 36, 89, 21, 0)
    $lstMain = GUICtrlCreateList("", 104, 13, 129, 409); List viewer
    $btnExit = GUICtrlCreateButton("E&xit", 8, 400, 89, 21, 0)
    $btnClear = GUICtrlCreateButton("&Clear", 8, 59, 89, 21, 0)

; Paint the canvas onto the screen
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btnExit
            Exit
    EndSwitch
WEnd

EDIT: I should probably be a bit more descriptive... sorry hunger talking. I moved the $lblBackgroung to the top, allowing the lbldisplay to draw over it. I commented out the original line so you could see what I did.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...