group to remove

The basics of how to develop, test, and use models.
Post Reply
Gannier

group to remove

Post by Gannier »

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
ted
Site Admin
Posts: 5869
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

The reason you're not getting an answer may be because nobody quite knows what
question you are asking. Can you restate the question in a different way?
Gannier

Post by Gannier »

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 ?
ted
Site Admin
Posts: 5869
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Gannier wrote:I want to remove them and remove the group name without using the WindowGroupManager
Why can't you just comment out the load_file() statement that reads the ses file that
recreates the Window Group Manager?
Gannier

Post by Gannier »

Why can't you just comment out the load_file() statement that reads the ses file that
recreates the Window Group Manager?
this could be a solution, but group window have their utilities

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)
}
am I right ?
ted
Site Admin
Posts: 5869
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Gannier wrote:
Why can't you just comment out the load_file() statement that reads the ses file that
recreates the Window Group Manager?
this could be a solution, but group window have their utilities
OK, so you have more than one group and you don't want to throw them all away.
That makes sense.
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
In other words, you analyzed the contents of lib/hoc/wingroup.hoc
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
the following code remove all groups except the first one

Code: Select all

while (WindowMenu[0].groups.count > 1) {
	WindowMenu[0].groups.remove(1)
}
is correct.

Please let me know if it did work.
Post Reply