Hello !
How can I delete a group window from a hoc file?
I Know that :
PWManager[0].count give me the total number of windows
PWManager[0].group(8) give me the number of the group (3) of the 9th window
WindowGroup[3].name give me the name of this group
WindowGroup[3].list.count give me the number of windows in this group
but how I could delete this group, not Windows in this group but the group without using the "Group Manager" interface
Thanks
group to remove
OK, I will explain more explicitely
With the WindowGroup manager, I regrouped some grahs into a window group that I saved into a session file. When this session file is loaded by the "load_file()" function, graphs and the group name was found in the WindowGroupManager.
But after viewing these windows, I want to remove them and remove the group name without using the WindowGroupManager (in fact, I want to create a panel with some buttons to display and remove automatically some graphs).
I found some functions to help me in this way
PWManager[0].count give me the total number of windows
PWManager[0].group(8) give me the number of the group (3) of the 9th window
WindowGroup[3].name give me the name of this group
WindowGroup[3].list.count give me the number of windows in this group
I know how to remove the last graph opened (even in a window group) but I can't find a function to delete a group name.
Is this a problem that someone has already tried to solve ?
With the WindowGroup manager, I regrouped some grahs into a window group that I saved into a session file. When this session file is loaded by the "load_file()" function, graphs and the group name was found in the WindowGroupManager.
But after viewing these windows, I want to remove them and remove the group name without using the WindowGroupManager (in fact, I want to create a panel with some buttons to display and remove automatically some graphs).
I found some functions to help me in this way
PWManager[0].count give me the total number of windows
PWManager[0].group(8) give me the number of the group (3) of the 9th window
WindowGroup[3].name give me the name of this group
WindowGroup[3].list.count give me the number of windows in this group
I know how to remove the last graph opened (even in a window group) but I can't find a function to delete a group name.
Is this a problem that someone has already tried to solve ?
this could be a solution, but group window have their utilitiesWhy can't you just comment out the load_file() statement that reads the ses file that
recreates the Window Group Manager?
Exploring the wingroup.hoc file, I saw that group are pointed by the "WindowMenu[0].groups" list
So,
WindowMenu[0].groups.count display the number of group
WindowMenu[0].groups.object(0).name display the name of the first group
the following code remove all groups except the first one
Code: Select all
while (WindowMenu[0].groups.count > 1) {
WindowMenu[0].groups.remove(1)
}
-
- Site Admin
- Posts: 6305
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
OK, so you have more than one group and you don't want to throw them all away.Gannier wrote:this could be a solution, but group window have their utilitiesWhy can't you just comment out the load_file() statement that reads the ses file that
recreates the Window Group Manager?
That makes sense.
In other words, you analyzed the contents of lib/hoc/wingroup.hocExploring the wingroup.hoc file, I saw that group are pointed by the "WindowMenu[0].groups" list
So,
WindowMenu[0].groups.count display the number of group
WindowMenu[0].groups.object(0).name display the name of the first group
Then you tried the statements
WindowMenu[0].groups.count
and
WindowMenu[0].groups.object(0).name
and they produced the results that you expected?
If so, then very good! That's how to figure things out!
And I would expect that your next inference
is correct.the following code remove all groups except the first oneCode: Select all
while (WindowMenu[0].groups.count > 1) { WindowMenu[0].groups.remove(1) }
Please let me know if it did work.