[wxruby-users] Adding menu items to a TaskBar

Alex Fenton alex at pressure.to
Mon Jan 14 12:01:18 EST 2008


Anton Komarov wrote:
> Yes I was read this message before write my post.
> I'm quite new in Ruby and not understand this code :(
> actually I understand what this code doing but I don't understand how I 
> can use this code in my project
Have you actually tried working at it? As the previous emails said, 
create_popup_menu is called EVERY time the user clicks on the taskbar 
icon. So if the contents of that menu should change depending on the 
program's state (eg if the user is logged in), test for that state in 
create_popup_menu and the correct menu will be shown.

 From your example, what you could change is move the "if @user.login?" 
test into create_popup_menu. If the user is logged in, show the extra 
project menu items, if not, don't.

hth
alex





More information about the wxruby-users mailing list