you can use `insert_child_at_index()` to put actor before existing ones
On 29/05/12 14:15, Amy C wrote: > Hi all, > > I'd like to create a PopupMenuItem that is basically a > PopupSwitchMenuItem (the label + toggle) and to the *left* of that, a > button and an icon. > > Now if the button/icon were to the right I'd just create a > PopupSwitchMenuItem and call .addActor( theButton ) and .addActor( > theIcon ). > > How can I insert these to the left instead? I could subclass > PopupBaseMenuItem and basically replicate the code of > PopupSwitchMenuItem but make sure that in _init I addActor my button > and icon *before* the label and toggle, but this seems to be not the > "right way" in that I have to copy the PopupSwitchMenuItem. i.e. I'd > be recreating the wheel (ie have to always make sure the code I copied > from PopuSwitchMenuItem remains consistent every time it changes) > instead of just using it. > > Could I make a St.{something? Box? BoxLayout} and just add an > St.Button, St.Icon and then a PopupSwitchMenuItem to it? But would a > PopupMenu then be able to addMenuItem this? I feel I'm missing > something simple. > > cheers. > _______________________________________________ > gnome-shell-list mailing list > gnome-shell-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gnome-shell-list _______________________________________________ gnome-shell-list mailing list gnome-shell-list@gnome.org https://mail.gnome.org/mailman/listinfo/gnome-shell-list