well, assuming you are using a Button or MenuButton widget, you would create a method to call digianalyzer.function(file_name)
using a Button as an example:
CODE
>> mb = Frame ( self, relief=FLAT, borderwidth=2 )
>> mb.analyze = Button (mb, text="Analyze Circuit", command=self.call_analysis, relief=GROOVE, width=12)
>> mb.analyze.grid ( row=1, column=0, sticky=E+N+S )
>> mb.analyze.bind ( "<Button-3>", self.call_analysis)
a few notes,
1) the frame is really unnecessary, you can attach your button to what ever parent you want, or even the top level window. I feel frames make an easy way of grouping widgets and tend to use them heavily, ymmv
2) I assume you are using the grid method to place widgets, if not change as needed
3) "mb.analyze.bind ( "<Button-3>", self.call_analysis)" is also superfluous, I include it here as it will probably come up later in your GUI. This method (as called) will connect the right mouse button, "<Button-3>", to your widget, if you have some other action in mind for this button (or any other user input) the bind method can also take those. Additionally, you can have multiple binds.
once you've defined your button, you will need a method to call on clicking it:
CODE
>> fname = 'file1.v'
>> def call_analysis(self):
>> diganalyzer.function(fname)
Note a few things, first, since I called a method of the object to which my Button belonged (the 'self.call_analysis', vs. say 'call_analysis'), the first argument to my method needs to be 'self', second, there isn't a good way (that I know of) of passing arguments from widget actions (if someone else has found how to do this, I would be very interested to know), hence the passing your filename through a class member approach taken here.
If you would like a method that can take a file name argument, you can get away with this provided you overload. Observe:
CODE
>> fname = 'file1.v'
>> def call_analysis(self, file_in = None):
>> if file_in == None:
>> file_in = fname
>> diganalyzer.function(fname)
which will behave like the above version, but can also be called (for example, from the top level) as
>> self.call_analysis('file2.v')
I hope this helped,
-Jerome