I think I need some clues as to how the toolbars and themes work in the
RISC OS frontend, if anyone can help.
Based on the code in the old hotlist/global history/cookies modules, I'm
creating the hotlist window and toolbar as follows:
/* create our window */
hotlist_window.window = ro_gui_dialog_create("tree");
ro_gui_set_window_title(hotlist_window.window,
messages_get("Hotlist"));
/* (...create the treeview here...) */
/* Create our toolbar */
hotlist_window.toolbar = ro_gui_theme_create_toolbar(NULL,
THEME_HOTLIST_TOOLBAR);
if (hotlist_window.toolbar)
ro_gui_theme_attach_toolbar(hotlist_window.toolbar,
hotlist_window.window);
and then going on to open the window with:
if (!ro_gui_dialog_open_top(hotlist_window.window,
hotlist_window.toolbar, 600, 800)) {
/* ...do stuff to the opened window... */
}
Unfortunately, while the dialog opens fine, I don't get a toolbar.
Further investigation would seem to suggest that I'm getting a toolbar (or
at least a non-NULL pointer) back from ro_gui_theme_create_toolbar(), but
that ro_gui_theme_attach_toolbar() doesn't actually do anything, because it
checks if the value returned from the ro_gui_theme_toolbar_height() macro
for the bar is > 0 and skips past the pane attaching bit of the code if it
isn't. For the toolbars I've created, it isn't -- as far as I can tell,
because toolbar->max_height is still at 0 when the code is called.
Clearly toolbars do still work, as the main browser window has one. My
guess is that I'm not doing some vital initialisation on the hotlist bar,
but so far I can't spot what it is. As far as I can see, the themes have
been set up before the dialog boxes are created, so I'm assuming (pending
further investigation) that by the time the hotlist toolbar is created the
theme system knows what icons it contains and how big they are.
Is there any more info on how to use the RISC OS toolbars? If not, I'll
take a copy of the current RISC OS trunk and try to trace how things get set
up and initialised; I suspect it's a lot of work that I'd rather avoid if
anyone happens to know the answer, though.
--
Steve Fryatt - Leeds, England
http://www.stevefryatt.org.uk/