Re: [Java-gnome-developer] Using TreeView isgnals with Glade
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2005-05-02 01:24:00
|
On Sun, 2005-01-05 at 23:00 +0200, Khiraly wrote: > The appenColumn generate COLUMN_CHANGED signal and the double-click > generate ROW_ACTIVATED signal. So I have added an if() condition. In my experience, some various number of signals are emitted any time you do anything in GTK - and it can be a bit unpredictable. For example, if you "activate" a button, a "clicked" signal will also be generated. You get that sort of thing all through GTK. So definitely, > if (event.isOfType(TreeViewEvent.Type.ROW_ACTIVATED)) { is necessary ... [I tend to use if (event.getType() == TreeViewEvent.Type.ROW_ACTIVATED) { But I don't suppose there is any difference, is there :) The thing to look out for is that just because you handled the one signal you think you are interested in, doesn't mean there are others. In one case, I had my signal handler generating a new event which resulted in a new signal which resulted in re-entry to that handler! Ick! AfC Sydney |