Example #1
0
static void
wireless_applet_option_change (GtkWidget *widget, gpointer user_data)
{
	GtkWidget *entry;
	GtkWidget *menu = NULL;
	char *str;
	WirelessApplet *applet = (WirelessApplet *)user_data;

	/* Get all the properties and update the applet */
	entry = g_object_get_data (G_OBJECT (applet->prefs),
			"show-percent-button");
	wireless_applet_set_show_percent (applet,
			gtk_toggle_button_get_active
			(GTK_TOGGLE_BUTTON (entry)));

	entry = g_object_get_data (G_OBJECT (applet->prefs), "device-menu");

	menu = gtk_menu_get_active
		(GTK_MENU (gtk_option_menu_get_menu (GTK_OPTION_MENU (entry))));
	if (menu) {
		str = g_object_get_data (G_OBJECT (menu), "device-selected");
		wireless_applet_set_device (applet, str);
	}

	/* Save the properties */
	wireless_applet_save_properties (applet);
}
Example #2
0
wxString wxChoice::GetString(unsigned int n) const
{
    wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid choice") );

    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
    unsigned int count = 0;
    GList *child = menu_shell->children;
    while (child)
    {
        GtkBin *bin = GTK_BIN( child->data );
        if (count == n)
        {
            GtkLabel *label = NULL;
            if (bin->child)
                label = GTK_LABEL(bin->child);
            if (!label)
                label = GTK_LABEL( BUTTON_CHILD(m_widget) );

            wxASSERT_MSG( label != NULL , wxT("wxChoice: invalid label") );

            return wxString( label->label );
        }
        child = child->next;
        count++;
    }

    wxFAIL_MSG( wxT("wxChoice: invalid index in GetString()") );

    return wxEmptyString;
}
Example #3
0
void wxChoice::SetString(unsigned int n, const wxString& str )
{
    wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );

    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
    unsigned int count = 0;
    GList *child = menu_shell->children;
    while (child)
    {
        GtkBin *bin = GTK_BIN( child->data );
        if (count == n)
        {
            GtkLabel *label = NULL;
            if (bin->child)
                label = GTK_LABEL(bin->child);
            if (!label)
                label = GTK_LABEL( BUTTON_CHILD(m_widget) );

            wxASSERT_MSG( label != NULL , wxT("wxChoice: invalid label") );

            gtk_label_set_text( label, wxGTK_CONV( str ) );

            return;
        }
        child = child->next;
        count++;
    }
}
Example #4
0
int wxChoice::FindString( const wxString &string, bool bCase ) const
{
    wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid choice") );

    // If you read this code once and you think you understand
    // it, then you are very wrong. Robert Roebling.

    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
    int count = 0;
    GList *child = menu_shell->children;
    while (child)
    {
        GtkBin *bin = GTK_BIN( child->data );
        GtkLabel *label = NULL;
        if (bin->child)
            label = GTK_LABEL(bin->child);
        if (!label)
            label = GTK_LABEL( BUTTON_CHILD(m_widget) );

        wxASSERT_MSG( label != NULL , wxT("wxChoice: invalid label") );

         wxString tmp( label->label );

         if (string.IsSameAs( tmp, bCase ))
            return count;

        child = child->next;
        count++;
    }

    return wxNOT_FOUND;
}
Example #5
0
void prefs_spelling_save(PrefsPage *_page)
{
	SpellingPage *spelling = (SpellingPage *) _page;

	prefs_common.enable_aspell =
		gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_enable_aspell));
	prefs_common.check_while_typing =
		gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_check_while_typing));
	prefs_common.use_alternate =
		gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_use_alternate));

	if (prefs_common.aspell_path)
		g_free(prefs_common.aspell_path);
	prefs_common.aspell_path =
		gtk_editable_get_chars(GTK_EDITABLE(spelling->entry_aspell_path), 0, -1);

	if (prefs_common.dictionary != NULL)
		g_free(prefs_common.dictionary);
	prefs_common.dictionary = 
		gtkaspell_get_dictionary_menu_active_item(
			gtk_option_menu_get_menu(
				GTK_OPTION_MENU(
					spelling->optmenu_dictionary)));

	prefs_common.aspell_sugmode =
		gtkaspell_get_sugmode_from_option_menu(
			GTK_OPTION_MENU(spelling->optmenu_sugmode));

	prefs_common.misspelled_col = spelling->misspell_col;
}
Example #6
0
int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items,
                            unsigned int pos,
                            void **clientData, wxClientDataType type)
{
    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice control") );

    const unsigned int count = items.GetCount();

    GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );

    for ( unsigned int i = 0; i < count; ++i, ++pos )
    {
        int n = GtkAddHelper(menu, pos, items[i]);
        if ( n == wxNOT_FOUND )
            return n;

        AssignNewItemClientData(n, clientData, i, type);
    }

    // if the item to insert is at or before the selection, and the selection is valid
    if (((int)pos <= m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
    {
        // move the selection forward
        m_selection_hack += count;
    }

    return pos - 1;
}
static bool
load_romaji_theme (void)
{
    GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_romaji_theme_menu);
    gint idx = gtk_option_menu_get_history (omenu);
    GtkWidget *menu = gtk_option_menu_get_menu (omenu);
    GList *list = gtk_container_get_children (GTK_CONTAINER (menu));
    GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx));

    if (!menuitem)
        return false;

    gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
                                                         INDEX_KEY));

    // set new romaji table
    if (idx == ROMAJI_THEME_INDEX_USER_DEFINED) {
        // User defined table
        __config_romaji_theme_file = __user_style_file.get_file_name ();
        StyleLines lines;
        bool success = __user_style_file.get_entry_list
                           (lines, __romaji_fund_table);
        if (!success || lines.empty ())
            setup_default_romaji_table ();

        return true;

    } else if (idx == ROMAJI_THEME_INDEX_DEFAULT) {
        // Default table
        __config_romaji_theme_file = "";
        setup_default_romaji_table ();

        return true;

    } else if (theme_idx >= 0 && theme_idx < (int) __style_list.size ()) {
        // Tables defined in system theme files
        __config_romaji_theme_file = __style_list[theme_idx].get_file_name ();
        __user_style_file.delete_section (__romaji_fund_table);

        std::vector<String> keys;
        bool success = __style_list[theme_idx].get_key_list
                           (keys, __romaji_fund_table);
        if (success) {
            std::vector<String>::iterator it;
            for (it = keys.begin (); it != keys.end (); it++) {
                std::vector<WideString> value;
                __style_list[theme_idx].get_string_array
                    (value, __romaji_fund_table, *it);
                __user_style_file.set_string_array (__romaji_fund_table,
                                                    *it, value);
            }
        }
        return true;

    } else {
        // error
        return false;
    }
}
Example #8
0
static void
account_update(GtkWidget *widget, GtkOptionMenu *optmenu)
{
	PurpleAccount *account = NULL;

	account = g_object_get_data(G_OBJECT(gtk_menu_get_active(GTK_MENU(gtk_option_menu_get_menu(optmenu)))), "account");
	purple_account_set_int(account, "score", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)));
}
Example #9
0
/*#
    @method get_menu GtkOptionMenu
    @brief Returns the GtkMenu associated with the GtkOptionMenu.
    @return the GtkMenu associated with the GtkOptionMenu.
 */
FALCON_FUNC OptionMenu::get_menu( VMARG )
{
    NO_ARGS
    MYSELF;
    GET_OBJ( self );
    GtkWidget* menu = gtk_option_menu_get_menu( (GtkOptionMenu*)_obj );
    vm->retval( new Gtk::Menu( vm->findWKI( "GtkMenu" )->asClass(), (GtkMenu*) menu ) );
}
Example #10
0
/// gtk add on to get the rank in a pull down menu
uint8_t getRangeInMenu(GtkWidget * Menu)
{
    GtkWidget *br, *active;
    int mode;

    br = gtk_option_menu_get_menu(GTK_OPTION_MENU(Menu));
    active = gtk_menu_get_active(GTK_MENU(br));
    mode = g_list_index(GTK_MENU_SHELL(br)->children, active);
    return (uint8_t) mode;
}
Example #11
0
/*
	Change the text of the nth entry in the menu

*/
void changeTextInMenu(GtkWidget *menu,int range,const char *text)
{
    GtkWidget *br, *active;
    int mode;

    br = gtk_option_menu_get_menu(GTK_OPTION_MENU(menu));
        
    //gtk_label_set_text(GTK_LABEL(br),text);

}
Example #12
0
/**
 * Fetches the data set associated with the selected menu item in
 * the GtkOptionMenu m.
 */
gpointer
option_menu_get_selected_data(GtkOptionMenu *option_menu)
{
    GtkWidget *menu;

    g_assert(GTK_IS_OPTION_MENU(option_menu));

    menu = gtk_menu_get_active(GTK_MENU(gtk_option_menu_get_menu(option_menu)));
    return menu ? gtk_object_get_user_data(GTK_OBJECT(menu)) : NULL;
}
Example #13
0
static void
check_visible_sizes (const gchar *stock_id, gboolean show_all)
{
  GtkIconSet *icon_set;
  GtkIconSize *sizes;
  gint n_sizes, i, j;
  GtkWidget *option_menu, *menu;
  gboolean item_visible[G_N_ELEMENTS(GladeIconSizeValues)];
  GList *children;

  for (j = 0; j < GladeIconSizeChoicesSize; j++)
    item_visible[j] = show_all;

  if (!show_all)
    {
      icon_set = gtk_icon_factory_lookup_default (stock_id);
      if (icon_set)
	{
	  gtk_icon_set_get_sizes (icon_set, &sizes, &n_sizes);
	  /* Figure out which of our choices should be visible. */
	  for (i = 0; i < n_sizes; i++)
	    {
	      for (j = 0; j < GladeIconSizeChoicesSize; j++)
		{
		  if (sizes[i] == GladeIconSizeValues[j])
		    item_visible[j] = TRUE;
		}
	    }
	  g_free (sizes);
	}
    }

  /* Show or Hide the items as appropriate. */
  option_menu = property_get_value_widget (IconSize);
  g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));

  menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (option_menu));
  g_return_if_fail (GTK_IS_MENU (menu));

  children = GTK_MENU_SHELL (menu)->children;
  for (j = 0; j < GladeIconSizeChoicesSize; j++)
    {
      GtkWidget *item;

      item = children->data;

      if (item_visible[j])
	gtk_widget_show (item);
      else
	gtk_widget_hide (item);

      children = children->next;
    }
}
Example #14
0
project_parameters_t *
load_selected_predefined_projection_parameters(int is_source, int projection,
                                               datum_type_t *datum,
					       spheroid_type_t *spheroid)
{
    GtkWidget * predefined_projection_option_menu;
    GtkWidget * menu;
    GtkWidget * selected_item;
    gchar filename[256];
    gchar * path;
    gchar * path_and_filename;
    project_parameters_t * ret;
    projection_type_t type;
    char *err=NULL;

    predefined_projection_option_menu = is_source ?
      get_widget_checked("source_predefined_projection_option_menu") :
      get_widget_checked("target_predefined_projection_option_menu");

    menu =
        gtk_option_menu_get_menu(
        GTK_OPTION_MENU(predefined_projection_option_menu));

    selected_item =
        gtk_menu_get_active(GTK_MENU(menu));

    sprintf(filename, "%s.proj", (char *)g_object_get_data(
        G_OBJECT(selected_item), "file"));

    if (out_of_sync(filename, projection))
        return NULL;

    path = projection_directory(projection);

    path_and_filename = (gchar *)
        g_malloc(sizeof(gchar *) * (strlen(path) + strlen(filename) + 5));

    sprintf(path_and_filename, "%s/%s", path, filename);

    ret = (project_parameters_t *) g_malloc(sizeof(project_parameters_t));
    if (!parse_proj_args_file(path_and_filename, ret, &type, datum, spheroid,
			      &err))
    {
        message_box(err);
        free(err);
        return NULL;
    }

    g_free(path);
    g_free(path_and_filename);

    return ret;
}
Example #15
0
static GtkWidget*
tip_dilation_data_option_menu(GwyDataWindow **operand)
{
    GtkWidget *omenu, *menu;

    omenu = gwy_option_menu_data_window(G_CALLBACK(tip_dilation_data_cb),
                                        NULL, NULL, GTK_WIDGET(*operand));
    menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(omenu));
    g_object_set_data(G_OBJECT(menu), "operand", operand);

    return omenu;
}
Example #16
0
/* Callback used when a month button is toggled */
static void
month_changed (GtkToggleButton *toggle, gpointer data)
{
	GoToDialog *dlg = data;
	GtkWidget *menu, *active;

	menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month));
	active = gtk_menu_get_active (GTK_MENU (menu));
	dlg->month_val = g_list_index (GTK_MENU_SHELL (menu)->children, active);

	e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val);
}
Example #17
0
unsigned int wxChoice::GetCount() const
{
    wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid choice") );

    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
    unsigned int count = 0;
    GList *child = menu_shell->children;
    while (child)
    {
        count++;
        child = child->next;
    }
    return count;
}
Example #18
0
/**
 * Test whether we can move off format page.
 * \return <i>TRUE</i> if OK to move off page.
 */
static gboolean exp_html_move_format( void ) {
	gboolean retVal = FALSE;
	GtkWidget *menu, *menuItem;
	gint id;

	/* Set stylesheet */
	menu = gtk_option_menu_get_menu( GTK_OPTION_MENU( exphtml_dlg.optmenuCSS ) );
	menuItem = gtk_menu_get_active( GTK_MENU( menu ) );
	id = GPOINTER_TO_INT( gtk_object_get_user_data(GTK_OBJECT(menuItem)) );
	exporthtml_set_stylesheet( _exportCtl_, id );

	/* Set name format */
	menu = gtk_option_menu_get_menu( GTK_OPTION_MENU( exphtml_dlg.optmenuName ) );
	menuItem = gtk_menu_get_active( GTK_MENU( menu ) );
	id = GPOINTER_TO_INT( gtk_object_get_user_data(GTK_OBJECT(menuItem)) );
	exporthtml_set_name_format( _exportCtl_, id );

	exporthtml_set_banding( _exportCtl_,
		gtk_toggle_button_get_active(
			GTK_TOGGLE_BUTTON( exphtml_dlg.checkBanding ) ) );
	exporthtml_set_link_email( _exportCtl_,
		gtk_toggle_button_get_active(
			GTK_TOGGLE_BUTTON( exphtml_dlg.checkLinkEMail ) ) );
	exporthtml_set_attributes( _exportCtl_,
		gtk_toggle_button_get_active(
			GTK_TOGGLE_BUTTON( exphtml_dlg.checkAttributes ) ) );

	/* Process export */
	exporthtml_process( _exportCtl_, _addressCache_ );
	if( _exportCtl_->retVal == MGU_SUCCESS ) {
		retVal = TRUE;
	}
	else {
		export_html_status_show( _( "Error creating HTML file" ) );
	}
	return retVal;
}
Example #19
0
static gint
property_dialog_get_selected (GtkWidget *option_menu)
{
	GtkWidget *menu;
	GtkWidget *item;
	gint       ret;

	menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (option_menu));

	item = gtk_menu_get_active (GTK_MENU (menu));

	ret = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "data"));

	return ret;
}
Example #20
0
/* fill_widgets handler for the alarm page */
static void
alarm_to_dialog (Dialog *dialog)
{
    GtkWidget *menu;
    GList *l;
    gboolean repeat;
    ECalComponentAlarmAction action;
    char *email;
    int i;

    /* Clean the page */
    clear_widgets (dialog);

    /* Alarm types */
    menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action));
    for (i = 0, l = GTK_MENU_SHELL (menu)->children; action_map[i] != -1; i++, l = l->next) {
        if (e_cal_get_static_capability (dialog->ecal, action_map_cap[i]))
            gtk_widget_set_sensitive (l->data, FALSE);
        else
            gtk_widget_set_sensitive (l->data, TRUE);
    }

    /* Set a default address if possible */
    if (!e_cal_get_static_capability (dialog->ecal, CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS)
            && !e_cal_component_alarm_has_attendees (dialog->alarm)
            && e_cal_get_alarm_email_address (dialog->ecal, &email, NULL)) {
        ECalComponentAttendee *a;
        GSList attendee_list;

        a = g_new0 (ECalComponentAttendee, 1);
        a->value = email;
        attendee_list.data = a;
        attendee_list.next = NULL;
        e_cal_component_alarm_set_attendee_list (dialog->alarm, &attendee_list);
        g_free (email);
        g_free (a);
    }

    /* If we can repeat */
    repeat = !e_cal_get_static_capability (dialog->ecal, CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT);
    gtk_widget_set_sensitive (dialog->repeat_toggle, repeat);

    /* if we are editing a exiting alarm */
    e_cal_component_alarm_get_action (dialog->alarm, &action);

    if (action)
        populate_widgets_from_alarm (dialog);
}
Example #21
0
static void
goto_dialog_init_widgets (GoToDialog *dlg)
{
	GtkWidget *menu;
	GtkAdjustment *adj;
	GList *l;

	menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month));
	for (l = GTK_MENU_SHELL (menu)->children; l != NULL; l = l->next)
		g_signal_connect (menu, "selection_done", G_CALLBACK (month_changed), dlg);

	adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (dlg->year));
	g_signal_connect (adj, "value_changed", G_CALLBACK (year_changed), dlg);

	g_signal_connect (dlg->ecal->calitem, "date_range_changed", G_CALLBACK (ecal_date_range_changed), dlg);
	g_signal_connect (dlg->ecal->calitem, "selection_changed", G_CALLBACK (ecal_event), dlg);
}
Example #22
0
static void
gr_edit (GtkWidget */*button*/, GtkWidget *widget)
{
    GtkWidget *om = (GtkWidget *) g_object_get_data (G_OBJECT(widget), "menu");

    spinbutton_defocus(GTK_OBJECT(widget));

    if (om) {
        GtkWidget *i = gtk_menu_get_active (GTK_MENU (gtk_option_menu_get_menu (GTK_OPTION_MENU (om))));
        SPGradient *gr = (SPGradient *) g_object_get_data (G_OBJECT(i), "gradient");

        if (gr) {
            GtkWidget *dialog = sp_gradient_vector_editor_new (gr);
            gtk_widget_show (dialog);
        }
    }
}
Example #23
0
static GtkWidget *
get_exif_date_option_item (DialogData *data)
{
	GtkWidget *menu;
	GList     *list, *scan;
	int        i = 0;
	GtkWidget *retval = NULL;

	menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (data->date_optionmenu));
	list = gtk_container_get_children (GTK_CONTAINER (menu));
	for (scan = list; scan && i < EXIF_DATE; scan = scan->next)
		i++;

	retval = (GtkWidget*) scan->data;
	g_list_free (list);

	return retval;
}
Example #24
0
static void
property_dialog_setup_option_menu (GtkWidget     *option_menu,
				   GCallback      func,
				   gpointer       user_data,
				   gconstpointer  str1, ...)
{
	GtkWidget     *menu;
	GtkWidget     *menu_item;
	gint           i;
	va_list        args;
	gconstpointer  str;
	gint           type;

       	menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (option_menu));
	if (menu) {
		gtk_widget_destroy (menu);
	}

	menu = gtk_menu_new ();

	va_start (args, str1);
	for (str = str1, i = 0; str != NULL; str = va_arg (args, gpointer), i++) {
		menu_item = gtk_menu_item_new_with_label (str);
		gtk_widget_show (menu_item);
		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);

		type = va_arg (args, gint);

		g_object_set_data (G_OBJECT (menu_item),
				   "data",
				   GINT_TO_POINTER (type));
		if (func) {
			g_signal_connect (menu_item,
					  "activate",
					  func,
					  user_data);
		}
	}
	va_end (args);

	gtk_widget_show (menu);
	gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
}
Example #25
0
static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
{
    if (g_isIdle)
      wxapp_install_idle_handler();

    if (!choice->m_hasVMT) return;

    if (g_blockEventsOnDrag) return;

    int selection = wxNOT_FOUND;

    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(choice->GetHandle()) ) );
    int count = 0;

    GList *child = menu_shell->children;
    while (child)
    {
        GtkBin *bin = GTK_BIN( child->data );
        if (!bin->child)
        {
            selection = count;
            break;
        }
        child = child->next;
        count++;
    }

    choice->m_selection_hack = selection;

    wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, choice->GetId() );
    int n = choice->GetSelection();

    event.SetInt( n );
    event.SetString( choice->GetStringSelection() );
    event.SetEventObject(choice);

    if ( choice->HasClientObjectData() )
        event.SetClientObject( choice->GetClientObject(n) );
    else if ( choice->HasClientUntypedData() )
        event.SetClientData( choice->GetClientData(n) );

    choice->HandleWindowEvent(event);
}
Example #26
0
/**
 * Select the menu item which has given data attached to it.
 */
void
option_menu_select_item_by_data(GtkOptionMenu *option_menu, gconstpointer data)
{
    GList *iter;
    gint i;

    g_assert(option_menu);
    g_assert(GTK_IS_OPTION_MENU(option_menu));

    iter = GTK_MENU_SHELL(gtk_option_menu_get_menu(option_menu))->children;
    for (i = 0; iter != NULL; iter = g_list_next(iter), i++) {
        if (iter->data && gtk_object_get_user_data(iter->data) == data) {
			gtk_option_menu_set_history(option_menu, i);
			return;
        }
    }

	g_warning("option_menu_select_item_by_data: no item with data %p", data);
}
Example #27
0
/* Hooks the widget signals */
static void
init_widgets (Dialog *dialog)
{
    GtkWidget *menu;
    GtkTextBuffer *text_buffer;

    menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action));
    g_signal_connect (menu, "selection_done",
                      G_CALLBACK (action_selection_done_cb),
                      dialog);

    g_signal_connect (G_OBJECT (dialog->repeat_toggle), "toggled",
                      G_CALLBACK (repeat_toggle_toggled_cb), dialog);

    /* Handle custom sounds */
    g_signal_connect (G_OBJECT (dialog->aalarm_sound), "toggled",
                      G_CALLBACK (aalarm_sound_toggled_cb), dialog);
    g_signal_connect (G_OBJECT (dialog->aalarm_file_chooser), "selection-changed",
                      G_CALLBACK (aalarm_attach_changed_cb), dialog);

    /* Handle custom messages */
    g_signal_connect (G_OBJECT (dialog->dalarm_message), "toggled",
                      G_CALLBACK (dalarm_message_toggled_cb), dialog);
    text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description));
    g_signal_connect (G_OBJECT (text_buffer), "changed",
                      G_CALLBACK (dalarm_description_changed_cb), dialog);

    /* Handle program */
    g_signal_connect (G_OBJECT (dialog->palarm_program), "changed",
                      G_CALLBACK (palarm_program_changed_cb), dialog);

    /* Handle custom email */
    g_signal_connect (G_OBJECT (dialog->malarm_message), "toggled",
                      G_CALLBACK (malarm_message_toggled_cb), dialog);
    text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description));
    g_signal_connect (G_OBJECT (text_buffer), "changed",
                      G_CALLBACK (malarm_description_changed_cb), dialog);

    g_signal_connect (dialog->malarm_addresses, "changed",
                      G_CALLBACK (malarm_addresses_changed_cb), dialog);
}
Example #28
0
static void dologin(GtkWidget *widget, GtkWidget *w)
{
	GaimAccount *account;
	GtkWidget *item;
	const char *password = gtk_entry_get_text(GTK_ENTRY(pass));

	item = gtk_menu_get_active(GTK_MENU(gtk_option_menu_get_menu(GTK_OPTION_MENU(name))));
	account = g_object_get_data(G_OBJECT(item), "account");

	if (!account) {
		gaim_notify_error(NULL, NULL, _("Please create an account."), NULL);
		return;
	}

	gaim_account_set_password(account, (*password != '\0') ? password : NULL);

#ifdef GAIM_SMALL_SCREEN
    account->ui_data = vbox_toplevel;
#endif    
	gaim_account_connect(account);
}
Example #29
0
static void
gb_menu_bar_on_edit_menu (GtkWidget *button,
			  gpointer data)
{
  GtkWidget *option, *menued, *menu;

  option = property_get_widget ();
  g_return_if_fail (GTK_IS_OPTION_MENU (option));

  /* 
   * we need to remove the menu from the option menu otherwise there
   * will be a separator where the selected menu is
   */
  g_object_set_data (G_OBJECT (option), 
		     History,
		     GINT_TO_POINTER (gtk_option_menu_get_history (GTK_OPTION_MENU (option))));
  menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (option));
  if (!menu)
    menu = gb_widget_new ("GtkMenu", option);
  g_object_ref (menu);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (option), gtk_menu_new ());

  menued = glade_menu_editor_new (current_project, GTK_MENU_SHELL (menu));
  g_signal_connect (menued, "destroy", G_CALLBACK (set_menu), option);

  /* I think this was hidden as it doesn't call set_menu() to reset the
     history. */
  gtk_widget_hide (GLADE_MENU_EDITOR (menued)->apply_button);

  dialogize (menued, button);
  gtk_widget_show (GTK_WIDGET (menued));

  gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu);
  g_object_unref (menu);
}
Example #30
0
void wxChoice::DoApplyWidgetStyle(GtkRcStyle *style)
{
    GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );

    gtk_widget_modify_style( m_widget, style );
    gtk_widget_modify_style( GTK_WIDGET( menu_shell ), style );

    GList *child = menu_shell->children;
    while (child)
    {
        gtk_widget_modify_style( GTK_WIDGET( child->data ), style );

        GtkBin *bin = GTK_BIN( child->data );
        GtkWidget *label = NULL;
        if (bin->child)
            label = bin->child;
        if (!label)
            label = BUTTON_CHILD(m_widget);

        gtk_widget_modify_style( label, style );

        child = child->next;
    }
}