[glade--]Re: [gtkmm] Problem with gtkmm handling comboboxes from glade
- From: John Bartelt <bartelt ics uci edu>
- To: gtkmm mailing list <gtkmm-main lists sourceforge net>, glademm mailing list <glademm-list gnome org>
- Subject: [glade--]Re: [gtkmm] Problem with gtkmm handling comboboxes from glade
- Date: Fri, 30 Nov 2001 09:25:09 -0800
On Friday 30 November 2001 07:51 am, you wrote:
> Ahh, now I remember that one.
> Try if it works after removing the parentheses around items[].
No, it doesn't help. I don't think it has to do with scope, but with
constness.
I had a reply from vadim vk crocodile org saying that he had the same problem
and fixed it by running a perl script on the generated code to change " const
char * const " to " const char * ". I've confirmed that this works.
Now the question: which should be fixed, glademm or gtkmm?
Thanks,
John
>
> > The prototype for set_popdown_strings is
> >
> > void Combo::set_popdown_strings(const SArray& strings)
> >
> > The compiler complains because there's no conversion available for const
> > char *[] to const SArray&. See attached file captured from gmake output.
> >
> > It seems to me that there are three options:
> >
> > 1) I can edit the generated code as follows
> > {
> > vector<string> vec_items;
> > int i = 0;
> > while ( items[ i ] )
> > {
> > vec_items.push_back( items[ i++ ];
> > }
> > combo1->set_pop_down_strings( vec_items );
> > }
> >
> > This works because SAarray handles most containers. However, I have many
> > comboboxes in several popup dialogs in my application, and I don't like
> > having to find and manually edit each one. Besides, the code is in
> > *_glade.cc files that you're not supposed to edit - they get overwritten
> > each time glade rebuilds source after a design change.
> >
> > 2) Persuade the authors of glade(glademm) to generate the appropriate
> > SArray compatible container, or
> >
> > 3) Fix gtkmm to handle the conversion automatically.
> >
> > I'd appreciate any other comments, help, or discussion.
> >
> > Thanks, John.
> >
> > --
> > John Bartelt
> > bartelt ics uci edu
> > ----
> >
> >
> > /usr/include/gtk--/base.h: In function `size_t
> > Gtk::SArray_Helpers::Traits<T>::get_size (const T &) [with T = const
> > char *const[2]]':
> > window1_glade.cc:704: instantiated from here
> > /usr/include/gtk--/base.h:646: request for member `size' in `t', which
> > is of non-aggregate type `const char *[2]'
> > /usr/include/gtk--/base.h: In function `const char *const
> > *Gtk::SArray_Helpers::Traits<T>::get_data (const T &) [with T = const
> > char *const[2]]':
> > window1_glade.cc:704: instantiated from here
> > /usr/include/gtk--/base.h:645: request for member `begin' in `t', which
> > is of non-aggregate type `const char *[2]'
> > /usr/include/gtk--/base.h:645: request for member `size' in `t', which
> > is of non-aggregate type `const char *[2]'
> > gmake: *** [window1_glade.o] Error 1
>
> _______________________________________________
> to unsubscribe or change your subscription parameters :
> https://lists.sourceforge.net/lists/listinfo/gtkmm-main
--
John Bartelt
bartelt ics uci edu
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]