paragui-users
[Top][All Lists]
Advanced

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

RE: [paragui-users] setting a call back for popup menu created by alayou


From: John Rainey
Subject: RE: [paragui-users] setting a call back for popup menu created by alayout
Date: Thu, 30 May 2002 07:06:16 -0400

//*********add public methods declarations to pgpopupmenu.h

bool setMenuItemHandler(int id,MSG_CALLBACK handler,void *data);
bool SetMenuItemEventObject(int id,PG_EventObject* calledobj,
MSG_CALLBACK_OBJ cbfunc, void *clientdata);

//*********add public methods to pgpopupmenu.cpp
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;
}

bool PG_PopupMenu::SetMenuItemEventObject(int id,PG_EventObject* calledobj,
MSG_CALLBACK_OBJ cbfunc, void *clientdata)
{
        MII  it;
        PG_PopupMenu::MenuItem* item;
        int itid;

        it=items.begin();
        while(it!=items.end())
        {
                itid=(*it)->getId();
                if(id==itid)
                {
                        item=*it;
                        
item->SetEventObject(MSG_SELECTMENUITEM,calledobj,cbfunc,clientdata);
                        return true;
                }
                it++;
        }
        return false;
}

-----Original Message-----
From:   address@hidden
[mailto:address@hidden On Behalf Of
Alexander Pipelka
Sent:   Wednesday, May 29, 2002 5:30 PM
To:     paragui-users
Subject:        Re: [paragui-users] setting a call back for popup menu created 
by
alayout

John,

You're right.
It's currently impossible to set event callbacks for XML layout
generated menuitems. :((

There's definitely need for some changes. And yes: I also dislike them
:))

As you are the first one having that trouble (and needing that feature)
could you please provide some diffs for a working solution ?

Your changes will go directly into the upcoming 1.0.2 version.

Thanks for your help

Alex

Am Mit, 2002-05-29 um 20.28 schrieb John Rainey:
> 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.
>
>
>
> _______________________________________________
> paragui-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users




_______________________________________________
paragui-users mailing list
address@hidden
http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users




reply via email to

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