Re: [AD] Overriding GUI menu look |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> > the standard dialogs (alert, file_slect etc) would still use the
> > old system Why not follow GTK+'s approach and replace all the
> > standard d_*_proc functiosn by function pointers?
>
> Good idea, but you're behind by a couple of WIPs :-) I already added
> gui_*_proc for overriding the look of standard dialogs (there were
> reasons for not making the d_*_procs themselves into pointers).
Oops, I don't watch the list very closely (rather busy)
and I don't read the other lists at all (to much badwidth for my mobile
phone modem)
>
> > maybe something along the line of
> >
> > struct GUI_STYLE
> > {
> > int (*button_draw)(DIALOG *d, int c),
> > int (*checkbox_draw)(DIALOG *d, int c),
> > int (*menuitem_draw)(DIALOG *d, int c),
> > } GUI_STYLE;
> >
> > with a default style containing the current drawing code.
>
> This is interesting (switch themes with one assignment!), but will
> break old code if we ever add another proc.
Not necessarily.
I was thinking of a create/destroy_gui_style() pair (like for bitmaps )
which would fill in all the defaults for you, and you'd
change only the ones you'd want to change.
Maybe it would be nice to collect all the gui_*_proc function pointers
into such a struct?
>
> > This might need some more thinking for menus ( never got menus to
> > work properly in wham either, except by rewrinting the entire set of
> > menu functions)
>
> If someone wants to rewrite the menu code inside Allegro to be more
> flexible, *and* backwards compatible, go right ahead :-)
Har, Har, Har... (sarcastic laugh)
I will have a look it it when I've got time, but I can't promise
anything. The menu code bothered me for a long time though,
so maybe I can find some time...
--
Martijn Versteegh