[Gtk-sharp-list] [PATCH] TreeView support for GTK#
Kristian Rietveld
kris@gtk.org
09 Aug 2002 22:28:50 +0200
--=-cRM78EnDeOBdrAZdhemf
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hello,
I spent a few hours hacking on TreeView support in GTK# and this is the
result. The attached patch gets the core working. There are some more
things to figure out before the support is complete.
To apply the patch:
* untar the tarball (doh)
* put the files in the sample/ and gtk/ subdirectories in the correct
directories in the gtk-sharp source tree
* apply treeviewstuff.diff
* run the parser and generator and finally recompile the assemblies.
* if everything turned out well, you should be able to compile and run
the treeviewdemo in samples/
As mentioned above, there are some issues left. The generator does not
generate source code for properties which return an interface. As a
temporarily solution, I put the Model property of TreeView in
TreeView.custom. I think this can be fixed in the generator, but I'm not
sure.
The TreeView is (in?)famous for it's exotic vararg-using methods. These
need some special handling in the parse/generation process. Or we just
ditch those methods and create much nicer C#-style methods. A list of
known exotic vararg-using methods:
Gtk.ListStore.Set / Gtk.ListStore.SetValist
Gtk.TreeStore.Set / Gtk.TreeStore.SetValist
Gtk.TreeModel.Get / Gtk.TreeModel.GetValist
Gtk.TreeViewColumn.NewWithAttributes
Gtk.TreeViewColumn.SetAttributes
Gtk.TreeView.InsertColumnWithAttributes
TreeView's signal emitting methods were renamed to names like InsertRow,
ChangeRow, etc. This isn't really correct, because those methods do not
actually insert or change a row. They only emit the row_inserted and
row_changed signals. These methods are only used by GtkTreeModels
implemented outside of gtk+. Therefore I renamed those methods to
EmitRowInserted, EmitRowChanged, etc. The names RowInserted/RowChanged
aren't possible because of the defined events in Gtk.TreeModel.
My TreeView demo is an incredibly quick and dirty hack. At least it
shows how to use TreeStore/TreeView and it's a bit cooler than just
having integers and "foo" or "lalala" (:. Duncan mentioned on IRC that
it would be cool to write an ildasm clone. I'll try to look into that as
a fun side project. Maybe somebody wants to volunteer to draw icons? The
stock icons in gtk won't do I think.
That's all for now. Please try it out and send some feedback.
thanks,
Kris
--=-cRM78EnDeOBdrAZdhemf
Content-Disposition: attachment; filename=patch.tar.gz
Content-Type: application/x-gzip; name=patch.tar.gz
Content-Transfer-Encoding: base64
H4sIAKsJVD0AA+0c/XPitvJ+hZn+DyqTaaFgg/lMyMdcLnfNZd7dNS9k2pnXuWEECPCLsaktJ5e2
+d/friQb2xhI0pBcX627AJZWq/3SaleWPad8OK2+2mqp1Zq1TqcF37Vap92MfavyqtZp1VsIWK+/
qhm1dsd4RVrbJUsW3+PUJeTVlWt66+A2tf9Ny1zo36OzucW2ZQYP0r8B9UbdaDUy/T9Hien/0mXs
Z5PdvGUzRx8+Gbswn2vthN4j+m91mi2h/2anZTQbbYBv1XD+156KgHXlH67/apUEWgeNE4386Nth
DRmBIeSrVfhPjn0+ddwu+RfIgZvUJhcm49fMGpEDFM3rCb/SHXdypMCLwxKp12r1Zfh83qYz5s3p
kJFTftUTpueRP/I53zPtCendepzN9uOX+luX3sBlsvqCjS025KZjJ1uO5/O3zoya0BC0nH4wByEY
DB393ZtSd46gc39gmUMytKjnkeiEQApzc9e8ppwRMBoOUNje446LFfh5SGzfshBNEvLaMUfk3HWG
zPMub+eMFLHvGWcumVOX2bxCRDUvQV8cKRe2m/gBmEEfYV2xJAbJgaT1U8Y/stmAuV6xRG4c+3sO
n+4VGfmAziG+baKEZzAGG6k+3pC6t5JH5ulYOQby6XBKihLVmT12yMwkpk24HAC0P/Jg3JKQQy6H
wtR/phYM8gn0qQiM1BZnpo4tQGkCXjCaCn/p9LiLGoFxJIM5IVjUJrNHpOj4XMijoqSmkEugHuMK
lQSpVUiEgHQYQ8pdwtzl8W+98o5BZLOBdZuiwLCJerOHqTGUvrQBFDvgQMFjxcPEzh8mdf6iQhdA
sWkhIfh9FOLMfQsq5QQshhI3x6Qop+O3cj6WxCgu475ryyFPHNtzLKb/4sJwH0wbuhc+OHSEUhhR
TsnYdWaESn2aMEV0vaCoDSe60qMavWiCXJAD8J8jipONWp6OFVK4FUFDjsiyCVqN9TDbiZofWlDo
AfUT30W9qSuwquOQs4hpgV+4YWRI0YF4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