On Fri, 2010-02-12 at 17:02 +0000, Steve Fryatt wrote:
> I think I need some clues as to how the toolbars and themes work in the
> RISC OS frontend, if anyone can help.
I suspect we all do :( Richard? Are you able to remember how this stuff
works?
> 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);
Looks sane.
> 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.
I suspect that what you need is to call
ro_gui_theme_process_toolbar(history_window.toolbar, -1);
immediately after opening the window.
If that doesn't work, then I've no good idea, I'm afraid. I've never
looked at this code before.
> 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.
Yeah. That's correct.
> Is there any more info on how to use the RISC OS toolbars?
Unfortunately not, I'm afraid.
J.