From e387d5e34a2ae57b0f4d58bb16f844d9b923650e Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Thu, 8 Jul 2004 22:05:35 +0000 Subject: [project @ 2004-07-08 22:05:35 by rjw] Lose compiler warnings. Fix for dragging hotlist item to itself failing. Initial work on adding/editing entries. svn path=/import/netsurf/; revision=1061 --- riscos/wimp.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'riscos/wimp.c') diff --git a/riscos/wimp.c b/riscos/wimp.c index ce07237d6..3a6ee3fd4 100644 --- a/riscos/wimp.c +++ b/riscos/wimp.c @@ -239,6 +239,35 @@ int ro_gui_get_icon_selected_state(wimp_w w, wimp_i i) { #define ro_gui_set_icon_shaded_state(w, i, state) xwimp_set_icon_state(w, i, (state ? wimp_ICON_SHADED : 0), wimp_ICON_SHADED) +/** + * Set a window title (does *not* redraw the title) + * + * \param w window handle + * \param text new title (copied) + */ +void ro_gui_set_window_title(wimp_w w, const char *text) { + wimp_window_info_base window; + os_error *error; + + /* Get the window details + */ + window.w = w; + error = xwimp_get_window_info_header_only((wimp_window_info *)&window); + if (error) { + LOG(("xwimp_get_window_info: 0x%x: %s", + error->errnum, error->errmess)); + warn_user("WimpError", error->errmess); + return; + } + + /* Set the title string + */ + strncpy(window.title_data.indirected_text.text, text, + (unsigned int)window.title_data.indirected_text.size - 1); + window.title_data.indirected_text.text[window.title_data.indirected_text.size - 1] = '\0'; +} + + /** * Load a sprite file into memory. * -- cgit v1.2.3