[glade--]Re: GtkCombo Help



Bryan W. Headley wrote:
Christof Petig wrote:



True. Which means, I should not emit a header, I should prevent

        Gtk::List *combo_list1 = manage(...)

But there are attributes of the List that I MIGHT want to look at, that I can set via the Gtk::Combo.



If you can't access the widget you can't configure it (set attributes). But ... you might trick around gtkmm via Gtk::wrap(GTK_COMBO(x)->list)->set_...;

Ouch! Hopefully, I can do something like

    Gtk::Combo.setSomeAttribute( forTheList )

Which means that Combo better know how to set attributes for it's internal GtkList, even though it doesn't know what a GtkList is! But you see, whatever parses those List parameters will have to be in Combo's writer, which is EVIL.

No, I said it belongs into List and that Gtk_List::Configure will be called with whatever you specify (in Gtk_Combo::isInternal) as the widget's pointer (in the instance variable). List might even hack around via asking for it's ChildName and act accorgingly.

Passing List a pointer to it's containing parent would be a good idea, but that needs a small redesign (adding an argument of the writers).

But if you call Gtk::Combo.setxyz then it belongs into combo because it's a Gtk::Combo's method you are calling.

Can you name a real problem about which we are discussing?

correct. But the writer does not need to do much (5 lines should suffice).


Hmm, but how do I write a writer that does not return it's datatype and doesn't return a header file?

Oh, if you override GHInclude to do nothing you don't need to specify an include file (and no line is emitted), and if you don't specify one, you get your parent's include file (which does not hurt). And if you don't specify a datatype you get your parent's (e.g. Gtk::Widget).

So the only thing you really need is a (mostly empty) class, a constructor and a static instance.

    Christof




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