Re: Re: why is GtkOptionMenu deprecated?



On Sun, Sep 12, 2010 at 4:15 PM, joel krähemann <joel weedlight ch> wrote:
> Hi, sorry that I didn't explain exactly what I want, but I need to pack
> widgets like GtkVScale into a GtkOptionMenu and I can't find a cell
> renderer for widgets and I believe that there isn't one for widgets. So
> my question was why is GtkOptionMenu deprecated and what could I do
> better when I implement my own?
> Assumed there will be a way by using GtkComboBox, please show me the
> missing code below.

what you're describing is not, i think, a valid use of GtkOptionMenu -
it just happened to work because nobody was paying attention.

the key behaviour of a GtkOptionMenu was: "When activated the
GtkOptionMenu displays a popup GtkMenu which allows the user to make a
new choice."

There's nothing there about packing arbitrary widgets into anything.
Its basically a button (with a specific kind of appearance) that
displays a GtkMenu when clicked. my guess is that you were
confused/misled by gtk_menu_shell_append (GtkMenuShell*, GtkWidget*)
which makes it appear that you can pack arbitrary widgets into a
GtkMenu. But in fact, the documentation reads "A GtkMenuShell is a
container of GtkMenuItem objects arranged in a list". Its more a
quirky aspect of the API that leads to the 2nd argument of
gtk_menu_shell_append() taking a widget - its intended to take a
GtkMenuItem, as noted: "Adds a new GtkMenuItem to the end of the menu
shell's item list. " You may also have the docs for GtkMenu, but
missed the footnote: "As it derives from GtkBin it can hold any valid
child widget, altough only a few are really useful. "

Unfortunately, I think you've found a corner case that works but
wasn't intended to work and thus is certainly not supported as we've
moved onto GtkComboBox. I could be wrong, but is my reading of the
documentation.

--p


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