Just found out about keymaps. Well! That seems to be the answer. Thanks :)
Chris Lemmer-Webber writes: > Hello, > > I'm using the mrlib/hierlist in a GUI I have, and I wanted to add a > right-click menu. I'm trying to do that, but I can't find an > appropriate place to notice the event. > > I noticed I can set up a clickback, but it doesn't seem aware of whether > it's a right or left button click. I have the following code: > > > (define (set-text-mixin room room-channel room-ui-manager) > (mixin (hierarchical-list-item<%>) > ((interface () set-text)) > (inherit get-editor) > (super-new) > ; set-text: this sets the label of the item > (define/public (set-text str) > (define t (get-editor)) ; a text% object > (send t erase) > ;; We need a way to capture right-clicks, so we're creating our > ;; own snip here > (define str-snip > (new (class string-snip% > (super-new) > (define/override (on-event dc x y editorx editory ev) > ;; pk is a print debug tool, should print this out > (pk 'on-event dc x y editorx editory ev) > (super on-event dc x y editorx editory ev))))) > (send str-snip insert str (string-length str) 0) > (send t insert str-snip)) > (define/public (get-room) > room) > (define/public (get-room-channel) > room-channel) > (define/public (install-as-current) > ($ room-ui-manager 'install-as-current)))) > > This does set the text of the item appropriately, and I figured trying > to override the string-snip, but the pk (print debug) inside of the > overridden on-event never gets called. Not sure why. Does on-event > never get passed through to the snips inside of heirarchical list menu > items? > > Is there a better, simpler solution? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/87im1ennda.fsf%40dustycloud.org.

