void shell_view_set_enabled(gboolean setting) { if (setting) { widget_set_cursor(shell->window, GDK_LEFT_PTR); } else { widget_set_cursor(shell->window, GDK_WATCH); } gtk_widget_set_sensitive(shell->hpaned, setting); shell_action_set_enabled("ViewMenuAction", setting); shell_action_set_enabled("RefreshAction", setting); shell_action_set_enabled("ReportAction", setting); }
static gint fru_connect_dialog(Dialogs *data, bool load_profile) { /* Connect Dialog */ gint ret; struct iio_context *ctx; const char *name = NULL; bool has_context = false; /* Preload the device list and FRU info only if we can use the local * backend */ ctx = get_context_from_osc(); if (ctx) name = iio_context_get_name(ctx); if (name && !strcmp(name, "local")) has_context = connect_fillin(data); while (true) { gtk_widget_set_sensitive(data->ok_btn, has_context); ret = gtk_dialog_run(GTK_DIALOG(data->connect)); switch (ret) { case GTK_RESPONSE_APPLY: widget_set_cursor(data->connect, GDK_WATCH); has_context = connect_fillin(data); widget_use_parent_cursor(data->connect); continue; case GTK_RESPONSE_OK: ctx = get_context(data); widget_set_cursor(data->connect, GDK_WATCH); widget_use_parent_cursor(data->connect); if (!ctx) continue; application_reload(ctx, load_profile); break; default: printf("unknown response (%i) in %s(%s)\n", ret, __FILE__, __func__); case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_DELETE_EVENT: break; } gtk_widget_hide(data->connect); return ret; } }
static void combo_selected(object_t *combo, event_t *event) { list_item_t *li = combo_get_selected(combo); if(li != 0) { int cursor = GPOINTER_TO_INT(g_hash_table_lookup(types, li->data[0])); widget_set_cursor(w, cursor); } }
static void combo_selected(object_t *combo, event_t *event) { list_item_t *li = combo_get_selected(combo); printf("%p\n", li); if(li != 0) { int cursor = hashtable_search(types, li->data[0]); widget_set_cursor(w, cursor); } }