From: Alec B. <wry...@gm...> - 2007-10-24 06:25:43
|
I'm guessing this isn't possible in Pythoncard, since calling, for example: self.components.myradiogroup.items = ['choice1', 'choice2'] returns NotImplementedError. Is there some other way to set the radiogroup items dynamically? |
From: Alex T. <al...@tw...> - 2007-10-24 12:18:19
|
Alec Bennett wrote: > I'm guessing this isn't possible in Pythoncard, since calling, for > example: > > self.components.myradiogroup.items = ['choice1', 'choice2'] > > returns NotImplementedError. > > Is there some other way to set the radiogroup items dynamically? > Very embarrassingly, I can't try this out right now, but you might get it to work as self.components.myradiogroup.SetItemLabel(1,'choice1') self.components.myradiogroup.SetItemLabel(2,'choice2') etc. -- Alex Tweedly mailto:al...@tw... www.tweedly.net |
From: Alec B. <wry...@gm...> - 2007-10-24 22:09:23
|
I wound up making the window in pure wxPython. Which got me to thinking: a nice and relatively easy way to extend the power of PythonCard would be to document integration with it and pure WX. In other words, how to add components from WX to your PythonCard app. With that in mind I made a couple of additions to this Wiki page: http://wiki.wxpython.org/PythonCardTricks I added: - "How do I launch a pure WX window from a PythonCard app?" and - "How do I make my PythonCard app minimize to the system tray?" I've seen a couple of other examples describing minimizing to the system tray, but nothing very complete. And obviously if anyone notices problems with those tutorials, please update or let me know. Maybe someone could post instructions for adding, say, a radiogroup from pure python to a PythonCard app? Or if someone knows of some existing documentation for doing things like this? On 10/24/07, Phil Edwards <ph...@li...> wrote: > > Alex Tweedly wrote: > >> > >> Is there some other way to set the radiogroup items dynamically? > >> > > Very embarrassingly, I can't try this out right now, but you might get > > it to work as > > > > self.components.myradiogroup.SetItemLabel(1,'choice1') > > self.components.myradiogroup.SetItemLabel(2,'choice2') > > etc. > > > > Just tried that on my laptop and it works, with the proviso that you > can't use this method to change the number of items in the group, i.e. > if we tried to add a 3rd radio button by doing: > > self.components.myradiogroup.SetItemLabel(3, 'choice3') > > then this gets ignored. > > -- > > Regards > > Phil Edwards > Brighton, UK > |
From: Phil E. <ph...@li...> - 2007-10-25 00:36:19
|
Alec Bennett wrote: > > - "How do I make my PythonCard app minimize to the system tray?" > I added a sample called 'sysTray' to the PythonCard CVS tree quite a while ago. Unfortunately this was after the release of 0.8.2, so my code is still just in CVS, but I can upload a copy to my web site if anyone is interested - just reply here and let me know. I tested it on WinXP and Linux (using KDE) and ended up very pleased with it, despite almost tearing my hair out with a couple of issues that took much Google-fu and experimenting to resolve. :-) |
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2007-10-25 08:41:55
|
On 24/10/2007 23:09, Alec Bennett wrote: > > http://wiki.wxpython.org/PythonCardTricks > > I added: > > - "How do I launch a pure WX window from a PythonCard app?" and Thanks Alec....this is something I need to do in the near future to tack a custom print dialog window onto a PythonCard front-end (to a legacy Win32 application....phew!), so your example is most welcome. -- XXXXXXXXXXX |
From: Phil E. <ph...@li...> - 2007-10-24 12:58:15
|
Alex Tweedly wrote: >> >> Is there some other way to set the radiogroup items dynamically? >> > Very embarrassingly, I can't try this out right now, but you might get > it to work as > > self.components.myradiogroup.SetItemLabel(1,'choice1') > self.components.myradiogroup.SetItemLabel(2,'choice2') > etc. > Just tried that on my laptop and it works, with the proviso that you can't use this method to change the number of items in the group, i.e. if we tried to add a 3rd radio button by doing: self.components.myradiogroup.SetItemLabel(3, 'choice3') then this gets ignored. -- Regards Phil Edwards Brighton, UK |