I've been using wxGlade for a while and I'm very confortable with it,
but now I'm realising that there are much more very useful widgets in
wxPython, as I see in the wxPython demo, than those included in the
wxGlade Panel.
What if I want to use, for example, the CustomTreeCtrl widget through
wxGlade? Do I need to add it as a custom widget to wxGlade? Then, I'd
need the codegen.py file, at least, wouldn't I? Google doesn't tell me
anything when I search "CustomTreeCtrl and wxGlade together", how can
be possible?
(See the download link at the bottom of the page.)
···
On 3/25/11 4:49 AM, Fundoro wrote:
Hello!
I've been using wxGlade for a while and I'm very confortable with it,
but now I'm realising that there are much more very useful widgets in
wxPython, as I see in the wxPython demo, than those included in the
wxGlade Panel.
What if I want to use, for example, the CustomTreeCtrl widget through
wxGlade? Do I need to add it as a custom widget to wxGlade? Then, I'd
need the codegen.py file, at least, wouldn't I? Google doesn't tell me
anything when I search "CustomTreeCtrl and wxGlade together", how can
be possible?
Thank you for asking, I already knew that webpage. It’s evident that you didn´t understand me, or I didn’t explain my problem properly.
My questions are:
Do I need to include CustomTreeCtrl as a custom widget by hand in order to use it inside wxGlade? (probably the answer is YES)
Getting the file “CustomTreeCtrl.py” with the main code is easy, but what about “codegen.py”, and the other files needed to do step 1? How can be possible that nobody hasn’t published that yet? Do I need to code those files by my own?
Even more, I have just tried to set the “Overwrite existing sources” checkbox to on, and then I regenereted the code and included the handlers of the events by hand again (a lot of work that I find excessive just to include a global import at the top of the code). If I run the final program, everything seems to be OK, but I still can’t preview the frame in wxGlade. I get the same error: “Error. Problem previewing gui: ‘module’ object has no attribute ‘agw’”, so the “extra code” property is not been taking in acount when I preview, I think.
Note: in the class property of the “custrom widget” I wanted to say “wx.lib.agw.customtreectrl.CustromTreeCtrl” in my last post.
However, I don’t need to include CustomTreeCtrl inside the pallete of wxGlade as a plug-in, but just an easy way to include a CustomTreeCtrl in a frame designed in wxGlade, no matter if I have to write all the code that involves that widget by hand later.
So, I tried to use the generic “custom widget” button. I included a “custom widget” in my frame, and set the “class property” to “wx.lib.agw.customtreectrl”. The problem then is that I can’t preview the frame any more: “Error. Problem previewing gui: ‘module’ object has no attribute ‘agw’”. So, I used the “extra code” tab to include the required import: “import wx.lib.agw.customtreectrl”. Then, if I press “Generete Code”, a warning dialog appears: “window_1 has extra code, but you are not overwriting existing sources: please check that the resulting code is correct!”. The result is that the import included in the “extra code” tab is not included in the generated code, and I don’t want to set the “Overwrite existing sources” checkbox to on, because I have a lot of extra code to implement the handlers of the events of my frame written by me by hand.
Thank you for asking, I already knew that webpage. It’s evident that you
didn´t understand me, or I didn’t explain my problem properly.
My questions are:
Do I need to include CustomTreeCtrl as a custom widget by hand in
order to use it inside wxGlade? (probably the answer is YES)
Getting the file “CustomTreeCtrl.py” with the main code is easy, but
what about “codegen.py”, and the other files needed to do step 1? How
can be possible that nobody hasn’t published that yet? Do I need to code
those files by my own?
Yes, I expect that you’ll need to write the plugin code that makes CTC available for use in wxGlade, as well as any other widgets you need that wxGlade does not already support. If somebody had already written that code and submitted it to the wxGlade project (hint!) then I would think that wxGlade would already be providing it since CTC is one of the widgets available in the stock wxPython library.