Defining a new MIME type for a own class


I’m new to root and not from the HEP-Community. I want to use ROOT for storage of large datasets for machine learning tasks. For this reason I want to define my own classes and make them inherit from TNamed all their nice I/O and RTTI features.

However I want to define new MIME types for these Classes (by modifying etc/root.mimes) in order to specify icons and more important defaults-actions when I double-click them in a TBrowser.

I was adding the following code in the file root.mimes:
(Test is the name of my new Class)

pattern = Test
icon = test.xpm
action = ->Draw()

The icon was exchanged after that, but the default action not!
I’m working with root version 5.02 and CINT 5.16.1 compiled for MAC OSX

any suggestions?

thanks, greets


Hi Martin,

First, you must create a dictionary for your class.
Then your class must have (obviously) a Draw() method.
If it is the case, then can you send me your class, in order to be able to try, please ?


Thanks Bertrand for your reply

I will add the simple example code that I have written to test, if I can define default action for my own classes. However, since I realized that you can at least specify which method should come in the context menu using MENU it is not so urgent any more to define default actions for my classes in the TBrowser.

I think I should know when root.mimes is parsed! Maybe I have to recompile root again after changing that, but I hope not!

thanks for suggestions

myROOT.tar.gz (169 KB)