(Possible) Improvements on the wxPython Demo :-D

Hi All,

I have been toying for a while with the idea to integrate what my
little tool EventsInStyle does with the wxPython demo. I believe I got
to an interesting point, so I'll share it with you.

Basically, EventsInStyle downloads some data from the wxWidgets trunk
documentation pages here:

http://docs.wxwidgets.org/trunk/

And specifically it downloads information about window styles, extra
styles, events emitted and screenshots for a particular widget. I had
thought I could do the same with the wxPython demo but without
actually connecting to the internet, just by using the CHM help file
(which contains more or less the same data of the wxWidgets
documentation web page) that comes with the wxPython demo.
Unfortunately, I have been unable to find a simple or builtin CHM file
reader for Python.

So, the modified wxPython demo does connect to the web and downloads
the data (if no firewall interference is present), and then it stores
the downloaded data in the user data folder for the wxPython demo so
that it doesn't need to download it every time. These are a couple of
screenshots of the modified demo:

http://img9.imageshack.us/img9/7265/wxpythondemo.png
http://img641.imageshack.us/img641/5796/wxpythondemo2.png

As you can see, the downloaded data are integrated with the "overview
text" already present in the wxPython demo for every widget.

The download option is off by default, and can be enabled with the
menu "Options" => "Allow download of docs". The "Options" menu has
also an option to delete the downloaded docs and get a fresh new copy
of it from the web.

You can find the modified version of the demo here:

http://xoomer.virgilio.it/infinity77/Zipped/Main2.py

It is built against the SVN version of the demo, so for those of you
using wxPython 2.8.10.1 you might need to download also
wx.lib.msgpanel here:

http://svn.wxwidgets.org/viewvc/wx/wxPython/trunk/wx/lib/msgpanel.py?revision=62548&view=markup

Simply put the "Main2.py" inside the wxPython demo folder and start it.

Please let me know if there is any interest in this kind of behaviour
and/or if you run into problems by using it.

Enjoy, wxPython rules :smiley:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==

···

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Andrea,

Great idea - very nicely implemented!

Thank you,
Malcolm

···

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Hi All,

Great idea - very nicely implemented!

Andrea,

Hi All,

I have been toying for a while with the idea to integrate what my
little tool EventsInStyle does with the wxPython demo. I believe I got
to an interesting point, so I'll share it with you.

Basically, EventsInStyle downloads some data from the wxWidgets trunk
documentation pages here:

wxWidgets: Documentation

And specifically it downloads information about window styles, extra
styles, events emitted and screenshots for a particular widget. I had
thought I could do the same with the wxPython demo but without
actually connecting to the internet, just by using the CHM help file
(which contains more or less the same data of the wxWidgets
documentation web page) that comes with the wxPython demo.
Unfortunately, I have been unable to find a simple or builtin CHM file
reader for Python.

So, the modified wxPython demo does connect to the web and downloads
the data (if no firewall interference is present), and then it stores
the downloaded data in the user data folder for the wxPython demo so
that it doesn't need to download it every time. These are a couple of
screenshots of the modified demo:

ImageShack - Best place for all of your image hosting and image sharing needs
ImageShack - Best place for all of your image hosting and image sharing needs

As you can see, the downloaded data are integrated with the "overview
text" already present in the wxPython demo for every widget.

The download option is off by default, and can be enabled with the
menu "Options" => "Allow download of docs". The "Options" menu has
also an option to delete the downloaded docs and get a fresh new copy
of it from the web.

You can find the modified version of the demo here:

http://xoomer.virgilio.it/infinity77/Zipped/Main2.py

It is built against the SVN version of the demo, so for those of you
using wxPython 2.8.10.1 you might need to download also
wx.lib.msgpanel here:

http://svn.wxwidgets.org/viewvc/wx/wxPython/trunk/wx/lib/msgpanel.py?revision=62548&view=markup

Simply put the "Main2.py" inside the wxPython demo folder and start it.

Please let me know if there is any interest in this kind of behaviour
and/or if you run into problems by using it.

Thanks guys, at least it seems I didn't do it for nothing :smiley:

What do you eat or drink to come up with all these great ideas :smiley: .

It must be the huge quantity of Italian espresso coffee :smiley:

I very much like this.

A suggestion, what about having it on a separate tab in the demo ("Widget
doc") and have the styles, events and the doc on that tab?

That's a good idea... however, I was thinking if the sudden appearance
of a new tab (even if it is unselected) might be a distraction of the
user or not. I have no idea. On speedy internet connections, you won't
see much of a lag between the loading of the demo and the appearance
of the new tab (less than 0.5 seconds here in London), but maybe on
slower ones it might be more noticeable.

I didn't explain the way this thing works: once you click on a tree
item on the left to load the demo, a background thread starts and
downloads the data from the web without interfering with the normal
wxPython demo navigation "experience" (s**t, I look like a Microsoft
representative :smiley: ). Then, when the data is ready, the "overview" tab
is repopulated. The advantage of repopulating the overview tab is that
almost nothing disrupts the "user experience" and nothing new is
created: no new tabs, no scrolling, just some longer description text
in the overview text.

In any case, the wx.html.HtmlWindow used for the "overview" tab could
really use some help from wxWebKit once this component is readily
available on all platforms: you'll get floating images, better tables
(in terms of borders, spacings and so on) and in general a far nicer
presentation of a widget overview. wx.html is extremely limited.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 24 April 2010 13:08, <python@...> wrote:
On 24 April 2010 13:08, werner wrote:

On 24/04/2010 13:43, Andrea Gavana wrote:

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Hi All,

I have been toying for a while with the idea to integrate what my
little tool EventsInStyle does with the wxPython demo. I believe I got
to an interesting point, so I'll share it with you.

Basically, EventsInStyle downloads some data from the wxWidgets trunk
documentation pages here:

wxWidgets: Documentation

And specifically it downloads information about window styles, extra
styles, events emitted and screenshots for a particular widget. I had
thought I could do the same with the wxPython demo but without
actually connecting to the internet, just by using the CHM help file
(which contains more or less the same data of the wxWidgets
documentation web page) that comes with the wxPython demo.
Unfortunately, I have been unable to find a simple or builtin CHM file
reader for Python.

So, the modified wxPython demo does connect to the web and downloads
the data (if no firewall interference is present), and then it stores
the downloaded data in the user data folder for the wxPython demo so
that it doesn't need to download it every time. These are a couple of
screenshots of the modified demo:

ImageShack - Best place for all of your image hosting and image sharing needs
ImageShack - Best place for all of your image hosting and image sharing needs

I like it. My only comment is that I don't think displaying the values of the style constants is a good idea. For more advanced developers they can be useful to know what values are available for their own styles, but for newbies who use the demo as a learning tool I don't think there is any value to know what those numbers are, and it may just cause confusion.

A suggestion, what about having it on a separate tab in the demo ("Widget
> doc") and have the styles, events and the doc on that tab?

That's a good idea... however, I was thinking if the sudden appearance
of a new tab (even if it is unselected) might be a distraction of the
user or not. I have no idea. On speedy internet connections, you won't
see much of a lag between the loading of the demo and the appearance
of the new tab (less than 0.5 seconds here in London), but maybe on
slower ones it might be more noticeable.

I agree. Perhaps the default doc in the demo module could be augmented with a message something like, "Loading documentation from website, please stand by..." at the end of the text. For the fast connections the user may not see that unless they happen to have the overview tab active when they switch samples, and for the slow connections they will know that something is going on in the background. A throbber-like icon on the notebook tab would be nice too.

BTW, you're probably already doing this but be sure to cleanly handle the cases where the website is not accessible, the user switches to another sample before you're finished downloading data for the current one, etc.

···

On 4/24/10 4:43 AM, Andrea Gavana wrote:

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Hi Robin & All,

Hi All,

I have been toying for a while with the idea to integrate what my
little tool EventsInStyle does with the wxPython demo. I believe I got
to an interesting point, so I'll share it with you.

Basically, EventsInStyle downloads some data from the wxWidgets trunk
documentation pages here:

wxWidgets: Documentation

And specifically it downloads information about window styles, extra
styles, events emitted and screenshots for a particular widget. I had
thought I could do the same with the wxPython demo but without
actually connecting to the internet, just by using the CHM help file
(which contains more or less the same data of the wxWidgets
documentation web page) that comes with the wxPython demo.
Unfortunately, I have been unable to find a simple or builtin CHM file
reader for Python.

So, the modified wxPython demo does connect to the web and downloads
the data (if no firewall interference is present), and then it stores
the downloaded data in the user data folder for the wxPython demo so
that it doesn't need to download it every time. These are a couple of
screenshots of the modified demo:

ImageShack - Best place for all of your image hosting and image sharing needs
ImageShack - Best place for all of your image hosting and image sharing needs

I like it. My only comment is that I don't think displaying the values of
the style constants is a good idea. For more advanced developers they can
be useful to know what values are available for their own styles, but for
newbies who use the demo as a learning tool I don't think there is any value
to know what those numbers are, and it may just cause confusion.

OK, I have just removed them, only the style/extra style and the
description are now there.

A suggestion, what about having it on a separate tab in the demo ("Widget
> doc") and have the styles, events and the doc on that tab?

That's a good idea... however, I was thinking if the sudden appearance
of a new tab (even if it is unselected) might be a distraction of the
user or not. I have no idea. On speedy internet connections, you won't
see much of a lag between the loading of the demo and the appearance
of the new tab (less than 0.5 seconds here in London), but maybe on
slower ones it might be more noticeable.

I agree. Perhaps the default doc in the demo module could be augmented with
a message something like, "Loading documentation from website, please stand
by..." at the end of the text. For the fast connections the user may not
see that unless they happen to have the overview tab active when they switch
samples, and for the slow connections they will know that something is going
on in the background. A throbber-like icon on the notebook tab would be
nice too.

Done: a somewhat "bolder" text appear as appended in the overview text
stating exactly that, and I have put an animation on the first
notebook tab (together with a gauge spinning in the taskbar, but that
one was there previously too). The animated icon in the first tab is
not exactly stunning but I believe it is good enough. Please feel free
to suggest an alternative GIF image if you find a nicer one.

BTW, you're probably already doing this but be sure to cleanly handle the
cases where the website is not accessible, the user switches to another
sample before you're finished downloading data for the current one, etc.

That was already taken into account. Whatever error happens (i.e., no
internet connection, firewall interference and so on), the demo is
able to fail gracefully and display a nice warning message saying that
it couldn't download the data from the wxWidgets website. This part
might be improved by passing a better error message depending on the
urrlib2 traceback, but I didn't have time to refine it yet. New
sources, together with the new images.py file here:

http://xoomer.virgilio.it/infinity77/Zipped/Main2.py
http://xoomer.virgilio.it/infinity77/Zipped/images.py

If you find any problem, please let me know, I believe I will be here
for at least a couple of days more.

<OT> I am about to start my new job on rotation in Kazakhstan, so it
might happen that I would disappear for long periods (up to a month)
as working conditions there are pretty tough, but I will still have an
entire month of holiday every month of work to catch up with any issue
that might come up with AGW, so please keep your
comments/suggestions/bug reports coming. </OT>

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 26 April 2010 18:27, Robin Dunn wrote:

On 4/24/10 4:43 AM, Andrea Gavana wrote:

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Andrea,

···

On 24/04/2010 13:43, Andrea Gavana wrote:

Hi All,

I have been toying for a while with the idea to integrate what my
little tool EventsInStyle does with the wxPython demo. I believe I got
to an interesting point, so I'll share it with you.

Basically, EventsInStyle downloads some data from the wxWidgets trunk
documentation pages here:

wxWidgets: Documentation

And specifically it downloads information about window styles, extra
styles, events emitted and screenshots for a particular widget. I had
thought I could do the same with the wxPython demo but without
actually connecting to the internet, just by using the CHM help file
(which contains more or less the same data of the wxWidgets
documentation web page) that comes with the wxPython demo.
Unfortunately, I have been unable to find a simple or builtin CHM file
reader for Python.

So, the modified wxPython demo does connect to the web and downloads
the data (if no firewall interference is present), and then it stores
the downloaded data in the user data folder for the wxPython demo so
that it doesn't need to download it every time. These are a couple of
screenshots of the modified demo:

ImageShack - Best place for all of your image hosting and image sharing needs
ImageShack - Best place for all of your image hosting and image sharing needs

As you can see, the downloaded data are integrated with the "overview
text" already present in the wxPython demo for every widget.

The download option is off by default, and can be enabled with the
menu "Options" => "Allow download of docs". The "Options" menu has
also an option to delete the downloaded docs and get a fresh new copy
of it from the web.

You can find the modified version of the demo here:

http://xoomer.virgilio.it/infinity77/Zipped/Main2.py

It is built against the SVN version of the demo, so for those of you
using wxPython 2.8.10.1 you might need to download also
wx.lib.msgpanel here:

http://svn.wxwidgets.org/viewvc/wx/wxPython/trunk/wx/lib/msgpanel.py?revision=62548&view=markup

Simply put the "Main2.py" inside the wxPython demo folder and start it.

Please let me know if there is any interest in this kind of behaviour
and/or if you run into problems by using it.

Enjoy, wxPython rules :smiley:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html&lt;==

What do you eat or drink to come up with all these great ideas :smiley: .

I very much like this.

A suggestion, what about having it on a separate tab in the demo ("Widget doc") and have the styles, events and the doc on that tab?

Werner

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

Andrea,

...

That's a good idea... however, I was thinking if the sudden appearance
of a new tab (even if it is unselected) might be a distraction of the
user or not. I have no idea.

I would see that the tab would always be there, with an indication if the doc is not yet available/downloaded/ing.

On speedy internet connections, you won't
see much of a lag between the loading of the demo and the appearance
of the new tab (less than 0.5 seconds here in London), but maybe on
slower ones it might be more noticeable.
   

Maybe in 2.9 the doc could be built/delivered with the demo in a format that is usable for this?

Werner

···

On 24/04/2010 17:21, Andrea Gavana wrote:

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

Hi Werner & All,

Andrea,

...

That's a good idea... however, I was thinking if the sudden appearance
of a new tab (even if it is unselected) might be a distraction of the
user or not. I have no idea.

I would see that the tab would always be there, with an indication if the
doc is not yet available/downloaded/ing.

Yep, this is what I was thinking too :slight_smile: . I believe it would take a
couple of minutes to hack this together, but probably I'll wait and
see if the BDFL likes the whole idea or if he thinks I just wasted a
couple of hours of my time :-D.

On speedy internet connections, you won't
see much of a lag between the loading of the demo and the appearance
of the new tab (less than 0.5 seconds here in London), but maybe on
slower ones it might be more noticeable.

Maybe in 2.9 the doc could be built/delivered with the demo in a format that
is usable for this?

I was hoping for that too, but it seems to me that the default
documentation process (at the moment) is wxWidgets/SWIGed-Docs =>
Doxygen => CHM file => Distribution of CHM. The huge advantage of CHM
is that it is a heavily compressed single file, and you will lose this
if the entire html tree of documentation was distributed along the
wxPython demo. You can always compress them using InnoSetup, but once
uncompressed on the hard drive they will be pretty big. I don't have
the numbers right now but I am going to sweep the wxWidgets docs pages
with a bot to see how big the html distribution would be.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 24 April 2010 16:47, werner wrote:

On 24/04/2010 17:21, Andrea Gavana wrote:

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

You could always put all the html files in a zip file. Install just the .zip file and then use python's zipfile module to uncompress the contents you need to display. Of course if you have chm and .zip file, the installer will contain the docs twice. Personally I don't care for that, but maybe there are still 56k people in the wild :slight_smile:

-Matthias

···

Am 24.04.2010, 19:29 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

You can always compress them using InnoSetup, but once
uncompressed on the hard drive they will be pretty big. I don't have
the numbers right now but I am going to sweep the wxWidgets docs pages
with a bot to see how big the html distribution would be.

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

Hi Matthias,

You can always compress them using InnoSetup, but once
uncompressed on the hard drive they will be pretty big. I don't have
the numbers right now but I am going to sweep the wxWidgets docs pages
with a bot to see how big the html distribution would be.

You could always put all the html files in a zip file. Install just the .zip
file and then use python's zipfile module to uncompress the contents you
need to display. Of course if you have chm and .zip file, the installer will
contain the docs twice. Personally I don't care for that, but maybe there
are still 56k people in the wild :slight_smile:

I wouldn't care too, but I believe Robin will kill me if I ever
propose something like that :smiley: .

(Still waiting for the screenshots of your app :smiley: :smiley: )

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 24 April 2010 16:36, Nitro wrote:

Am 24.04.2010, 19:29 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

Hi Matthias,

You can always compress them using InnoSetup, but once
uncompressed on the hard drive they will be pretty big. I don't have
the numbers right now but I am going to sweep the wxWidgets docs pages
with a bot to see how big the html distribution would be.

You could always put all the html files in a zip file. Install just the .zip
file and then use python's zipfile module to uncompress the contents you
need to display. Of course if you have chm and .zip file, the installer will
contain the docs twice. Personally I don't care for that, but maybe there
are still 56k people in the wild :slight_smile:

I wouldn't care too, but I believe Robin will kill me if I ever
propose something like that :smiley: .

Oohhh, somebody must've sent the above proposal on my behalf, it wasn't me :smiley:

(Still waiting for the screenshots of your app :smiley: :smiley: )

I know, I know :smiley: I got sidetracked writing a browser plugin. I'm back at the app now and hope I can send you something in about two months :slight_smile: There's always 5x more to do than I have time, right now the underlying database needs some love...

-Matthias

···

Am 24.04.2010, 19:40 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

On 24 April 2010 16:36, Nitro wrote:

Am 24.04.2010, 19:29 Uhr, schrieb Andrea Gavana >> <andrea.gavana@gmail.com>:

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

It doesn't look good: the html pages for the wxWidgets main classes
*alone* (i.e., what you can find here:
wxWidgets: Class List ) are about 23 Mb, and
this does not take into account the images, the widgets overview and
other pages usually integrated in the CHM help file. Oh well.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 24 April 2010 17:29, Andrea Gavana wrote:

Hi Werner & All,

On 24 April 2010 16:47, werner wrote:

Andrea,

On 24/04/2010 17:21, Andrea Gavana wrote:
...

That's a good idea... however, I was thinking if the sudden appearance
of a new tab (even if it is unselected) might be a distraction of the
user or not. I have no idea.

I would see that the tab would always be there, with an indication if the
doc is not yet available/downloaded/ing.

Yep, this is what I was thinking too :slight_smile: . I believe it would take a
couple of minutes to hack this together, but probably I'll wait and
see if the BDFL likes the whole idea or if he thinks I just wasted a
couple of hours of my time :-D.

On speedy internet connections, you won't
see much of a lag between the loading of the demo and the appearance
of the new tab (less than 0.5 seconds here in London), but maybe on
slower ones it might be more noticeable.

Maybe in 2.9 the doc could be built/delivered with the demo in a format that
is usable for this?

I was hoping for that too, but it seems to me that the default
documentation process (at the moment) is wxWidgets/SWIGed-Docs =>
Doxygen => CHM file => Distribution of CHM. The huge advantage of CHM
is that it is a heavily compressed single file, and you will lose this
if the entire html tree of documentation was distributed along the
wxPython demo. You can always compress them using InnoSetup, but once
uncompressed on the hard drive they will be pretty big. I don't have
the numbers right now but I am going to sweep the wxWidgets docs pages
with a bot to see how big the html distribution would be.

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en

Can the documentation process also produce
Microsoft’s HTML Help Workshop project files (.hhp, .hhk, .hhc) along
with the associated html files? If so, when they are all zipped
together, they are comparable in size to the equivalent .CHM file. **

Such a zipped file is readable directly by wx.HtmlHelpController, so I
am wondering whether it would be possible to use any of its components,
such as wx.HtmlHelpData or wx.HtmlHelpParser to provide you with the
data you require.

** If you did include the equivalent of wx.chm in the demo, you could
also then have a demo of wx.HtmlHelpController itself

···