comparison mde/menus.d @ 133:9fd705793568

Fixed menu popup bug, improved recursion detection. Menu popups can now determine whether or not they are sub-menus. Recursion detection can now also check content (if not the same, there's not a risk of infinite recursion).
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 23 Jan 2009 16:05:05 +0000
parents 264028f4115a
children 9f035cd139c6
comparison
equal deleted inserted replaced
132:264028f4115a 133:9fd705793568
34 auto quit = new EventContent("quit"); 34 auto quit = new EventContent("quit");
35 quit.addCallback ((Content){ 35 quit.addCallback ((Content){
36 debug logger.trace ("Quit (from menu)"); 36 debug logger.trace ("Quit (from menu)");
37 run = false; 37 run = false;
38 }); 38 });
39 menus.append (new ContentList ("main", [cast(Content)quit])); 39 auto main = new ContentList ("main", [cast(Content)quit]);
40 debug {
41 main.append (new ContentList ("sm1", [cast(Content) new EventContent ("a"), new EventContent ("b")]));
42 main.append (new ContentList ("sm2", [cast(Content) new EventContent ("c"), new EventContent ("d")]));
43 }
44 menus.append (main);
40 } 45 }