Re: Creating composite PopupMenuItems
- From: Amy C <mathematical coffee gmail com>
- To: Tim <darkxst fastmail fm>
- Cc: gnome-shell-list gnome org
- Subject: Re: Creating composite PopupMenuItems
- Date: Tue, 29 May 2012 16:32:23 +1000
But PopupSwitchMenuItem/PopupBaseMenuItem do not have this method,
only addActor, and menuItem.actor.insert_child_at_index seems not to
exist.
If I use insert_child_at_index on some private member of the
PopupSwitchMenuItem I'd have to make sure I did everything else that
PopupSwitchMenuItem.addActor does (adding Params.parse(...) to
this._children, etc).
At the moment I'm subclassing PopupBaseMenuItem, making a
St.BoxLayout, and putting a St.Button, St.Icon and
PopupMenu.PopupSwitchMenuItem inside it (haven't actually tried the
code yet).
I have this vague feeling that the Popup*MenuItems should really be
top-level things and not be embedded within a PopupBaseMenuItem.
cheers.
On Tue, May 29, 2012 at 3:45 PM, Tim <darkxst fastmail fm> wrote:
> 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]