Hi,

I'm new to monobjc and programming on mac, I'm trying to make a
hyperlink in a NSTextField.

I think I found that it can be done by using AttributedStringValue and
setting AllowsEditingTextAttributes and IsSelectable to true.

So something like this:



[ObjectiveCField]

public NSTextField field = null;


[ObjectiveCMessage("awakeFromNib")]
public override void awakeFromNib() {
   base.awakeFromNib();
   field.AllowsEditingTextAttributes = true;
   field.IsSelectable = true;

    NSURL url = new NSURL("http://google.com";);
    NSDictionary dic = new NSDictionary()
    field.AttributedStringValue = new NSAttributedString(url, dic);
}


The code above doesn't work, I'm stuck with the NSDictionary, what do
I fill it with?
I hope I got it right at least a bit.


Thanks in advance,
Nico Van Laerebeke

Reply via email to