Re: cool stuff in cvs head



muppet said:
  - After using the popup to select a new entry, the treeview will
consider a dnd operation to have started as soon as the cursor enters
the window.  Looks really weird...  The "workaround" is for the user to
do the drop outside the window...  I've tried various stuff to try to
track this one down, but no luck so far.

i can duplicate this.  it has something to do with how the mouse events are
being handled, which is something that i tend to figure out only by trial and
error, but appears to be related only to app code, not the bindings.  i'll get
back to you on that.

#gtk+ pointed me to
http://scentric.net/tutorial/sec-custom-cell-renderers.html#sec-custom-cell-renderers-external
, which links to cell renderers implemented for MrProject and others. 
MrProject creates a base class for any renderer which uses a popup window, and
then derives the list and date cellrenderers from that.  this sounds like a
good idea, because that would take care of the popup handling issues of the
cellrenderer_date.pl example.  but that's beside the point.

from looking at that code i figured out how to fix the dragging bug you're
seeing in examples/cellrenderer_popup.pl (which looks very similar to your
testcase).


the basic problem is that Mup::CellRendererPopup's on_start_editing() returns
undef.  this says to the calling code, "we didn't do anything about it, we
aren't editing, feel free to do what you like."  since the treeview is set
reorderable, that means the treeview proceeds to start dragging.

so, even though we don't intend to use a GtkCellEditable to edit this cell, we
need to create and return one, anyway.  we destroy it as soon as the menu is
handled.  on my system, i never even saw the entry widget show up, probably
because i never called start_editing on it.

the attached patch shows what i mean.


if you just use that patch on whatever version of Gtk2 you have, it will give
you trapped exception warnings, saying that remove_widget cannot be found ---
that's because @Gtk2::Entry::ISA is not correctly set up to designate
Gtk2::Entry as an implementor of Gtk2::Cell::Editable.  that's fixed in CVS,
as are several other things.  it looks like SourceForge's anon CVS is faster
than it was, but still doesn't yet show the changes i've made since this
morning.

-- 
muppet <scott at asofyet dot org>

Attachment: cellrenderer_popup.pl.patch
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]