From m.clarkson at ucl.ac.uk Tue Dec 8 09:30:45 2015 From: m.clarkson at ucl.ac.uk (Clarkson, Matt) Date: Tue, 8 Dec 2015 14:30:45 +0000 Subject: [Ctk-developers] Embedded WebServer Message-ID: <2993ED6A-49EF-46ED-9B89-AA7B71AA1372@ucl.ac.uk> Hi there CTK-ers, does anyone have any good recommendations for a C++ embedded web-server that I could build into our app? ? one with a BSD/MIT/Apache style license? Thanks Matt From pieper at isomics.com Tue Dec 8 10:44:58 2015 From: pieper at isomics.com (Steve Pieper) Date: Tue, 8 Dec 2015 10:44:58 -0500 Subject: [Ctk-developers] Embedded WebServer In-Reply-To: <2993ED6A-49EF-46ED-9B89-AA7B71AA1372@ucl.ac.uk> References: <2993ED6A-49EF-46ED-9B89-AA7B71AA1372@ucl.ac.uk> Message-ID: Hi Matt - I don't know about C++, but in python I've had good luck embedding cherrypy and SimpleHTTPServer.py in Slicer with very good performance in my use case, which was just to use it for a one-client/one-server scenario. -Steve On Tue, Dec 8, 2015 at 9:30 AM, Clarkson, Matt wrote: > Hi there CTK-ers, > > does anyone have any good recommendations for a C++ embedded web-server > that I could build into our app? ? one with a BSD/MIT/Apache style license? > > Thanks > > Matt > > _______________________________________________ > Ctk-developers mailing list > Ctk-developers at public.kitware.com > http://public.kitware.com/mailman/listinfo/ctk-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan_perdomo at med.unc.edu Tue Dec 8 20:00:12 2015 From: jonathan_perdomo at med.unc.edu (Perdomo, Jonathan) Date: Wed, 9 Dec 2015 01:00:12 +0000 Subject: [Ctk-developers] Observing signals in a CTK widget In-Reply-To: <017011DE895033479448DC78942A1A272595D5A4@ITS-MSXMBS2M.ad.unc.edu> References: <017011DE895033479448DC78942A1A272595D447@ITS-MSXMBS2M.ad.unc.edu>, <017011DE895033479448DC78942A1A272595D582@ITS-MSXMBS2M.ad.unc.edu>, <017011DE895033479448DC78942A1A272595D5A4@ITS-MSXMBS2M.ad.unc.edu> Message-ID: <017011DE895033479448DC78942A1A272595D5BC@ITS-MSXMBS2M.ad.unc.edu> Hello everyone, I hope this question has not been asked before, but I am just trying to add an observer to my CTK coordinates widget, so that I know whether or not the values have been modified by the user. I am writing this in Python as an extension for 3D Slicer. Any example of how to add an observer to a widget in Python would be very helpful, as well as any sample code you may have, or resources you know of! Thank you for your help, Jonathan Perdomo -------------- next part -------------- An HTML attachment was scrubbed... URL: From pieper at isomics.com Tue Dec 8 20:21:36 2015 From: pieper at isomics.com (Steve Pieper) Date: Tue, 8 Dec 2015 20:21:36 -0500 Subject: [Ctk-developers] Observing signals in a CTK widget In-Reply-To: <017011DE895033479448DC78942A1A272595D5BC@ITS-MSXMBS2M.ad.unc.edu> References: <017011DE895033479448DC78942A1A272595D447@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D582@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D5A4@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D5BC@ITS-MSXMBS2M.ad.unc.edu> Message-ID: Hi Jonathan - That widget emits a signal when changed [1], which you can get with the coordinates property [2]. In python this is available as a string, so you'll need to parse that to make use of the values. Here's an example that shows a dialog when the values are changed. You can just paste it into the slicer python console. c = ctk.ctkCoordinatesWidget() c.show() c.connect('coordinatesChanged(double*)', lambda cc: qt.QMessageBox.information(None, 'coordinates', c.coordinates)) HTH, Steve [1] http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#a0de7bec85eadf564e911d5c97679f4b9 [2] http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#af5509939618967dfd9515dc7637990c7 On Tue, Dec 8, 2015 at 8:00 PM, Perdomo, Jonathan < jonathan_perdomo at med.unc.edu> wrote: > Hello everyone, > > I hope this question has not been asked before, but I am just trying to > add an observer to my CTK coordinates widget, so that I know whether or not > the values have been modified by the user. I am writing this in Python as > an extension for 3D Slicer. Any example of how to add an observer to a > widget in Python would be very helpful, as well as any sample code you may > have, or resources you know of! > > Thank you for your help, > > Jonathan Perdomo > > > _______________________________________________ > Ctk-developers mailing list > Ctk-developers at public.kitware.com > http://public.kitware.com/mailman/listinfo/ctk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jchris.fillionr at kitware.com Tue Dec 8 21:25:52 2015 From: jchris.fillionr at kitware.com (Jean-Christophe Fillion-Robin) Date: Tue, 8 Dec 2015 21:25:52 -0500 Subject: [Ctk-developers] Observing signals in a CTK widget In-Reply-To: <017011DE895033479448DC78942A1A272595D5BC@ITS-MSXMBS2M.ad.unc.edu> References: <017011DE895033479448DC78942A1A272595D447@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D582@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D5A4@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D5BC@ITS-MSXMBS2M.ad.unc.edu> Message-ID: Hi Jonathan, And here is the answer I had in my draft box ... Looking at this example will tell you how to connect the signal of an object to a python function. See [1] Similarly, you should be able to connect to a coordinate widget using the signal "coordinatesChanged(double *)" See [2] For example: 8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- >>> import ctk >>> w = ctk.ctkCoordinatesWidget() >>> w.show() >>> def onCoordindateChanged(): ... print(w.coordinates) ... >>> w.connect('coordinatesChanged(double*)', onCoordindateChanged) True >>> 1,0,0 8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- All of that said, we should look into an other signal of the following form: coordinatesChanged(const QVector3D& coordinates) that would be wrapped in Python. Hth Jc [1] https://github.com/Slicer/Slicer/blob/75fc96bf05e65659eb5204f47b5205442cc6fd8e/Extensions/Testing/ScriptedLoadableExtensionTemplate/ScriptedLoadableModuleTemplate/ScriptedLoadableModuleTemplate.py#L111-L114 [2] http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#a0de7bec85eadf564e911d5c97679f4b9 On Tue, Dec 8, 2015 at 8:00 PM, Perdomo, Jonathan < jonathan_perdomo at med.unc.edu> wrote: > Hello everyone, > > I hope this question has not been asked before, but I am just trying to > add an observer to my CTK coordinates widget, so that I know whether or not > the values have been modified by the user. I am writing this in Python as > an extension for 3D Slicer. Any example of how to add an observer to a > widget in Python would be very helpful, as well as any sample code you may > have, or resources you know of! > > Thank you for your help, > > Jonathan Perdomo > > > _______________________________________________ > Ctk-developers mailing list > Ctk-developers at public.kitware.com > http://public.kitware.com/mailman/listinfo/ctk-developers > > -- +1 919 869 8849 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jchris.fillionr at kitware.com Wed Dec 9 10:15:48 2015 From: jchris.fillionr at kitware.com (Jean-Christophe Fillion-Robin) Date: Wed, 9 Dec 2015 10:15:48 -0500 Subject: [Ctk-developers] Observing signals in a CTK widget In-Reply-To: <017011DE895033479448DC78942A1A272595D80F@ITS-MSXMBS2M.ad.unc.edu> References: <017011DE895033479448DC78942A1A272595D447@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D582@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D5A4@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D5BC@ITS-MSXMBS2M.ad.unc.edu> <017011DE895033479448DC78942A1A272595D80F@ITS-MSXMBS2M.ad.unc.edu> Message-ID: Thanks Jonathan :) On Wed, Dec 9, 2015 at 10:09 AM, Perdomo, Jonathan < jonathan_perdomo at med.unc.edu> wrote: > Jean-Christophe, > > Thank you for the response, it was very helpful. > > Jonathan Perdomo > ------------------------------ > *From:* Jean-Christophe Fillion-Robin [jchris.fillionr at kitware.com] > *Sent:* Tuesday, December 08, 2015 9:25 PM > *To:* Perdomo, Jonathan > *Cc:* ctk-developers at public.kitware.com > *Subject:* Re: [Ctk-developers] Observing signals in a CTK widget > > Hi Jonathan, > > And here is the answer I had in my draft box ... > > Looking at this example will tell you how to connect the signal of an > object to a python function. > See [1] > > Similarly, you should be able to connect to a coordinate widget using the > signal "coordinatesChanged(double *)" > See [2] > > For example: > > 8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- > 8<--- > > >>> import ctk > > >>> w = ctk.ctkCoordinatesWidget() > > >>> w.show() > > >>> def onCoordindateChanged(): > > ... print(w.coordinates) > > ... > > >>> w.connect('coordinatesChanged(double*)', onCoordindateChanged) > > True > > >>> 1,0,0 > > 8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- > 8<--- > > > All of that said, we should look into an other signal of the following > form: > > coordinatesChanged(const QVector3D& coordinates) > > that would be wrapped in Python. > > Hth > Jc > > [1] > https://github.com/Slicer/Slicer/blob/75fc96bf05e65659eb5204f47b5205442cc6fd8e/Extensions/Testing/ScriptedLoadableExtensionTemplate/ScriptedLoadableModuleTemplate/ScriptedLoadableModuleTemplate.py#L111-L114 > > [2] > http://www.commontk.org/docs/html/classctkCoordinatesWidget.html#a0de7bec85eadf564e911d5c97679f4b9 > > > On Tue, Dec 8, 2015 at 8:00 PM, Perdomo, Jonathan < > jonathan_perdomo at med.unc.edu> wrote: > >> Hello everyone, >> >> I hope this question has not been asked before, but I am just trying to >> add an observer to my CTK coordinates widget, so that I know whether or not >> the values have been modified by the user. I am writing this in Python as >> an extension for 3D Slicer. Any example of how to add an observer to a >> widget in Python would be very helpful, as well as any sample code you may >> have, or resources you know of! >> >> Thank you for your help, >> >> Jonathan Perdomo >> >> >> _______________________________________________ >> Ctk-developers mailing list >> Ctk-developers at public.kitware.com >> http://public.kitware.com/mailman/listinfo/ctk-developers >> >> > > > -- > +1 919 869 8849 > -- +1 919 869 8849 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.askeland at gmail.com Thu Dec 10 04:00:44 2015 From: christian.askeland at gmail.com (Christian Askeland) Date: Thu, 10 Dec 2015 10:00:44 +0100 Subject: [Ctk-developers] Embedded WebServer In-Reply-To: References: <2993ED6A-49EF-46ED-9B89-AA7B71AA1372@ucl.ac.uk> Message-ID: Hi Matt, I used https://github.com/nikhilm/qhttpserver for building a simple REST server. The fork on https://github.com/SINTEFMedtek/qhttpserver contains CMake support as well. -Christian On Tue, Dec 8, 2015 at 4:44 PM, Steve Pieper wrote: > Hi Matt - > > I don't know about C++, but in python I've had good luck embedding > cherrypy and SimpleHTTPServer.py in Slicer with very good performance in my > use case, which was just to use it for a one-client/one-server scenario. > > -Steve > > On Tue, Dec 8, 2015 at 9:30 AM, Clarkson, Matt > wrote: > >> Hi there CTK-ers, >> >> does anyone have any good recommendations for a C++ embedded web-server >> that I could build into our app? ? one with a BSD/MIT/Apache style license? >> >> Thanks >> >> Matt >> >> _______________________________________________ >> Ctk-developers mailing list >> Ctk-developers at public.kitware.com >> http://public.kitware.com/mailman/listinfo/ctk-developers >> > > > _______________________________________________ > Ctk-developers mailing list > Ctk-developers at public.kitware.com > http://public.kitware.com/mailman/listinfo/ctk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.espak at ucl.ac.uk Fri Dec 11 12:59:52 2015 From: m.espak at ucl.ac.uk (Miklos Espak) Date: Fri, 11 Dec 2015 17:59:52 +0000 Subject: [Ctk-developers] ctkPopupWidget misbehaviour on RHEL 6 Message-ID: Hi, I am wondering if someone has seen this or has any idea for a workaround. On RHEL 6 systems, if I pin the popup window and then minimize the entire application window and restore it, the popup window disappears and there is no way to get it back. It is really annoying, as the only way to see the popup window again is restarting the application. I did some debugging, but have not found anything, the CTK part looks correct. This does not happen on Windows and Mac. Linux Mint KDE version (based on Ubuntu 14.04) works also well. Anybody seen this? Is it a GTK issue? Any workaround or hint? Thank you so much, Miklos -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien.finet at kitware.com Mon Dec 14 04:56:36 2015 From: julien.finet at kitware.com (Julien Finet) Date: Mon, 14 Dec 2015 10:56:36 +0100 Subject: [Ctk-developers] ctkPopupWidget misbehaviour on RHEL 6 In-Reply-To: References: Message-ID: Hi, Have you checked that the WindowStateChange event is processed in eventFilter() ? temporarilyHiddenOff() should be called by ctkPopupWidgetPrivate::updateVisibility() Maybe the popup widget gets its window state changed by the window manager ? in that case you might have to ensure it is restored. Julien. On Fri, Dec 11, 2015 at 6:59 PM, Miklos Espak wrote: > Hi, > > I am wondering if someone has seen this or has any idea for a workaround. > > On RHEL 6 systems, if I pin the popup window and then minimize the entire > application window and restore it, the popup window disappears and there is > no way to get it back. It is really annoying, as the only way to see the > popup window again is restarting the application. > > I did some debugging, but have not found anything, the CTK part looks > correct. This does not happen on Windows and Mac. Linux Mint KDE version > (based on Ubuntu 14.04) works also well. > > Anybody seen this? > Is it a GTK issue? > Any workaround or hint? > > Thank you so much, > Miklos > > > _______________________________________________ > Ctk-developers mailing list > Ctk-developers at public.kitware.com > http://public.kitware.com/mailman/listinfo/ctk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.espak at ucl.ac.uk Tue Dec 15 14:21:56 2015 From: m.espak at ucl.ac.uk (Miklos Espak) Date: Tue, 15 Dec 2015 19:21:56 +0000 Subject: [Ctk-developers] ctkPopupWidget misbehaviour on RHEL 6 In-Reply-To: References: Message-ID: The window manager is metacity here. I tried several others, they were not better. The WindowStateChange event does happen. The eventFilter function does not do anything with it because the isHidingCandidate() function gives false. But the temporarilyHiddenOff function is called when the windows is restored. It is triggered by the Show event. Weirdly, it never happens when I run the application through the debugger, stopping at breakpoints. But if I launch the same app (same debug build) directly, it happens always. Not always for the first time, though, sometimes only for the 3rd or 4th attempt of minimise / restore. But when it happened, there is no way to get the popup widget back. Can it be related to the order in which some slots are called? Cheers, Miklos On 14 December 2015 at 09:56, Julien Finet wrote: > Hi, > > Have you checked that the WindowStateChange event is processed in > eventFilter() ? > temporarilyHiddenOff() should be called by > ctkPopupWidgetPrivate::updateVisibility() > Maybe the popup widget gets its window state changed by the window manager > ? in that case you might have to ensure it is restored. > > Julien. > > On Fri, Dec 11, 2015 at 6:59 PM, Miklos Espak wrote: > >> Hi, >> >> I am wondering if someone has seen this or has any idea for a workaround. >> >> On RHEL 6 systems, if I pin the popup window and then minimize the entire >> application window and restore it, the popup window disappears and there is >> no way to get it back. It is really annoying, as the only way to see the >> popup window again is restarting the application. >> >> I did some debugging, but have not found anything, the CTK part looks >> correct. This does not happen on Windows and Mac. Linux Mint KDE version >> (based on Ubuntu 14.04) works also well. >> >> Anybody seen this? >> Is it a GTK issue? >> Any workaround or hint? >> >> Thank you so much, >> Miklos >> >> >> _______________________________________________ >> Ctk-developers mailing list >> Ctk-developers at public.kitware.com >> http://public.kitware.com/mailman/listinfo/ctk-developers >> >> > > _______________________________________________ > Ctk-developers mailing list > Ctk-developers at public.kitware.com > http://public.kitware.com/mailman/listinfo/ctk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: