Posts ID:132727 Favorites Creations Medals
 ID:132727   Dec 1 2009, 12:16 pm It would be nice to see the menus being able to be split off into sub-menus like in the screenshot I took of firefox shown above.
 #1 Dec 1 2009, 1:37 pm (Edited on Dec 1 2009, 1:43 pm) Lummox said it's possible during runtime, not sure exactly how, but he said it'd be a female dog to add into the editor. Edit: Look up "Menus" in the skin ref; it talks about the parent parameter.
It is possible:
 client/New() . = ..() var/list/L = list("parent" = "menu", "name" = "View") winset(src, "viewmenu", list2params(L)) L = list("parent" = "viewmenu", "name" = "Toolbars") winset(src, "toolbarsmenu", list2params(L)) L = list("parent" = "toolbarsmenu", "name" = "Navigation Toolbar", "command" = "byond://?src=\ref[src];toggle=nav", "is-checked" = "true", "can-check" = "true") winset(src, "navtoolbar", list2params(L)) 
In response to Android Data (#2)
Android Data wrote:
It is possible:
 > client/New()> . = ..()> var/list/L = list("parent" = "menu", "name" = "View")> winset(src, "viewmenu", list2params(L))> L = list("parent" = "viewmenu", "name" = "Toolbars")> winset(src, "toolbarsmenu", list2params(L))> L = list("parent" = "toolbarsmenu", "name" = "Navigation Toolbar", "command" = "byond://?src=\ref[src];toggle=nav", "is-checked" = "true", "can-check" = "true")> winset(src, "navtoolbar", list2params(L))> 

In this image, were it says Toolbars, under it says "Status Bar". When I try to add more then one it only shows the second one.

I've tried
  var/list/L = list("parent" = "menu", "name" = "Interface Color") winset(src, "viewmenu", list2params(L)) L = list("parent" = "viewmenu", "name" = "Blue", "parent" = "viewmenu", "name" = "Red") winset(src, "toolbarsmenu", list2params(L)) L += list("parent" = "viewmenu1", "name" = "Red") winset(src, "toolbarsmenu1", list2params(L)) 

That only makes it show "Red". And I've also tried:
  var/list/L = list("parent" = "menu", "name" = "Interface Color") winset(src, "viewmenu", list2params(L)) L = list("parent" = "viewmenu", "name" = "Blue", "parent" = "viewmenu", "name" = "Red") winset(src, "toolbarsmenu", list2params(L)) 

Both just show "Red" and not include the "Blue" part.

Any help on this? And Yes I do know my topic on this is old, but pointless making a new topic when there already is one.
In response to Howey (#3)
You can't add two menu items in the same winset(), nor can you have two different associated values in an associative list. This line will never work:

 L = list("parent" = "viewmenu", "name" = "Blue", "parent" = "viewmenu", "name" = "Red") 

L["name"] cannot be both "Blue" and "Red", and you've set L["parent"] twice. I'm not sure how DM will compile this list; it might give you a list with the items "parent", "name", "parent", and "name" but there are only two associated values. It might also just give you a list with "parent" and "name". I'm also not sure which result you'd get out of list2params(), but it definitely won't be what you were expecting.

Lummox JR
 #5 Mar 29 2010, 11:09 am In response to Lummox JR (#4) So is there a way to do it?
 #6 Mar 29 2010, 12:31 pm In response to Howey (#5) You can add as many menu items as you like, but you can't do it all in the same winset, and you can't make associative lists carry two different associated values for the same item. Lummox JR