pharo-spec / mars-gtk

The Gtk3 bindings for Pharo and Spec
14 stars 6 forks source link

SpMenuButtonPresenter not working on Gtk #32

Closed pavel-krivanek closed 4 years ago

pavel-krivanek commented 4 years ago

SpMenuButtonPresenter is not showing menus correctly with Gtk backend

app := SpApplication new.
app useBackend: #Gtk.

    loremIpsumWords := String loremIpsum substrings.
    menuButton := (SpMenuButtonPresenter newApplication: app) 
        menu: [ (SpMenuPresenter owner: menuButton)
            addGroup: [ :group | group
                addItem: [ :item | item name: '1: ', loremIpsumWords atRandom ];
                addItem: [ :item | item name: '2: ', loremIpsumWords atRandom ];
                addItem: [ :item | item name: '3: ', loremIpsumWords atRandom ] ];
            yourself ];
        yourself.

    menuButton openWithSpec
pavel-krivanek commented 4 years ago

so it looks like handling of button-press-event (in GtkMenuButtonAdapter>>#addModelTo:) is preventing the menu popup happen