Broken sizers?

I'm trying to write a simple dialog as a front end to a filter I'm
writing for Evolution.

The problem is that I'd like to add and remove an item from a sizer when
a button is clicked and I'd like the other controls to reposition
themselves and the dialog to resize itself accordingly.

What's interesting is that it works. Well, 9 times out of 10 it does.
This is really disturbing to see what is apparently non-deterministic
behavior in a sizer.

To see what I mean run this program and click the "Details" button about
10 times. On about 1 click in 10, the dialog fails to resize itself
correctly. The rest of the time it works.

RedHat 8.0
Python 2.2.1
wxPythonGTK 2.3.3.1

To run the program use "python pgpextract.py < cliff.email" (I've
commented out the section that actually imports the key so no one does
it by accident).

cliff.email (4.3 KB)

pgpextract.py (4.04 KB)

···

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308 (800) 735-0555 x308

Hi all,

I'm working on a little app that requires a bunch of similar but
different panels. The interface consists of a set of buttons aranges on
the left side of a frame, and the current panel on the right. Each
button is associated with a different panel,a nd when the user clicks on
a button, the panel it is associated with appears on the right, and the
old one goes away. If this sounds a lot like a wxNotebook, it is. MOre
on that later.

My question is this: should I destroy and create the Panels each time
they are needed, or should I create them all ahead of time, and
Show(true) and Show(false) them (adding a removing them form the sizer
as well). I have the second aproach prototyped and it seems to work, but
I'm wondering if it is a bad idea to have all those panels around for
the duration of the application. There will be perhaps a dozen of them,
and they only have maybe ten controls on them. They are not huge.

Why Am I doing this:

On the first Go-round I used a wxNotebook, with the wxNB_LEFT style.
This worked out great on GTK, but under Windows it looks pretty ugly.
I'm guessing that the native control does not support the LEFT style.
Under wxMAC, it doesn't work at all. As I have a dozen or so tabs, each
with fairly long names, a regular Notebook just doesn't work well.
Anyone have any other ideas?

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Chris Barker wrote:

My question is this: should I destroy and create the Panels each time
they are needed, or should I create them all ahead of time, and
Show(true) and Show(false) them (adding a removing them form the sizer
as well).

My impression is that wxPanels are fairly lightweight, and having a dozen of
them around shouldn't be much of a problem, unless you have specific memory
constraints. I'd stick with the second method (especially since it's
already prototyped that way).

Jeff Shannon
Technician/Programmer
Credit International

i need to save all the options of windows, types, etc.. losts of stuff....
what structure can i arrange?? how can i save it?

it is a circuit simultor.. so it has some options.....

Another thing is.... it creates lots of data, points to print in a graph
(probe), is there a way to use some sort of database? i know wxwindows has a
database... is it good.. for big files.... arround 1Mbyte..... i din't want
to fill memory with this sort of stuff.. i would rather keep it on disk...
but i need fas access... so... what can i do? any ideas?

I'm using MySQLdb for the main load of data and using shelve to store
connection settings. In my case I wrapped MySQLdb in such a way that it
automaticlly connects as needed (and generally stays connected). That made
it a lot easier than having to provide interfaces to check if it'd been
disconnected, reconnect, etc.

I'm not an ODBC fan and it looked to me as if that was what wx's db
supported. I've used MySQL for several years and found it fast, stable,
and easy to use.

If your data doesn't easily fit a relational model you might find shelve
or pickle works better for you.

···

On Sat, 16 Nov 2002, Tiago Duarte Felix wrote:

i need to save all the options of windows, types, etc.. losts of stuff....
what structure can i arrange?? how can i save it?

it is a circuit simultor.. so it has some options.....

Another thing is.... it creates lots of data, points to print in a graph
(probe), is there a way to use some sort of database? i know wxwindows has a
database... is it good.. for big files.... arround 1Mbyte..... i din't want
to fill memory with this sort of stuff.. i would rather keep it on disk...
but i need fas access... so... what can i do? any ideas?

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Chris Barker wrote:

Hi all,

I'm working on a little app that requires a bunch of similar but
different panels. The interface consists of a set of buttons aranges on
the left side of a frame, and the current panel on the right. Each
button is associated with a different panel,a nd when the user clicks on
a button, the panel it is associated with appears on the right, and the
old one goes away. If this sounds a lot like a wxNotebook, it is. MOre
on that later.

My question is this: should I destroy and create the Panels each time
they are needed, or should I create them all ahead of time, and
Show(true) and Show(false) them (adding a removing them form the sizer
as well). I have the second aproach prototyped and it seems to work, but
I'm wondering if it is a bad idea to have all those panels around for
the duration of the application. There will be perhaps a dozen of them,
and they only have maybe ten controls on them. They are not huge.

That's what the wxNotebook does, it just hides the pages that are not active.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Cliff Wells wrote:

I'm trying to write a simple dialog as a front end to a filter I'm
writing for Evolution.

The problem is that I'd like to add and remove an item from a sizer when
a button is clicked and I'd like the other controls to reposition
themselves and the dialog to resize itself accordingly.

What's interesting is that it works. Well, 9 times out of 10 it does. This is really disturbing to see what is apparently non-deterministic
behavior in a sizer.

To see what I mean run this program and click the "Details" button about
10 times. On about 1 click in 10, the dialog fails to resize itself
correctly. The rest of the time it works.

It works every time for me. This is in my current (pre 2.3.4) workspace.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Well, since this (mis)behavior isn't really a show-stopper, I suppose I
can wait for the 2.3.4 release :wink:

Regards,

···

On Sat, 2002-11-16 at 21:03, Robin Dunn wrote:

Cliff Wells wrote:
> I'm trying to write a simple dialog as a front end to a filter I'm
> writing for Evolution.
>
> The problem is that I'd like to add and remove an item from a sizer when
> a button is clicked and I'd like the other controls to reposition
> themselves and the dialog to resize itself accordingly.
>
> What's interesting is that it works. Well, 9 times out of 10 it does.
> This is really disturbing to see what is apparently non-deterministic
> behavior in a sizer.
>
> To see what I mean run this program and click the "Details" button about
> 10 times. On about 1 click in 10, the dialog fails to resize itself
> correctly. The rest of the time it works.
>

It works every time for me. This is in my current (pre 2.3.4) workspace.

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308 (800) 735-0555 x308

After I posted my last question to Robin, I found this quote at:

http://blogs.osafoundation.org/mitch/

"""
Robin Dunn, the principal author of wxPython, has begun a six-month
contract for OSAF to improve wxPython/wxWindows. His first project will
be working on the MacOS X version of wxPython. All work will be
contributed back to wxPyhton/wxWindows.
"""

I think that's great...I'm really looking forward to a complete and
stable OS-X version!

Congrats, Robin.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Hi everyone and Congratulations Robin!

It's great news that you will start working on the MacOS X version of wxPython/wxWindows, this we're really looking forward to!

We have tried to run our application under MacOS X (Jaguar) and it seems to be running fine, except for some "small" problems.

I've here collected a list of the problems we found and I hope this could be of some use for you. I also attached a tarball with some short example scripts showing the problems.

Cheers,
         Jan

examples.tar (20 KB)

···

----------------------------------------------------------------------
General Problems:
   - After scrolling the screen does not always refresh properly,
     eg. scrolling a wxGrid or a wxListCtrl shows this problem.

wxBitmapButton:
   - If you during runtime change the bitmap on the button it will not
     show the new bitmap until you do a manual refresh call.

wxButton:
   - The wxButton.SetForegroundColour does not work at all, and the
     wxButton.SetBackgroundColour does not set the background colour of
     the button but on the background behind the button (ugly!).

wxComboBox:
   - Appending choices to a combobox after initialization does not work,
     i.e. the new choice does not show up

wxFrame:
   - Calling wxFrame.CentreOnScreen() when the frame size is set to very
     big will cause the frame system menu to be hidden underneath the
     mac menu.

wxMenu:
   - EVT_MENU event IsChecked method always returns 1.

wxNotebook:
   - After adding a page to the notebook and selecting it you again have
     to manually call wxNotebook.Refresh to see the new panel inside the
     notebook.
   - If you add more pages than the size of the notebook allowes you will
     not get scroll buttons (like you do on eg. wxGTK) but the pages are
     just drawn on the side of the notebook and you can't select them.
   - The wxNB_LEFT, wxNB_RIGHT or the wxNB_BOTTOM styles do not work.
   - Adding a new page to the notebook with
     wxNotebook.AddPage(p, l, selection) and selection is set 1 does not

     select the new page . Note! When calling wxNotebook.SetSelection()
     afterwards still keeps the focus on the old page but the new
     selected page is shown.

wxNamedColour:
   - Is probably not implemented?!

wxSpinCtrl:
   - Calling wxSpinCtrl.Show(true) will disable the widget, even
     calling a wxSpinCtrl.Enable(true) afterwards does not help!

wxTimer:
   - A wxTimer.IsRunning() call does not give you the correct result
     if your timer interval is short i.e. the system load is high.

--
----------------------------------------------------------------------
Jan Finell Cenix Bioscience GmbH
Software Engineer Pfotenhauerstr. 108
IT Unit 01307 Dresden, Germany
Tel. +49 (351) 210 2683
Fax +49 (351) 210 1309
----------------------------------------------------------------------

Jan Finell wrote:

Hi everyone and Congratulations Robin!

It's great news that you will start working on the MacOS X version of wxPython/wxWindows, this we're really looking forward to!

We have tried to run our application under MacOS X (Jaguar) and it seems to be running fine, except for some "small" problems.

I've here collected a list of the problems we found and I hope this could be of some use for you. I also attached a tarball with some short example scripts showing the problems.

Thanks for the list!

I think some of them are just the way the native controls work and there may not be anything that can be done about it. I'll see what can be done about the rest.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!