Re: [Deskbar] X Grab

Here is what i propose:
class CuemiacUberEntry(CuemiacEntry)
    def __init__(default_icon, treeview)
    "The default icon for the CuemiacEntry, and the treeview to be
controlled by the entry"

    def popup(self)
        "Called when the entry changed and the results in the treeview
must be shown to the user"
    def popdown(self)
        "Called when the results shown in the treeview should be
dismissed because of user interaction"

You can then subclass this in two ways:
1. class CuemiacAlignedPopupUberEntry(CuemiacUberEntry)
      def __init__(...):
         # Create the alignedwindow of popup-type variant (not toplevel)
         # Add the passed treeview to this popup and add some frames,
vbox and scrollbars
      def popup(self):
         # Show the created popup, and X Grab it.
      def popdown(self):
         # Hide the created popup, and X Ungrab it.

2. class CuemiacSeparatedWindowUberEntry(CuemiacUberEntry)
      def __init__(...):
         Do nothing special
      def popup(self):
      def popdown(self):

The trick is that the UberEntry will controllate the cursor in the
treeview when hitting down or up, allowing to select the action you want
without using the mouse (yet allowing the mouse to be used).

In the popup case, the entry will also handle the popup attached to
itself and do the X grab stuff so there is no more focus issues..

The match-selected, and other signals related to cuamicModel/view are
still emitted from their respective classes so nothing changes in that
respect. Ideally this class can be a drop-in replacement for the
CuemiacEntry in the code, however this is not entirely true because of
obsolete code that still caches signas and interfere with the internals.

What do you think ?


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