From: Paul Lutus Date: 2006-09-26T18:10:07+09:00 Subject: Re: Problem with TkMenu::add_cascade matthias@kl-mailer.de wrote: > Hi list, > > i'm working on gui using ruby/tk. Any reason you aren't using Qt? I don't want to sound like a broken record here, but Qt's documentation is much better than for Tk, the apps look better, and so forth. > Everything went fine (exept the poor documentation), but now i have a > problem with submenus. A small example-code to demonstrate the issue: > > menu = TkMenu.new > menu.add_command('label' => 'Foo', 'command' => lambda { p "foo" }) > sub = TkMenu.new > sub.add_command('label' => 'Bar', 'command' => lambda { p "bar" }) > menu.add_cascade('label' => 'submenu', 'menu' => sub) > > canvas = TkCanvas.new > canvas.bind('1') {|e| menu.popup e.x_root, e.y_root} > canvas.pack > > Tk.mainloop How about a complete example, with headers, so we can test the code? -- Paul Lutus http://www.arachnoid.com