Floating widget



In April, I mentioned was looking into a floating widget.

  http://mail.gnome.org/archives/gtk-devel-list/2003-April/msg00225.html

I dropped it a little while later, but recently picked it up again.
Epiphany, at least, needs something like this for its "Exit Fullscreen"
button.

  http://bugzilla.gnome.org/show_bug.cgi?id=115296

I first tried a GtkBin subclass that would be anchored to a point in some
other widget. I wasn't getting very far with this.

Marco pointed me to the MozContainer class:

  http://lxr.mozilla.org/mozilla/source/widget/src/gtk2/mozcontainer.h
  http://lxr.mozilla.org/mozilla/source/widget/src/gtk2/mozcontainer.c

As you can see, this is basically a reimplementation of GtkFixed.

Placing whatever widget is to have a floater into a GtkFixed would perhaps
be the cleanest way to make a floater, but the requisitions and allocations
then must be specially handled.

While toying with my GtkBin subclass, it occured to me that simple way
to handle this might be to reparent another GtkWindow. Creating a GtkWindow
as GTK_WINDOW_POPUP then using gdk_window_reparent() made it very easy to
add an internal floating window. Unfortunately, it's not at all keyboard
navigable, and it probably looks quite bizarre to the accessibility
infrastructure.

I'll now revise and extend my question from April.

Is there enough need for an internally floating widget to justify one in
Gtk+ proper?  If there is enough need, should there a be a bug report?
If not, what would be the best way for apps that need one to implement one?


Cheers,
Greg



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