[Glade-devel] Commit -- fix selection



Just a little heads up.

I've changed how selection works.

What was broken?

First, the handlers that draw the nodes:

There were two version, one for GladeWidget, and one for
GladePlaceholders.
The GladeWidget one was using the GdkWindow of the widget directly,
instead of using the double buffered window.  No wonder it didn't work
correctly, needing the "event_after" hack etc.

The GladePlaceholder one was not working on windows (well, it was not
working most of the time).  The problem was that a previous handler for
expose was returning void, and thus it was undefined if the expose
should be continued.

In addition, now we only connect to the event handler if we need to draw
the nodes, and we disconnect when we don't need them anymore.

I've also erased the variables that keep the information on the current
selected widget &/| placeholder.  It was almost no used (a good
indication that it was in fact no useful).  If you need to know if the
widget is a selected one on O(1) time (ie. without looking at the
current list of selected items), just use glade_util_widget_has_nodes.

The functions that add, remove and test the nodes around a widget are
now on glade_util_*, and are the same for GladeWidgets and
GladePlaceholders (they work on GtkWidgets).

That's all!

Cheers,







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