Hi Boris,
The object received in MyMainFrame::OnTreeChecked( TObject* entry,
Bool_t on )
is in fact the real object associated to the TGListTreeItem:
void *fUserData; // pointer to user data structure
In your case, it is always 0 because you didn't assign any object to
your TGListTreeItem.
If you change your code as following:
TGListTreeItem *item = fTree->AddItem(0, "Item1", 0, 0, kTRUE); item->SetUserData(AnyObject);
Or:
fTree->AddItem(0, "Item1", AnyObject, 0, 0, kTRUE);
Then the object received will be the _Real_ object (AnyObject) assigned to the ListTree item.
Cheers,
Bertrand.
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch
[mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Boris Iven
Sent: Monday, July 23, 2007 1:17 PM
To: ROOT Talk Mailing List
Subject: Re: [ROOT] TGListTree Checked() Signal
Hi Bertrand,
i made a little script "checkbox.C" showing the problem.
Thanks for your help!
Regards,
Boris
Bertrand Bellenot wrote:
> Hi Boris,
>
> Could you send a short working script showing the problem, please ?
>
> Cheers,
> Bertrand.
>
> -----Original Message-----
> From: owner-roottalk_at_pcroot.cern.ch
> [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Boris Iven
> Sent: Monday, July 23, 2007 11:54 AM
> To: roottalk_at_pcroot.cern.ch
> Subject: [ROOT] TGListTree Checked() Signal
>
> Dear ROOT users and developers,
>
> i am using ROOT 5.16.00 on a IA32 SLC 4 machine. I want to use the
> Checked() Signal emitted by TGListTree:Checked(TObject* obj, Bool_t
> check) to perform operations on the currently checked/unchecked
> TGListItem but the TObject Pointer obj is always 0.
>
> Other signals like TGListTree::DoubleClicked(TGListTreeItem* entry,
> int_t btn) work fine, i get the correct reference to the desired item.
>
> I was wondering why there is no corresponding
> TGListTree:Checked(TGListTreeItem* entry, Bool_t check) method that
> emits the Checked() signal with "TGListTreeItem* entry" as a
parameter.
>
> Is this currently under development or is there another designated way
> to get a reference to currently checked item?
>
> Kind regards,
>
> Boris Iven
>
>
>
Received on Mon Jul 23 2007 - 15:13:59 CEST
This archive was generated by hypermail 2.2.0 : Mon Jul 23 2007 - 17:50:03 CEST