Share

wxGlade

Tracker: Bugs

5 Duplication of extracode - ID: 1983771
Last Update: Comment added ( lmarcoux )

I created a trivial app:
App->Frame->Sizer->Button
I added extracode to both the frame and the button. Specifically, "print
frame_1" and "print button_1" (plus a few newlines).

The generated code was:


# begin wxGlade: extracode
print 'frame_1'


print 'button_1'


print 'frame_1'



print 'button_1'


# end wxGlade

I had only expected the extracode to appear once.


Michael Grazebrook ( mgrazebrook ) - 2008-06-03 17:59

5

Open

None

Nobody/Anonymous

Code generation - python

None

Public


Comment ( 1 )

Date: 2009-09-12 11:21
Sender: lmarcoux

This bug occurs only on a new file creation. In the module py_codegen.py
function add_class adds extracode (line 670) then again for a new file
(line 957). If this is an existing file, the return on line 878 will bypass
the second execution.
Workaround: geneate the file twice, second time around will be OK.


Attached File ( 1 )

Filename Description Download
x.wxg Source which demonstrates the problem Download

Change ( 1 )

Field Old Value Date By
File Added 280040: x.wxg 2008-06-03 17:59 mgrazebrook