PyQT widgets? [message #92390] |
Sun, 06 December 2015 14:55  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
hi,
Now that we have Python in IDL, I'm wondering if it's feasible to use something like PyQT widgets?
I recently tested my IDL application on a Mac, and I was disappointed with the circa-20-year-old Motif-based widget system that IDL for Mac uses. It was awful.
So, if it makes sense to use a Python-based widget system from within IDL code, could someone perhaps post an example of how to do this? Perhaps a simple top-level-base widget with a draw window?
thanks
Mark
|
|
|
|
|
Re: PyQT widgets? [message #92420 is a reply to message #92415] |
Sat, 12 December 2015 01:44   |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
On Friday, December 11, 2015 at 6:10:26 PM UTC+1, Chris Torrence wrote:
> On Friday, December 11, 2015 at 1:48:27 AM UTC-7, superchromix wrote:
>> bump
>
> Here you go! This is using IDL 8.5.1.
>
> sys = Python.Import('sys')
> QtGui = Python.Import('PyQt4.QtGui')
> a = QtGui.QApplication(sys.argv)
> w = QtGui.QWidget()
> void = w.resize(320, 240)
> void = w.setWindowTitle("Hello World!")
> void = w.show()
>
> Notes:
> 1. I modifed the Python example from:
> https://pythonspot.com/pyqt4/
> 2. I'm using Anaconda 3, which comes with PyQt.
> 3. I have no idea how to handle events. That's left as an exercise for the reader. :-)
>
> If you come up with more PyQt examples in IDL, please post them here!
>
> Cheers,
> Chris
thanks Chris! I will have a look at this - maybe I can figure out how to handle the events.
Is IDL 8.5.1 released?
|
|
|
Re: PyQT widgets? [message #92436 is a reply to message #92420] |
Tue, 15 December 2015 18:32   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Saturday, December 12, 2015 at 2:44:21 AM UTC-7, superchromix wrote:
> On Friday, December 11, 2015 at 6:10:26 PM UTC+1, Chris Torrence wrote:
>> On Friday, December 11, 2015 at 1:48:27 AM UTC-7, superchromix wrote:
>>> bump
>>
>> Here you go! This is using IDL 8.5.1.
>>
>> sys = Python.Import('sys')
>> QtGui = Python.Import('PyQt4.QtGui')
>> a = QtGui.QApplication(sys.argv)
>> w = QtGui.QWidget()
>> void = w.resize(320, 240)
>> void = w.setWindowTitle("Hello World!")
>> void = w.show()
>>
>> Notes:
>> 1. I modifed the Python example from:
>> https://pythonspot.com/pyqt4/
>> 2. I'm using Anaconda 3, which comes with PyQt.
>> 3. I have no idea how to handle events. That's left as an exercise for the reader. :-)
>>
>> If you come up with more PyQt examples in IDL, please post them here!
>>
>> Cheers,
>> Chris
>
> thanks Chris! I will have a look at this - maybe I can figure out how to handle the events.
>
> Is IDL 8.5.1 released?
It looks like IDL 8.5.1 just went live today!
-Chris
|
|
|
Re: PyQT widgets? [message #92564 is a reply to message #92436] |
Thu, 14 January 2016 14:54   |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
On Tuesday, December 15, 2015 at 7:32:28 PM UTC-7, Chris Torrence wrote:
> On Saturday, December 12, 2015 at 2:44:21 AM UTC-7, superchromix wrote:
>> On Friday, December 11, 2015 at 6:10:26 PM UTC+1, Chris Torrence wrote:
>>> On Friday, December 11, 2015 at 1:48:27 AM UTC-7, superchromix wrote:
>>>> bump
>>>
>>> Here you go! This is using IDL 8.5.1.
>>>
>>> sys = Python.Import('sys')
>>> QtGui = Python.Import('PyQt4.QtGui')
>>> a = QtGui.QApplication(sys.argv)
>>> w = QtGui.QWidget()
>>> void = w.resize(320, 240)
>>> void = w.setWindowTitle("Hello World!")
>>> void = w.show()
>>>
>>> Notes:
>>> 1. I modifed the Python example from:
>>> https://pythonspot.com/pyqt4/
>>> 2. I'm using Anaconda 3, which comes with PyQt.
>>> 3. I have no idea how to handle events. That's left as an exercise for the reader. :-)
>>>
>>> If you come up with more PyQt examples in IDL, please post them here!
>>>
>>> Cheers,
>>> Chris
>>
>> thanks Chris! I will have a look at this - maybe I can figure out how to handle the events.
>>
>> Is IDL 8.5.1 released?
>
> It looks like IDL 8.5.1 just went live today!
> -Chris
A couple blog posts covering some of this are now available on the IDL Data Point web site:
http://www.exelisvis.com/Company/PressRoom/Blogs/IDLDataPoin t.aspx
Look for posts from October 2015 and January 2016.
Jim P.
|
|
|
|
Re: PyQT widgets? [message #92566 is a reply to message #92565] |
Fri, 15 January 2016 07:40  |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
On Friday, January 15, 2016 at 5:10:56 AM UTC-7, superchromix wrote:
> Thanks for this post!
>
> One question: this example covers the topic of using IDL graphics within Python-hosted applications. What about the inverse problem, using Python widgets within an IDL-hosted application? Would that be reasonable?
>
> Mark
That may be a topic for one or more future blogs by one or more of us here at Harris Geospatial Solutions. (Yes, that's the new official name for RSI/ITT VIS/Exelis VIS.)
We're always looking for IDL-oriented ideas.
Jim P.
|
|
|