AutoHotkey Community

It is currently May 26th, 2012, 11:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 15th, 2009, 6:58 pm 
Offline

Joined: December 17th, 2008, 5:36 am
Posts: 80
I have run into a strange problem. I have a GUI 1 and a GUI 2. Each Gui needs a list view on it. However when I create them, both GUI's listview have the exact same ClassNN, SysListView321. How can I toggle over to each and edit them. The code below is based on this post but his listview are all in one GUI.

http://www.autohotkey.com/forum/topic50 ... e+listview

I assumed by chaning 'Gui, Listview, SysListView321' to 'Gui, 2:Listview, SysListView321' it would fix the problem but that is not the case. The Listview commands still edit the Listview on GUI 1.


Code:
find:
gui, 2:+owner1
Gui, 2:Add, ListView, r10 x10 w550 gMyListView2 Checked, blah, blah, blah, blah, blah, blah
Gui, 2:Show
Gui, 2:Listview, SysListView321
LV_ModifyCol(1, 200)
LV_ModifyCol(2, 25)
LV_ModifyCol(3, 200)
LV_ModifyCol(4, 50)
LV_ModifyCol(5, 200)
LV_ModifyCol(6, 55)
LV_ModifyCol(4, "Integer")  ; For sorting purposes, indicate that column 2 is an integer.
LV_Delete()                        ;clears current


Any help would be appreciated


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 8:22 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Code:
Loop 2
   Gui,%A_Index%:Add,ListView,% "w200 vSYSTAB" A_Index,Test
Loop 2
{
   Gui,%A_Index%:Default
   Gui,ListView,SYSTAB%A_Index%
;or Gui,ListView,SysListView321
   LV_Add("",A_Index)
}
Loop 2
   Gui,%A_Index%:Show,% "x" (A_Index-1)*300
Return

GuiClose:
2GuiClose:
ExitApp

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 8:57 pm 
Offline

Joined: October 9th, 2006, 8:19 pm
Posts: 236
Location: Finland
The Manual wrote:
All of the ListView functions operate upon the current thread's default GUI window (which can be changed via Gui, 2:Default).

Associated variable isn't sufficient (or needed for this) as HotKeyIt also demonstrated:
Quote:
Code:
Gui,ListView,SYSTAB%A_Index% ;or Gui,ListView,SysListView321

_________________
Pekka Vartto


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 9:39 pm 
Offline

Joined: December 17th, 2008, 5:36 am
Posts: 80
svi wrote:
The Manual wrote:
All of the ListView functions operate upon the current thread's default GUI window (which can be changed via Gui, 2:Default).


Thanks SVI. Designating GUI2 as default did the trick.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cerberus, Google Feedfetcher, Maestr0, rbrtryn, Tipsy3000 and 66 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group