Jump to content

[SOLVED] Need Help With GUI Creation


Recommended Posts

I tried to create a GUI in this chunk of code. Can someone tell me what I failed in?

#include <GuiListBox.au3>
#include <GUIConstantsEx.au3>
#include <Clipboard.au3>
Dim $data, $msg
$winhandle = GUICreate("SmartClip",800,160)
$listctrl = GUICtrlCreateList("wtf",0,0,200,160)

#cs
$ =
$
#ce

GUISetState(@SW_SHOW)
;GUICtrlRead

While Not $msg = -3
    $msg = GUIGetMsg()
WEnd
Link to comment
Share on other sites

  • Moderators

macweirdo,

You are creating the GUI, but you have misused Not and so the code exits the While..WEnd loop and the GUI closes as soon as any event occurs! ;)

I will try to explain:

By using Not you converted $msg into a boolean variable (either True or False) - from now on any comparison operator (such as <>) will make Boolean comparisons. As far as AutoIt is concerned, 0 = False and any other value = True.

While no events are occuring, GUIGetMsg returns zero - you convert that to True by using Not and the comparison is valid because -3 is also treated as True.

As soon as an event of any kind occurs, GUIGetMsg returns an integer which Not converts to 0 (False) - now the comparison is not valid and you exit the loop and the script.

A bit complex, but I hope you follow. :alien:

Just use:

While $msg <> -3

in your loop and all will be well.

Please ask if anyting is unclear. :huh2:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

macweirdo,

My pleasure. ;)

how do I change the title of this topic to begin with [sOLVED]?

You need 5 posts total (I think) and then you will see an "EDIT" button appear on the post. Then edit the first post and select the "Use full editor" option" - that allows you to edit the title.

I will ask a Mod to change this one for you. :alien:

M23

Edit: And as you can see, it has been done within a few minutes - thanks to the kind Mod! :huh2:

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...