News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Function to return the current directory
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: Function to return the current directory

An update on the dynamic menus.
You can use Fl_Menu_Bar:find_item(my_menu_item_string) to get a pointer to a specific menu item, which is much more pleasant than trying to determine the index of a particular menu item.
I still have no idea how to use Fl_Menu_Item, but this seems to work with menu items created with my_menu:add(my_menu_item_string).

Code:
my_menu=fltk:Fl_Menu_Bar(0,0,window_width,30)
my_menu:add("&File/open")
my_menu:add("&File/save")
save_item=my_menu:find_item("&File/save")

Now you can disable the "save" item when it's not needed:

Code:
save_item:deactivate()

This can also be used to perform (most?) other actions that can be applied to the Fl_Menu_ class, such as replacing/renaming items. The only things i've tested so far is changing font properties and item labels.

07-20-2007 09:01 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: Function to return the current directory - mikshaw - 07-20-2007 09:01 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: