views:

198

answers:

1

I use wxGlade to create Python scripts, which use wxWidgets. wxGlade directly manipulates XML files, which describe the wxWidgets based GUI. Those files have the *.wxg extension. From the *.wxg files, it is possible to generate code which actually runs the GUI in one of several languages, and I am using it to generate Python code.

I would like to add a copyright statement to my *.wxg files and also to the generated code. I tried to hand-edit a *.wxg file and added my copyright statement as a HTML comment, but after editing the file in wxGlade and saving the edited version, my comment disappearesd.

How can I add a copyright statement to those files without hand-editing them after each save from wxGlade?

A: 

To add a copyright statement to a file generated by wxGlade, you will have to insert the copyright statement by hand. You will have to do this to every file generated. The trick to making sure that you don't have to do it every time you generate the file, is to do the following:

  1. Generate your source code the first time
  2. Add your copyright statement to the file
  3. If it isn't already done automatically by wxGlade, surround the wxGlade-generated code with

    # begin wxGlade:
    # end wxGlade
    
  4. Make sure that the checkbox "Overwrite existing sources" is unchecked (right click the application at the top of the tree, and at the bottom of the application properties you will find this checkbox)

If you are interested in more information about this, have a look at this page - section 9. Notes has the information you want (sorry, can't link to this section since there is no anchor for it).

a_m0d