Sign in to follow this  
Followers 0
JohnBoy

GuiWrite No Longer

15 posts in this topic

:ph34r: Okay, maybe I've gone blind, but I can't seem to find a suitable replacement for the GuiWrite function in the helpfile for the new 'bleeding edge' version of the AutoIt GUI. I'm trying to convert the Startup Manager script to run under the new version and I'm stopped on the GuiWrite function. Any ideas?

Share this post


Link to post
Share on other sites



:ph34r:  Okay, maybe I've gone blind, but I can't seem to find a suitable replacement for the GuiWrite function in the helpfile for the new 'bleeding edge' version of the AutoIt GUI. I'm trying to convert the Startup Manager script to run under the new version and I'm stopped on the GuiWrite function. Any ideas?

<{POST_SNAPBACK}>

Did you try ?

GUICtrlSetData ( controlid, data [,default] )

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
:ph34r: Okay, I looked at it before in the help file and 'read-but-did-not-comprehend' it. Sorry, but 'Define data info for a control' at first glance reads about as effectively for me as 'hand-held columnar ink dispenser' does for a description of a pen. After looking at it and thinking about it , I realize it's probably the most generically accurate description. It's also probably about the most concise (almost terse) way to say it. I honestly can't say that I have any better way to phrase it at the moment. I'll try to look a little harder at the phraseology in the help file hereafter. Thanks for the help. I appreciate it!

Share this post


Link to post
Share on other sites

Can you show me the result when you're finished? :P

That will save me some time, because I'm going to convert all the GUI scripts I have.

Share this post


Link to post
Share on other sites
:ph34r: No problem. My first crack at it does run, but the dropdown listbox is showing the ControlID as the first element in the box. This is causing all the elements to be off by one, i.e. the first element is 'List 1' (and it shouldn't be). The next element is 'RunServicesOnce (Machine)' (which should be the first element). And so on and so on. Apparently the selected index is correct because if I select the 5th element in the box in the compiled version from your zip file, I get some of my startup programs listed. If I select the 5th element in my compiled version, I also get the same result, but the 5th element in your compiled files' listbox is the 6th element in mine. As I said, the listbox seems to want to list the ControlID as the first element. I'll keep poking around at it until I figure it out. If you have any ideas, feel free to let me know.

Share this post


Link to post
Share on other sites

Just noticed some additional quirks. I ran the sample script contained in the helpfile for the GUICtrlCreateList function. It also exhibits the same issue I am experiencing in my script. The first element in the listbox is the name of the ControlID.

Since the question will inevitably arise concerning what I am running, it is as follows:

Computer:

Operating System Microsoft Windows 2000 Professional

OS Service Pack Service Pack 4

Internet Explorer 6.0.2800.1106 (IE 6.0 SP1)

DirectX 4.09.00.0902 (DirectX 9.0b)

Motherboard:

CPU Type AMD Athlon XP, 1533 MHz (11.5 x 133) 1800+

Motherboard Name MSI K7N2 Delta-L (MS-6570G) (5 PCI, 1 AGP, 1 ACR, 3 DIMM, Audio, LAN)

Motherboard Chipset nVIDIA nForce2 Ultra 400

System Memory 512 MB (DDR SDRAM)

BIOS Type Award (03/29/04)

Communication Port Communications Port (COM1)

Communication Port Communications Port (COM2)

Communication Port Printer Port (LPT1)

Display:

Video Adapter NVIDIA GeForce2 Ti (64 MB)

3D Accelerator nVIDIA GeForce2 Ti

As always, any help is appreciated.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I converted StartupMgr myself (5 mins work).

I found the problems:

Replace "List 1" with ""

Replace "List 2" with ""

Check this post for more info on the changes in the new version.

Edited by SlimShady

Share this post


Link to post
Share on other sites

Just noticed some additional quirks. I ran the sample script contained in the helpfile for the GUICtrlCreateList function. It also exhibits the same issue I am experiencing in my script. The first element in the listbox is the name of the ControlID.

As always, any help is appreciated.

<{POST_SNAPBACK}>

Just ran the example and it shows 2 lines in the list.:

item1:"buttons that have been clicked"

item2:"The following buttons have been clicked"

What do you see exactly ?

Opt("GUINotifyMode", 1)
Global $MESSAGE = "The following buttons have been clicked"
GUICreate("My GUI list"); will create a dialog box that when displayed is centered
$add = GUICtrlCreateButton("Add", 64, 32, 75, 25)
$clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
$mylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97)
GUICtrlSetLimit(-1, 200)   ; to limit horizontal scrolling
GUICtrlSetData(-1, "|" & $MESSAGE)
$close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)
GUISetState()
$msg = 0
While $msg <> - 3
   $msg = GUIGetMsg()
   Select
      Case $msg = $add
         GUICtrlSetData($mylist, "You clicked button No1|")
      Case $msg = $clear
         GUICtrlSetData($mylist, "")
      Case $msg = $close
         MsgBox(0, "", "the closing button has been clicked", 2)
         Exit
   EndSelect
Wend

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

:(  Okay, maybe I've gone blind, but I can't seem to find a suitable replacement for the GuiWrite function in the helpfile for the new 'bleeding edge' version of the AutoIt GUI. I'm trying to convert the Startup Manager script to run under the new version and I'm stopped on the GuiWrite function. Any ideas?

<{POST_SNAPBACK}>

Guiwrite was split in to one for the text/data GUICtrlSetData and one for the state GUICtrlSetState :ph34r:

Share this post


Link to post
Share on other sites

Reply to JdeB:

I see the same thing as you do. Am I reading the sample code correctly? Is the following line:

$mylist=GUICtrlCreateList ("buttons that have been clicked", 176,32,121,97)
supposed to create a listbox with 'buttons that have been clicked' as the first line in the listbox? It looks for all the world to me like one of the listbox elements.

Share this post


Link to post
Share on other sites

I converted StartupMgr myself (5 mins work).

I found the problems:

Replace "List 1" with ""

Replace "List 2" with ""

Check this post for more info on the changes in the new version.

<{POST_SNAPBACK}>

Okay SlimShady, I'm able to spare a little more time from gardening(canning), grandkids, and attending a wedding. As I told JdeB in my post to him, the sample code in the help file is exhibiting the same behavior as I am observing in my code. Maybe it would be helpful to look at your particular conversion for the StartupMgr script. That way I can see what I'm doing wrong.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

First I'm going to show you difference between the old style and the new style.

old style:

$mylist = GUISetControl("list", "A title", 176, 32, 121, 97)
GUISetControlData($mylist, "buttons that have been clicked")

GUISetControlData($mylist, "You clicked button No1|")

new style:

$mylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97)
GUICtrlSetData($mylist, "You clicked button No1|")

The "title" parameter has been removed from many control functions,

because it's useless.

It has been replaced by the "data" parameter.

In other words: Text that you want in the listbox.

If you don't want any text in the listbox on load, leave it as ""

I zipped the old and the new StartupMgr and included the compiled version.

Click http://www.autoitscript.com/fileman/users/public/SlimShady/StartupMgr.zip

Edited by SlimShady

Share this post


Link to post
Share on other sites

Thanks SlimShady, I ran your code right out of the box and got the following message:

C:\Documents and Settings\xxxx.DESKTOP\Local Settings\Temp\StartupMgr.au3 (24) : ==> Unknown function name.: 
$msg = GUIPeekMsg() 
$msg = ^ ERROR
>Exit code: 1    Time: 0.322

Am I having version problems, because it's calling 'GUIPeekMsg() ' an unknown function?

I performed the following version validation:

The @AutoItVersion macro returns '3.0.103.0'

The time/date stamp of the 'autoit-v3.0.103.exe' file I installed AutoIt from is Thursday, September 23, 2004, 10:19:56 PM

Additional comments to my installation of AutoIt: I uninstalled the old version, deleted the folder, and ran Regcleaner to clean up the registry keys before installing the new version.

:ph34r: I don't know what else I can do!

Share this post


Link to post
Share on other sites

Change GuiPeekMsg() to GuiGetMsg().

Share this post


Link to post
Share on other sites

Change GuiPeekMsg() to GuiGetMsg().

<{POST_SNAPBACK}>

I JUST got done checking the archives for GuiPeekMsg. After reading the posts, I suspected a version issue. Made the change, it ran fine. Is my version wrong? I thought it was the bleeding edge version.

Share this post


Link to post
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
Sign in to follow this  
Followers 0