Beispiel #1
0
void gui_window_set_url(struct gui_window *w, const char *url)
{
    int l;

    if (w == NULL)
        return;

    l = strlen(url)+1;

    if (w->url == NULL) {
        w->url = malloc(l);
    } else {
        w->url = realloc(w->url, l);
    }
    strncpy(w->url, url, l);
    w->url[l] = 0;
    if(input_window == w->root->active_gui_window) {
        toolbar_set_url(w->root->toolbar, url);
    }
}
Beispiel #2
0
static nserror gui_window_set_url(struct gui_window *w, nsurl *url)
{
    int l;

    if (w == NULL)
	return NSERROR_OK;

    l = strlen(nsurl_access(url))+1;

    if (w->url == NULL) {
	w->url = malloc(l);
    } else {
	w->url = realloc(w->url, l);
    }
    strncpy(w->url, nsurl_access(url), l);
    w->url[l] = 0;
    if(input_window == w->root->active_gui_window) {
        toolbar_set_url(w->root->toolbar, nsurl_access(url));
    }

    return NSERROR_OK;
}