Qui, 2004-11-04 �s 00:17 +1100, Nigel Tao escreveu:
> > There's something wrong with the code:
> >
> > ---
> > menubar = gtk.MenuBar()
> > menubar.connect("button-press-event", on_menubar_click)
> > menubar.append(root_menu_item)
> > gtk.rc_parse_string('''
> > style "browser-bookmarks-menubar-style"
> > {
> > GtkMenuBar::shadow-type = none
> > GtkMenuBar::internal-padding = 0
> > }
> > class "GtkMenuBar" style "browser-bookmarks-menubar-
> > style"''')
> > gobject.type_register(menubar.__class__)
> > ---
> > You can't register the class gtk.MenuBar. It is already registered.
> > I'm surprised this actually worked... You should do something like:
>
> I think that the gobject.type_register came from a copy-and-paste that I
> did of some C code I found. I've taken it out, and it still seems to
> work.
>
> Yeah, I was a little surprised that this actually worked too, but for a
> different reason. My concern was that trying to set the style of a
> GtkMenuBar would affect all other GtkMenuBars running, but the menus in
> all the other applications seem unaffected, so I shrugged and left it as
> it was.
>
>
> > class MyMenuBar: pass
> > gobject.type_register(MyMenuBar)
> >
> > (...)later in the code
> >
> > menubar = MyMenuBar()
> > menubar.connect("button-press-event", on_menubar_click)
> > menubar.append(root_menu_item)
> > gtk.rc_parse_string('''
> > style "browser-bookmarks-menubar-style"
> > {
> > GtkMenuBar::shadow-type = none
> > GtkMenuBar::internal-padding = 0
> > }
> > class "MyMenuBar" style "browser-bookmarks-menubar-
> > style"''')
>
> In this case, should MyMenuBar subclass GtkMenuBar? Does that
> automatically register the type?
No, subclassing doesn't register the type, but notice above I put this
line:
gobject.type_register(MyMenuBar)
>
>
> > Not sure if it works (due to control/container split), but maybe:
> > menubar.unset_flags(gtk.CAN_FOCUS).
>
> This didn't work for me - I tried calling it on the menubar, the menu,
> the menuitem, and the applet. Failing all that, I have just asked the
> gtk-list mailing list for help.
>
>
> thanks,
> Nigel.
>
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
--
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic.
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
