I'm confused about the required value of the type arg to gtk.Toolbar
.append_element when trying to insert a radio button into the toolbar.  The
Gtk docs say

    If type == GTK_TOOLBAR_CHILD_RADIOBUTTON, widget is used to determine
    the radio group for the new element. In all other cases, widget must be
    NULL.

I thought passing in a radio button would be okay:

    import gtk

    w = gtk.Window ()
    w.connect ("destroy", gtk.mainquit)

    tb = gtk.Toolbar ()
    w.add (tb)

    rb = gtk.RadioButton()
    tb.append_element ( gtk.TOOLBAR_CHILD_RADIOBUTTON,
                        rb, "radio", "tooltip", "verbose tip",
                        None, None, None )
    w.show_all ()
    gtk.main ()

but PyGtk complains

    Traceback (most recent call last):
      File "tb2.py", line 14, in ?
        None, None, None )
    TypeError: second argument must be a GtkWidget or None

I can't use a literal GtkWidget, since it's abstract and can't be
instantiated.  Passing None doesn't work either.  What am I supposed to use?
I can't find any examples in either PyGtk or Gtk proper that insert radio
buttons into toolbars.

Thx,

Skip

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to