paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-users] setting a call back for popup menu created by a layout


From: John Rainey
Subject: [paragui-users] setting a call back for popup menu created by a layout
Date: Wed, 29 May 2002 14:28:54 -0400

I can not find a function to set the call back for a popup menu on a menu
bar when
they have been created by the load layout routine. All other widgets can be
retrieved by their id
and have their call back set. The popup menu item can only be retrieved from
the popup menu's list of items which is protected. I added the following
function.

bool PG_PopupMenu::setMenuItemHandler(int id,MSG_CALLBACK handler,void
*data){

        MII  it;
        PG_PopupMenu::MenuItem* item;
        int itid;

        it=items.begin();
        while(it!=items.end())
        {
                itid=(*it)->getId();
                if(id==itid)
                {
                        item=*it;
                        item->SetEventCallback(MSG_SELECTMENUITEM, handler, 
data);
                        return true;
                }
                it++;
        }
        return false;
}

Is this necessary or am I missing something????
I would prefer not to edit paragui but if this is needed then a
SetEventObject function should also be added.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]