segfault in TLegendEntry->SetTextSize

From: Adrian Sevcenco <Adrian.Sevcenco_at_cern.ch>
Date: Sun, 18 Sep 2011 20:19:36 +0300


Hi! I try to increase the text of an entry in legend .. but i have an segmentation fault .. the code is below .. strange is that is i use the editor i can select TLegend and do Text->20 .. so what command do i miss?

Thanks!

TLegend *leg = new
TLegend(0.454023,0.5127119,0.8333333,0.7224576,NULL,"brNDC");

  leg->SetTextFont(20);
  leg->SetLineColor(1);
  leg->SetLineStyle(1);
  leg->SetLineWidth(1);
  leg->SetFillColor(19);
  leg->SetFillStyle(1001);

  TLegendEntry* entry = NULL;

  entry = leg->AddEntry("fH1","text 1","lpf");

  entry->SetFillStyle(1001);
  entry->SetLineColor(1);
  entry->SetLineStyle(1);
  entry->SetLineWidth(1);
  entry->SetMarkerColor(2);
  entry->SetMarkerStyle(20);
  entry->SetMarkerSize(1);
  entry->SetTextSize(20);	


  entry = leg->AddEntry("fH1mc","text 2","lpf");

  entry->SetFillStyle(1001);
  entry->SetLineColor(1);
  entry->SetLineStyle(1);
  entry->SetLineWidth(1);
  entry->SetMarkerColor(51);
  entry->SetMarkerStyle(20);
  entry->SetMarkerSize(1);

  leg->Draw();

Received on Sun Sep 18 2011 - 19:21:08 CEST

This archive was generated by hypermail 2.2.0 : Mon Sep 19 2011 - 11:50:01 CEST