Strangely I'm not able to import CustomTreeCtrl from wx.lib.customtreectrl. I'm running WX version 2.6.
···
-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org]On Behalf Of
wxpython-users-request@lists.wxwidgets.org
Sent: 04 June 2008 17:19
To: wxpython-users@lists.wxwidgets.org
Subject: wxpython-users Digest, Vol 4, Issue 29
Send wxpython-users mailing list submissions to
wxpython-users@lists.wxwidgets.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
or, via email, send a message with subject or body 'help' to
wxpython-users-request@lists.wxwidgets.org
You can reach the person managing the list at
wxpython-users-owner@lists.wxwidgets.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of wxpython-users digest..."
Today's Topics:
1. wxTreeCtrl (ARCHER, Thomas)
2. Re: wxTreeCtrl (Andrea Gavana)
3. Re: Problem Saving wx.grid.Grid data (Werner F. Bruhin)
4. Re: Problem Saving wx.grid.Grid data (Rich Shepard)
5. Re: Problem Saving wx.grid.Grid data (Rich Shepard)
6. Re: Problem Saving wx.grid.Grid data (Mike Driscoll)
7. Re: Re InsertStringItem - What is label ??? (Dominique)
8. Re: Problem Saving wx.grid.Grid data (Werner F. Bruhin)
----------------------------------------------------------------------
Message: 1
Date: Wed, 4 Jun 2008 16:00:51 +0100
From: "ARCHER, Thomas" <THOMAS.ARCHER@airbus.com>
Subject: [wxpython-users] wxTreeCtrl
To: <wxpython-users@lists.wxwidgets.org>
Message-ID:
<29CE2C6EBADA324EA2021C90C05B42A003EE6BAE@UK3-MAILMB01.res.airbus.corp>
Content-Type: text/plain; charset="iso-8859-1"
When using a wxTreeCtrl, items which don't have an icon explicitly set get the default (first) icon from the icon list.
Is it possible to avoid this, without causing ugly indentation (caused by using a blank image)?
Regards
Tom
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other then the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
------------------------------
Message: 2
Date: Wed, 4 Jun 2008 16:05:39 +0100
From: "Andrea Gavana" <andrea.gavana@gmail.com>
Subject: Re: [wxpython-users] wxTreeCtrl
To: wxpython-users@lists.wxwidgets.org
Message-ID:
<d5ff27200806040805h604c16b2g22def12ee44e7f1c@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Hi Thomas,
On Wed, Jun 4, 2008 at 4:00 PM, ARCHER, Thomas wrote:
When using a wxTreeCtrl, items which don't have an icon explicitly set get the default (first) icon from the icon list.
Is it possible to avoid this, without causing ugly indentation (caused by using a blank image)?
Are you on Windows? If the answer is yes, it's another Windows quirk .
You might want to replace your wx.TreeCtrl with CustomTreeCtrl
(wx.lib.customtreectrl), which in theory should work fine also in
these cases.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
------------------------------
Message: 3
Date: Wed, 04 Jun 2008 17:31:44 +0200
From: "Werner F. Bruhin" <werner.bruhin@free.fr>
Subject: Re: [wxpython-users] Problem Saving wx.grid.Grid data
To: wxpython-users@lists.wxwidgets.org
Message-ID: <4846B560.4050709@free.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Rich,
Are you using the PyGridTableBase with your grid? If yes then these
wiki pages might help.
http://wiki.wxpython.org/wxPyGridTableBase
The following is important to ensure that the updated data shows and it
points out that one can not do multiple calls to SetTable (I think this
is still true and maybe the cause of your problems?).
http://wiki.wxpython.org/UpdatingGridData
Werner
------------------------------
Message: 4
Date: Wed, 4 Jun 2008 08:39:10 -0700 (PDT)
From: Rich Shepard <rshepard@appl-ecosys.com>
Subject: Re: [wxpython-users] Problem Saving wx.grid.Grid data
To: wxpython-users@lists.wxwidgets.org
Message-ID: <Pine.LNX.4.64.0806040837511.8845@salmo.appl-ecosys.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Wed, 4 Jun 2008, Werner F. Bruhin wrote:
Are you using the PyGridTableBase with your grid? If yes then these wiki
pages might help.
Werner,
No, I'm not. I started that way but found that it would not work for me,
and the amount of data for the grid was not excessive (e.g., < 600 cells
worth).
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
------------------------------
Message: 5
Date: Wed, 4 Jun 2008 08:59:20 -0700 (PDT)
From: Rich Shepard <rshepard@appl-ecosys.com>
Subject: Re: [wxpython-users] Problem Saving wx.grid.Grid data
To: wxpython-users@lists.wxwidgets.org
Message-ID: <Pine.LNX.4.64.0806040839320.8845@salmo.appl-ecosys.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Wed, 4 Jun 2008, Mike Driscoll wrote:
Lots of shots in the dark, I know. Is there a possibility of making a
small runnable app?
Mike,
Here's some more insight that might be useful.
I put a breakpoint in the OpenDB() method at the first line below:
self.appData.cur.execute("SELECT * from Measures")
self.appData.altData = self.appData.cur.fetchall()
Publisher().sendMessage(self.appData.projOpen, data=None)
As soon as the application reaches the last line, it crashes with a seg
fault. However, if I delete all data in Measures, then rerun the application
in the debugger, it does not crash with a seg fault.
What could there possibly be in the lib.pubsub that would react negatively
to data in a specific data table, or list? Makes no sense to me.
Thanks,
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
------------------------------
Message: 6
Date: Wed, 04 Jun 2008 11:08:04 -0500
From: Mike Driscoll <mdriscoll@co.marshall.ia.us>
Subject: Re: [wxpython-users] Problem Saving wx.grid.Grid data
To: wxpython-users@lists.wxwidgets.org
Message-ID: <4846BDE4.4020103@co.marshall.ia.us>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Rich Shepard wrote:
<div class="moz-text-flowed" style="font-family: -moz-fixed">On Wed, 4
Jun 2008, Mike Driscoll wrote:Lots of shots in the dark, I know. Is there a possibility of making a
small runnable app?Mike,
Trying to extract portions of two modules to create a sample app would
probably take more time than would finding the source of the problem.Do you know the number of columns you'll need beforehand?
Yes. There will be 33 columns. At some future date we might want to
expand
this, but it already accommodates more data than is used in the current
regulatory process.You could just load a blank grid first and then update it when the
data is
ready.That's what I've tried to do, but without success. Here is the
modData()
class init, in part:class modData(wx.Panel):
appData = config.appData
def __init__(self, prnt, ID):
wx.Panel.__init__(self, prnt, wx.ID_ANY, size=wx.Size(770,440))self.SetHelpText('Enter, edit, and remove existing condition data and
alternatives here.')self.nRows = 1
self.nCols = 33It comes up with one row and 33 columns ... only if there are no
data in
the database table. It works just fine then. The loadData() method,
called
when Publisher() receives the broadcast message that a project
database has
been opened is:def loadData(self, event):
if len(self.appData.altData) < 1:
pass
else:
self.dataGrid.ClearGrid()
self.nRows = self.howManyRows()
if self.flag == 1:
self.nCols = 3
else:
self.nCols = self.dataGrid.GetNumberCols()
self.dataGrid.AppendRows(self.nRows-1,True) # there's one row
when invoked
self.dataGrid.ForceRefresh()
for r in range(self.nRows):
for c in range(self.nCols):
self.dataGrid.SetCellValue(r,c,self.appData.altData[r][c])def howManyRows(self):
if self.appData.altData != None:
self.nRows = len(self.appData.altData)
return self.nRows
else:
return 1What I _think_ I see happening when there are data in the database
table
is that the Publisher() message is broadcast too soon; it's as though the
grid insists on being initialized as the application is invoked. And, of
course, the database is not yet open, so for some reason it seq faults
and
crashes rather than going on.
Hmmm...is this Publisher() method a pubsub thing? I suppose you're using
the virtual method of the grid so that it somehow grabs info from the
table as it is updated? I never figured out how that works...Just an
FYI, I'm using a modified version of the SimpleGrid example from the
demo for my application. Maybe Robin or Andrea or that guy from Dabo
will have a better idea on how that works. Have you read the wiki
articles on the grid widget? You might even find out some good info from
the Dabo project. I'm sure they do this sort of thing too.
Just keep the grid hidden until you're ready to show it.
I haven't seen how to hide/reveal the grid. The only function I see
in the
docs is HideCellEditControl(self). How can I do this?
This might just be a dumb idea. Anyway, you should be able to hide it
with the sizer. Something like mySizer.Hide(myGrid). This might not do
much of anything for you though.
Or maybe you can use CallAfter() here?
Where's 'here?'
I was referring to calling CallAfter() on the Publish part in hopes that
it wouldn't publish anything until the grid was done processing.
Can you set some kind of flag to tell your program when the data is
ready
and then have the grid access it?I've tried, but apparently without success. See the two methods above.
Any and all suggestions will be greatly appreciated. Apparently the
grid
widget works totally differently from the others, and I have great
difficulty finding the source of the seg fault only when data are
present in
the database table, and I select the database to open. Quite frustrating.Thanks,
Rich
Since there's two ways to operate with the grid, I guess I would agree.
One is that you give it the data explicitly using the setter methods and
the other is having the table grab the info itself implicitly somehow. I
suppose rather than updating the empty table, you could just destroy it
and create a new one with your data added to it.
Mike
------------------------------
Message: 7
Date: Wed, 4 Jun 2008 16:08:43 +0000 (UTC)
From: Dominique <mydomdom@gmail.com>
Subject: [wxpython-users] Re: Re InsertStringItem - What is label ???
To: wxpython-users@lists.wxwidgets.org
Message-ID: <loom.20080604T155245-685@post.gmane.org>
Content-Type: text/plain; charset=us-ascii
Werner F. Bruhin <werner.bruhin <at> free.fr> writes:
Maybe this makes it clear:
data = {'key1': ['data col 1.1', 'data col 1.2', 'data col 1.3'],
'key2': ['data col 2.1', 'data col 2.2', 'data col 2.3']}for item in data.values:
index = self.InsertStringItem(sys.maxint, item[0]) # create item and
set column 0 label
self.SetStringItem(index, 1, item[1]) # set column 1 label
self.SetStringItem(index, 2, item[2]) # set column 2 labelWerner
Hi Werner,
The thing that confused me is that in the ListCtrl_edit demo, one line
could be avoided (it can be commented out without problems it seems):
self.SetStringItem(index, 0, data[0]).
It deals with the item in the first column and consequently is redundant
with: index = self.InsertStringItem(sys.maxint, data[0])
I understand now that InsertStringItem is useful to:
a) create an index used by SetStringItem for the other columns filling
b) fill in the first column
Am I right ?
In addition, when I do what I explained in the previous message, in fact
I am putting "zzzzzz" in the first cell and immediately after I overwrite
it with "bla".
Still right I presume.
Thanks a lot for your help.
Werner, it seems you're located in France too, isn't it
Thanks a lot
Dominique
------------------------------
Message: 8
Date: Wed, 04 Jun 2008 18:18:47 +0200
From: "Werner F. Bruhin" <werner.bruhin@free.fr>
Subject: Re: [wxpython-users] Problem Saving wx.grid.Grid data
To: wxpython-users@lists.wxwidgets.org
Message-ID: <4846C067.2030301@free.fr>
Content-Type: text/plain; charset="iso-8859-1"
Rich,
Rich Shepard wrote:
On Wed, 4 Jun 2008, Mike Driscoll wrote:
Lots of shots in the dark, I know. Is there a possibility of making a
small runnable app?Mike,
Here's some more insight that might be useful.
I put a breakpoint in the OpenDB() method at the first line below:
self.appData.cur.execute("SELECT * from Measures")
self.appData.altData =3D self.appData.cur.fetchall()Publisher().sendMessage(self.appData.projOpen, data=3DNone)
what is self.appData.projOpen ? I think PubSub.sendMessage has some =
restriction on what it can take as a topic.
Why do you think PyGridTableBase is overkill?
Attached a small sample which loads some new data if you click on the =
button, it is a slightly modified version from the demo.
Maybe this helps
Werner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GridCustTable.py
Type: text/x-python
Size: 8052 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080=
604/bdd492fa/GridCustTable.py
------------------------------
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
End of wxpython-users Digest, Vol 4, Issue 29
*********************************************
This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other then the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.