[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

C# og metode som argument til en metode



I forbindelse med GUI programmering i C#/GTK#, hvor jeg har en
TreeView, vil jeg gerne slippe for at manuelt skulle oprette hver
kolonne i TreeView'en

Jeg har derfor lavet en metode til at hjælpe med at oprette kolonnerne.

Jeg har nu bestemt at det skal være muligt igennem den metode at
bestemme om et felt skal kunne redigeres eller ej.

I den forbindelse har skal jeg bruge to argumenter til min metode.

bool editable
_PROBLEM_ editedeventfunc

Det er let nok at sætte CellRendereText.Edited += myEditFunc
direkte - men hvordan overfører man myEditFunc som et argument til
metoden ?

Min metode ser sådan ud (skåret ned til "problembarnet") :

  public void AddColumnTitle (TreeView tv, string title, int sortid,
int col, bool editable, _PROBLEM_ editFunc)
  {
	Gtk.TreeViewColumn column;
	Gtk.CellRendererText text;

	column = new TreeViewColumn ();
	text = new CellRendererText ();
	text.Editable = editable;
	if ( editable ) text.Edited += editFunc;

...
  }


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-12-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *