[maemo-developers] [maemo-developers] Sharing menuitem between differents Pageviews ...

From: Kalle Vahlman kalle.vahlman at gmail.com
Date: Sun Jul 10 18:52:55 EEST 2005
On 7/10/05, Jorge Souza <sao_jorge31 at yahoo.com.br> wrote:
> 
> Any advices on this issue ? :'(

Make an item with the same name to all the menus, and connect the same
callback to both/all of them. This is the only way to do this
currently, in the future you can do it with GtkUIManager magic, but
that's in the future...
 
> regards
> 
> > Hi all,
> >
> > In my app , I would like to share some specific
> > menuItems between all the registered pageviews. So
> > I've created a global menuItem variable, aiming to
> > append it to the menu of each pageview.
> >
> > So, after the creation of each pageview, I've tried
> > to
> > get its menu and than append my global menuItem. The
> > following quoted code ilustrates my intentions:
> >
> > <quoted>
> >
> > GtkMenu *mainMenu = NULL;
> >
> > // get main menu pointer
> > mainMenu =
> >
> GTK_MENU(hildon_appview_get_menu(current_page_view));
> >
> > // appeding the global Window menu
> > gtk_menu_shell_append(GTK_MENU_SHELL(mainMenu),
> > gMenuWindowMenuItem);
> >
> > </quoted>
> >
> > When I append the global menuItem to the first
> > apgeview (at the fisrt time, of course), every thing
> > works properly. But when I try a second time, I get:
> >
> > (app_test:19338): Gtk-WARNING **: Can't set a parent
> > on widget which has a parent
> >
> > at runtime. So, it is complaining that my menuItem
> > already has a parent (in this case, the parent is
> > the
> > former page_view's menu). Is there a way to juggle
> > this situation ?! How can I share menuItem between
> > different page_views ?!
> >
> > regards
> >
> > JS
> >
> > -- Jorge Souza
> > Embedded Linux App Developer
> >
> > __________________________________________________
> > Converse com seus amigos em tempo real com o Yahoo!
> > Messenger
> > http://br.download.yahoo.com/messenger/
> > _______________________________________________
> > maemo-developers mailing list
> > maemo-developers at maemo.org
> > https://maemo.org/mailman/listinfo/maemo-developers
> >
> 
> 
> -- Jorge Souza
> Embedded Linux App Developer
> 
> 
> 
> 
> 
> _______________________________________________________
> Yahoo! Acesso Grátis - Internet rápida e grátis.
> Instale o discador agora! http://br.acesso.yahoo.com/
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers
> 


-- 
Kalle Vahlman, zuh at iki.fi

More information about the maemo-developers mailing list