GUI development

From Navit's Wiki
Revision as of 09:22, 21 October 2007 by KaZeR (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Writing a new gui.

Almost everything in NavIt works as a plugin, and so do the guis.

You have to provide a function plugin_init in your plugin This function should call plugin_register_gui_type("gui-name",function) The function has the following parameters: struct gui_methods *meth, int w, int h - meth is a structure with gui-functions you have to fill - w is the expected width - h is the expected height of the gui.

But you might ignore w and h, they are only recommendations.

meth should be filled with the following data: - menubar_new - toolbar_new - statusbar_new - popup_new - set_graphics

You can probably implement menubar_new, toolbar_new, statusbar_new and popup_new as a dummy, since it is rather GTK-specific. But set_graphics is required. It connects the graphics to the gui.