From: Jussi S. <jus...@pp...> - 2006-10-22 15:54:37
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> hwphillips wrote: <blockquote cite="midehdc27$v3p$1...@se..." type="cite"> <pre wrap="">hwphillips wrote: </pre> <blockquote type="cite"> <pre wrap="">In pythoncard, I created a window with various widgets. Then I add a wx.grid.Grid control using CreateGrid(). The grid appears on the window with the rest of the widgets, I can put values in the cells. However, the scroll bars do not work. Also, I can not select any cell with the mouse. Help please and thanks. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo <a class="moz-txt-link-freetext" href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a> </pre> </blockquote> <pre wrap=""><!----> I used the grid in pyCard and everything works ok. I missed the sample for it at first. Still, the problem above exists, not sure why. </pre> </blockquote> I don't quite get it when you at first say that 'everything works ok' and then say that 'the problem above exists'. Could you be more specific please:<br> <br> 1. Could your problems be environment/version related? The application in<br> <a class="moz-txt-link-freetext" href="http://personal.inet.fi/cool/operator/BPMDownload.html">http://personal.inet.fi/cool/operator/BPMDownload.html</a><br> uses the grid succesfully. BPM runs on Windows XP Home SP2 using Python 2.4.3, wxPython 2.6.3 and PythonCard 0.8.2. <br> <br> 2. If you mean that the simpleGrid demo works but your program doesn't, you should compare them to find the differencies. There's bound to be something because in this case the environment and versions are the same for simpleGrid and your program.<br> <br> 3. "the scroll bars do not work"<br> In what way? Are they not visible. Are they visible but do not react when you click the arrows or the empty space of the scroll bar. Can you drag the 'thumb'?<br> <br> 4. "I can not select any cell with the mouse"<br> When I click a cell once the rectangle showing the focused cell goes to that cell. When I now click that cell again the text in that cell is selected i.e. is shown with a different background color emphasizing the fact that the next keyboard operation modifies the whole text. If I hit delete, the text is deleted. If I enter new text it replaces the selection. Doesn't your program behave like this?<br> <br> If you mean that you want the cell value to be selected and copied somewhere when you click the cell, you need to do something like this:<br> <br> def on_ansGrid_leftClick(self, event):<br> print 'ansGrid leftClick'<br> r = event.GetRow()<br> c = event.GetCol()<br> print 'r, c', r, c<br> aCM1 = self.fr.test.items[self.fr.currItm].ansCount - 1<br> last = aCM1 / self.columns<br> if r > last:<br> print 'r>last', r, last<br> elif r == last:<br> last = aCM1 % self.columns<br> if c > last:<br> print 'c>last', c, last<br> else:<br> print 'set text'<br> self.components.ansField.text = self.components.ansGrid.GetCellValue(r, c)<br> self.components.ansField.SetFocus()<br> #event.Skip() <br> <br> <br> Cheers,<br> <br> Jussi<br> <br> <pre class="moz-signature" cols="72">-- Jussi Salmela <a class="moz-txt-link-freetext" href="http://personal.inet.fi/cool/operator/">http://personal.inet.fi/cool/operator/</a> </pre> </body> </html> |