<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 27, 2012 at 3:58 PM, Kieron Hardy <span dir="ltr"><<a href="mailto:kieron.hardy@gmail.com" target="_blank">kieron.hardy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div>Laurent, do you have a bit of code that demonstrates your issue?</div></div>
</blockquote><div>
<br>Well, it's not easy to show a minimal example, as it (seems to) depends on an X event loop processing while grabbing the root window.<br><br>But I have something like that:<br>[...]<br>; create a new event space and use it for all graphics<br>
(define gui-eventspace (make-eventspace))<br>(current-eventspace gui-eventspace)<br>
[...]<br><br>(define menu2 (new popup-menu% [...])<br>(define f (new frame% [label "Frame"]))<br>(define cb (new button% [parent f] [label "Menu"] <br> [callback (λ(cb ev)(send f popup-menu menu2 100 150))]))<br>
<br>; keybindings to run commands <br>(add-bindings global-keymap<br> "C-F1" (thunk* (send f popup-menu menu2 100 100))<br> "C-F2" (thunk* (send f show #t)) ; to show the frame after the event loop has started<br>
)<br><br>[...]<br><br>(run-event-loop)<br><br><br>When the program starts, I press Ctrl-F2 to show the frame, and then I can press the button to show the popup, several times in a row, and the popup menu does work correctly.<br>
But if I press Ctrl-F1 to show the popup menu by attaching it directly to the frame instead of going through the callback, not only does it not show up, but after that pressing the button does not work anymore (actually, I can press the button and it changes its state, so it's not frozen, but the popup menu just does not appear).<br>
<br>I've tried to surround the call inside the first thunk* with a `thread' and also with a `(parameterize ([current-eventspace (make-eventspace)])' or with the gui-eventspace just in case, but without success.<br>
<br>Laurent<br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div><div><div><br><br>On Nov 27, 2012, at 4:09, Laurent <<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>> wrote:<br>
<br></div></div></div><div><div><div></div><blockquote type="cite"><div>Update:<br>Independently of the server and the keybindings:<br>If I create a frame with a button which callback pops up a menu, it works.<br>
If I create a frame and call popup-menu on it directly, it fails (the menu does not appear, and the button above does not show its own menu anymore either, which may mean something about eventspaces being frozen? Although I can still click on another button that hides the frame)<br>
<br>Any idea? I'm kind of stuck in the eventspace...<br><br>Laurent<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 26, 2012 at 4:55 PM, Laurent <span dir="ltr"><<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There is a remaining problem: I can show frames and buttons alright, and press them, but popup-menus seem to resist (although the frame I call show-popup-menu on does show up). <br>
<br>What's strange is that they work when called from the console (in a different thread, in a different namespace with eval, but with namespace-anchor), but not via a keybinding (in the main thread, and in the main namespace), and I could not yet reproduce this behavior in a simpler setting than in the server thread...<br>
<br>Is there something special about popup-menus?<span><font color="#888888"><br><br>Laurent</font></span><div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Nov 25, 2012 at 6:30 PM, Laurent <span dir="ltr"><<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It works! Thank you very much!<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></blockquote></div></div><div><blockquote type="cite"><div><span>____________________</span><br><span> Racket Users list:</span><br><span> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a></span><br>
</div></blockquote></div></div></blockquote></div><br></div>