• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GTK_OPTION_MENU函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_OPTION_MENU函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_OPTION_MENU函数的具体用法?C++ GTK_OPTION_MENU怎么用?C++ GTK_OPTION_MENU使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_OPTION_MENU函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: on_romaji_theme_menu_changed

static void
on_romaji_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
{
    bool success;

    if (__widget_romaji_theme_menu != GTK_WIDGET (omenu)) {
        g_signal_handlers_block_by_func (
            G_OBJECT (__widget_romaji_theme_menu),
            (gpointer) (on_romaji_theme_menu_changed),
            NULL);
        gtk_option_menu_set_history (
            GTK_OPTION_MENU (__widget_romaji_theme_menu),
            gtk_option_menu_get_history (omenu));
        g_signal_handlers_unblock_by_func (
            G_OBJECT (__widget_romaji_theme_menu),
            (gpointer) (on_romaji_theme_menu_changed),
            NULL);

        success = load_romaji_theme ();

        setup_romaji_window_value (SCIM_ANTHY_TABLE_EDITOR (user_data));
    } else {
        success = load_romaji_theme ();
    }

    if (success) {
        // sync widgets
        __style_changed  = true;
        __config_changed = true;
    }
}
开发者ID:tzhuan,项目名称:scim-anthy,代码行数:31,代码来源:scim_anthy_setup_romaji.cpp


示例2: sp_fill_style_widget_new

GtkWidget *
sp_fill_style_widget_new (void)
{
	GtkWidget *spw, *vb, *psel, *hb, *l, *om, *m, *mi;

	spw = sp_widget_new_global (INKSCAPE);

	vb = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vb);
	gtk_container_add (GTK_CONTAINER (spw), vb);

	psel = sp_paint_selector_new ();
	gtk_widget_show (psel);
	gtk_box_pack_start (GTK_BOX (vb), psel, TRUE, TRUE, 0);
	g_object_set_data (G_OBJECT (spw), "paint-selector", psel);

	g_signal_connect (G_OBJECT (psel), "mode_changed", G_CALLBACK (sp_fill_style_widget_paint_mode_changed), spw);
	g_signal_connect (G_OBJECT (psel), "dragged", G_CALLBACK (sp_fill_style_widget_paint_dragged), spw);
	g_signal_connect (G_OBJECT (psel), "changed", G_CALLBACK (sp_fill_style_widget_paint_changed), spw);

	hb = gtk_hbox_new (FALSE, 4);
	gtk_widget_show (hb);
	gtk_box_pack_start (GTK_BOX (vb), hb, FALSE, FALSE, 0);

	l = gtk_label_new (_("Fill Rule"));
	gtk_widget_show (l);
	gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0.5);
	gtk_box_pack_start (GTK_BOX (hb), l, TRUE, TRUE, 0);

	om = gtk_option_menu_new ();
	gtk_widget_show (om);
	gtk_box_pack_start (GTK_BOX (hb), om, FALSE, FALSE, 0);
	g_object_set_data (G_OBJECT (spw), "fill-rule", om);

	/* 0 - nonzero 1 - evenodd */
	m = gtk_menu_new ();
	gtk_widget_show (m);

	mi = gtk_menu_item_new_with_label (_("nonzero"));
	gtk_widget_show (mi);
	gtk_menu_append (GTK_MENU (m), mi);
	g_object_set_data (G_OBJECT (mi), "fill-rule", (void *)"nonzero");
	g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (sp_fill_style_widget_fill_rule_activate), spw);
	mi = gtk_menu_item_new_with_label (_("evenodd"));
	gtk_widget_show (mi);
	gtk_menu_append (GTK_MENU (m), mi);
	g_object_set_data (G_OBJECT (mi), "fill-rule", (void *)"evenodd");
	g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (sp_fill_style_widget_fill_rule_activate), spw);

	gtk_option_menu_set_menu (GTK_OPTION_MENU (om), m);

	g_signal_connect (G_OBJECT (spw), "construct", G_CALLBACK (sp_fill_style_widget_construct), psel);
	g_signal_connect (G_OBJECT (spw), "modify_selection", G_CALLBACK (sp_fill_style_widget_modify_selection), psel);
	g_signal_connect (G_OBJECT (spw), "change_selection", G_CALLBACK (sp_fill_style_widget_change_selection), psel);
	g_signal_connect (G_OBJECT (spw), "attr_changed", G_CALLBACK (sp_fill_style_widget_attr_changed), psel);

	sp_fill_style_widget_update (SP_WIDGET (spw), SP_ACTIVE_DESKTOP ? SP_DT_SELECTION (SP_ACTIVE_DESKTOP) : NULL);

	return spw;
}
开发者ID:benjohnson2001,项目名称:base,代码行数:60,代码来源:fill-style.c


示例3: ACDProcCopy4to8

void ACDProcCopy4to8(bool cw)
{
  GtkWidget *opt = cw ? optAC2 : optAC3;

  GtkWidget *menu, *active_item;
  menu = GTK_OPTION_MENU(opt)->menu;
  active_item = gtk_menu_get_active(GTK_MENU(menu));
  int noact = g_list_index(GTK_MENU_SHELL(menu)->children, active_item);
  int numact = actor->GetNumAction() - noact * 8;
  if (numact < 8) {
    GtkWidget *mes;
    mes = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
            GTK_BUTTONS_OK, _("This act doesn't have 8 actions."));
    gtk_dialog_run(GTK_DIALOG(mes));
    gtk_widget_destroy(mes);
    return;
  }

  int baseact = noact * 8;
  for (int i=0; i<4; i++) {
    if (cw) {
      actor->CopyAction(baseact+i*2+1, baseact+i*2);
    } else {
      actor->CopyAction(baseact+i*2, baseact+i*2+1);
    }
  }
}
开发者ID:CairoLee,项目名称:Ragnarok.Tools,代码行数:27,代码来源:act_copy.cpp


示例4: add_menuitem_to_source

static void
add_menuitem_to_source (GtkWidget * widget,
			GbWriteMenuItemSourceData * write_data)
{
  gchar *label_text;
  GtkWidget *menuitem, *child = GTK_BIN (widget)->child;

  menuitem = GTK_OPTION_MENU (write_data->option_menu)->menu_item;
  if (child == NULL && menuitem == widget)
    {
      child = GTK_BUTTON (write_data->option_menu)->child;
      write_data->selected_index = write_data->index;
    }

  if (child && GTK_IS_LABEL (child))
    {
      gtk_label_get (GTK_LABEL (child), &label_text);

      source_add (write_data->data,
		  "  glade_menuitem = gtk_menu_item_new_with_label (%s);\n"
		  "  gtk_widget_show (glade_menuitem);\n"
		  "  gtk_menu_append (GTK_MENU (%s_menu), glade_menuitem);\n",
		  source_make_string (label_text,
				      write_data->data->use_gettext),
		  write_data->data->real_wname);
    }

  write_data->index++;
}
开发者ID:cooljeanius,项目名称:glade0-0.6.4,代码行数:29,代码来源:gboptionmenu.c


示例5: get_requested_time

static time_t
get_requested_time (DialogData *data, 
		    const char *filename)
{
	int idx  = gtk_option_menu_get_history (GTK_OPTION_MENU (data->date_optionmenu));
	time_t t = (time_t)0;

	switch (idx) {
	case NO_DATE:
		break;
	case FOLLOWING_DATE:
		t = gnome_date_edit_get_time (GNOME_DATE_EDIT (data->date_dateedit));
		break;
	case CURRENT_DATE:
		t = time (NULL);
		break;
	case EXIF_DATE:
		t = get_metadata_time (NULL, filename);
		break;
	case LAST_MODIFIED_DATE:
		t = get_file_mtime (filename);
		break;
	case IMAGE_CREATION_DATE:
		t = get_file_ctime (filename);
		break;
	}

	return t;
}
开发者ID:ChingezKhan,项目名称:gthumb,代码行数:29,代码来源:dlg-comment.c


示例6: load_romaji_theme

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;
    }
}
开发者ID:tzhuan,项目名称:scim-anthy,代码行数:59,代码来源:scim_anthy_setup_romaji.cpp


示例7: util_option_fwd_cb

static void
util_option_fwd_cb(GtkOptionMenu * opt_menu, gpointer callback)
{
	((util_option_changed_cb)callback)(
		gtk_option_menu_get_history(GTK_OPTION_MENU(opt_menu)),
		g_object_get_data(G_OBJECT(opt_menu), "changed_userdata")
	);
}
开发者ID:razzmatazz,项目名称:quickchat-and-vypress-chat-code,代码行数:8,代码来源:gui_misc.c


示例8: change_toolbar_style

static void
change_toolbar_style (GtkWidget *option_menu, GtkWidget *toolbar)
{
  GtkToolbarStyle style;

  style = gtk_option_menu_get_history (GTK_OPTION_MENU (option_menu));
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), style);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:8,代码来源:testtoolbar.c


示例9: gtk_option_menu_get_history

void KeyOptionView::onValueChange() {
	if (!myCurrentKey.empty()) {
		((ZLKeyOptionEntry*)myOption)->onValueChange(
			myCurrentKey,
			gtk_option_menu_get_history(GTK_OPTION_MENU(myComboBox))
		);
	}
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:8,代码来源:GtkOptionView.cpp


示例10: comments_load

static void
comments_load(JamView *view) {
	LJCommentsType type = jam_doc_get_comments(view->doc);
	if (type != LJ_COMMENTS_DEFAULT)
		show_meta(view, JAM_VIEW_COMMENTS);
	if (comments_visible(view))
		gtk_option_menu_set_history(GTK_OPTION_MENU(view->comments), type);
}
开发者ID:nightmorph,项目名称:LogJam,代码行数:8,代码来源:jamview.c


示例11: sp_fill_style_widget_update_repr

static void
sp_fill_style_widget_update_repr (SPWidget *spw, SPRepr *repr)
{
	SPPaintSelector *psel;
	GtkWidget *fillrule;
	SPPaintSelectorMode pselmode;
	SPStyle *style;
	gfloat c[5];

	if (g_object_get_data (G_OBJECT (spw), "update")) return;

	g_object_set_data (G_OBJECT (spw), "update", GINT_TO_POINTER (TRUE));

#ifdef SP_FS_VERBOSE
	g_print ("FillStyleWidget: Set update flag\n");
#endif
	psel = SP_PAINT_SELECTOR(g_object_get_data (G_OBJECT (spw), "paint-selector"));

	style = sp_style_new ();
	sp_style_read_from_repr (style, repr);

	pselmode = sp_fill_style_determine_paint_selector_mode (style);
#ifdef SP_FS_VERBOSE
	g_print ("FillStyleWidget: paint selector mode %d\n", pselmode);
#endif
	switch (pselmode) {
	case SP_PAINT_SELECTOR_MODE_NONE:
		/* No paint at all */
		sp_paint_selector_set_mode (psel, SP_PAINT_SELECTOR_MODE_NONE);
		break;
	case SP_PAINT_SELECTOR_MODE_COLOR_RGB:
		sp_paint_selector_set_mode (psel, SP_PAINT_SELECTOR_MODE_COLOR_RGB);
		sp_color_get_rgb_floatv (&style->fill.value.color, c);
		c[3] = SP_SCALE24_TO_FLOAT (style->fill_opacity.value);
		sp_paint_selector_set_color_rgba_floatv (psel, c);
		break;
	case SP_PAINT_SELECTOR_MODE_COLOR_CMYK:
		sp_paint_selector_set_mode (psel, SP_PAINT_SELECTOR_MODE_COLOR_CMYK);
		sp_color_get_cmyk_floatv (&style->fill.value.color, c);
		c[4] = SP_SCALE24_TO_FLOAT (style->fill_opacity.value);
		sp_paint_selector_set_color_cmyka_floatv (psel, c);
		break;
	case SP_PAINT_SELECTOR_MODE_GRADIENT_LINEAR:
		break;
	default:
		break;
	}

	fillrule = GTK_WIDGET(g_object_get_data (G_OBJECT (spw), "fill-rule"));
	gtk_option_menu_set_history (GTK_OPTION_MENU (fillrule), (style->fill_rule.computed == ART_WIND_RULE_NONZERO) ? 0 : 1);

	sp_style_unref (style);

	g_object_set_data (G_OBJECT (spw), "update", GINT_TO_POINTER (FALSE));
#ifdef SP_FS_VERBOSE
	g_print ("FillStyleWidget: Cleared update flag\n");
#endif
}
开发者ID:benjohnson2001,项目名称:base,代码行数:58,代码来源:fill-style.c


示例12: command_make

static GtkWidget*
command_make(SettingsWidget *sw) {
    CommandList *cmds = sw->data;
    GtkWidget *vbox, *menu;
    GtkSizeGroup *sg;
    char *cmd = *((char**)sw->conf);
    int cur = -1;
    int i;

    menu = gtk_menu_new();
    for (i = 0; cmds[i].label; i++) {
        char *curcmd = cmds[i].command;
        gtk_menu_shell_append(GTK_MENU_SHELL(menu),
                              gtk_menu_item_new_with_label(_(cmds[i].label)));
        if (cur == -1 &&
                ((cmd == curcmd) ||
                 (cmd && curcmd && (strcmp(cmd, curcmd) == 0))))
            cur = i;
    }
    gtk_menu_shell_append(GTK_MENU_SHELL(menu),
                          gtk_menu_item_new_with_label(_("Custom Command")));
    if (cur == -1) cur = i;

    sw->widget = gtk_option_menu_new();
    gtk_option_menu_set_menu(GTK_OPTION_MENU(sw->widget), menu);
    gtk_option_menu_set_history(GTK_OPTION_MENU(sw->widget), cur);

    sw->subwidget = gtk_entry_new();
    tie_text(GTK_ENTRY(sw->subwidget), (char**)sw->conf);

    g_signal_connect(G_OBJECT(sw->widget), "changed",
                     G_CALLBACK(command_changed_cb), sw);
    jam_widget_set_visible(sw->subwidget, cur == i);

    sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
    vbox = gtk_vbox_new(FALSE, 3);
    gtk_box_pack_start(GTK_BOX(vbox),
                       labelled_box_new_sg(_(sw->caption), sw->widget, sg),
                       FALSE, FALSE, 0);
    sw->data2 = labelled_box_new_sg(NULL, sw->subwidget, sg);  /* ugh. */
    gtk_box_pack_start(GTK_BOX(vbox),
                       sw->data2,
                       FALSE, FALSE, 0);
    return vbox;
}
开发者ID:nightmorph,项目名称:LogJam,代码行数:45,代码来源:settings.c


示例13: export_html_fill_fields

/**
 * Populate fields from control data.
 * \param ctl Export control data.
 */
static void export_html_fill_fields( ExportHtmlCtl *ctl ) {
	gtk_entry_set_text( GTK_ENTRY(exphtml_dlg.entryHtml), "" );
	if( ctl->path ) {
		gtk_entry_set_text( GTK_ENTRY(exphtml_dlg.entryHtml),
			ctl->path );
	}

	gtk_option_menu_set_history(
		GTK_OPTION_MENU( exphtml_dlg.optmenuCSS ), ctl->stylesheet );
	gtk_option_menu_set_history(
		GTK_OPTION_MENU( exphtml_dlg.optmenuName ), ctl->nameFormat );
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON( exphtml_dlg.checkBanding ), ctl->banding );
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON( exphtml_dlg.checkLinkEMail ), ctl->linkEMail );
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON( exphtml_dlg.checkAttributes ), ctl->showAttribs );
}
开发者ID:moreorless,项目名称:claws-mail,代码行数:22,代码来源:exphtmldlg.c


示例14: select_polsarpro_classification_lut

void select_polsarpro_classification_lut(const char *lut_basename)
{
  int which = GPOINTER_TO_INT(
                  g_hash_table_lookup(g_polsarpro_classification_optionmenu_ht,
                                      lut_basename));
  GtkWidget *option_menu;
  option_menu = get_widget_checked("browse_select_colormap_optionmenu");
  gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), which);
}
开发者ID:DavinSimmons,项目名称:ASF_MapReady,代码行数:9,代码来源:asf_convert_gui.c


示例15: menu_select_cb

int
menu_select_cb(GtkMenuItem * menuitem, GtkWidget * menu)
{
    const char *label = menuitem_get_label(menuitem);

//      printf( "menuitem = %s(%p), menu = %s(%p)\n", G_OBJECT_TYPE_NAME(menuitem), menuitem, G_OBJECT_TYPE_NAME(menu), menu );

    if(label[0] == '<')
    {
        GtkWidget *selection = menu_get_first_menuitem(GTK_MENU(menu));
        gtk_widget_hide(selection);
    }
    else
    {
        char *str = g_strdup(label);

        GtkWidget *parent;

        for (;;)
        {
            GtkMenuItem *parentitem;
            const char *label2;
            char *temp;

            parent = gtk_widget_get_parent(GTK_WIDGET(menuitem));
//                      printf( "parent = %s(%p)\n", G_OBJECT_TYPE_NAME(parent), parent);
            if(menu == parent)
                break;

            parentitem = GTK_MENU_ITEM(gtk_menu_get_attach_widget(GTK_MENU(parent)));
//                      printf( "parentitem = %s(%p)\n", G_OBJECT_TYPE_NAME(parentitem), parentitem);
            label2 = menuitem_get_label(parentitem);
            if(strcmp(label2, MORE_STRING) != 0)
            {
                temp = g_strconcat(label2, "/", str, NULL);
                g_free(str);
                str = temp;
            }

            menuitem = parentitem;
        }
        {
            GtkLabel *label;

            GtkWidget *selection = menu_get_first_menuitem(GTK_MENU(menu));
            GtkOptionMenu *optionmenu = GTK_OPTION_MENU(gtk_menu_get_attach_widget(GTK_MENU(menu)));

            label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(selection)));

            gtk_label_set_text(label, str);
            gtk_widget_show(GTK_WIDGET(selection));
            gtk_option_menu_set_history(optionmenu, 0);
            g_free(str);
        }
    }
    return 0;
}
开发者ID:Javran,项目名称:purple-plugin-pack,代码行数:57,代码来源:gtktimezonetest.c


示例16: pollmultidlg_init

static void
pollmultidlg_init(PollMultiDlg *pmdlg, GtkWindow *parent) {
	GtkWidget *mainbox, *vbox, *paned;
	GtkWidget *menu, *label;

	pmdlg->dlg = gtk_dialog_new_with_buttons(_("Multi Poll Question"),
			parent, GTK_DIALOG_MODAL,
			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
			GTK_STOCK_OK, GTK_RESPONSE_OK,
			NULL);
	jam_win_set_size(GTK_WINDOW(pmdlg->dlg), 500, -1);

	mainbox = gtk_vbox_new(FALSE, 12);

	menu = gtk_menu_new();
	gtk_menu_shell_append(GTK_MENU_SHELL(menu),
		gtk_menu_item_new_with_mnemonic(_("Choose best answer (_radio buttons)")));
	gtk_menu_shell_append(GTK_MENU_SHELL(menu),
		gtk_menu_item_new_with_mnemonic(_("Choose best answer (_drop-down menu)")));
	gtk_menu_shell_append(GTK_MENU_SHELL(menu),
		gtk_menu_item_new_with_mnemonic(_("Select _all that apply (checkboxes)")));

	pmdlg->typemenu = gtk_option_menu_new();
	gtk_option_menu_set_menu(GTK_OPTION_MENU(pmdlg->typemenu), menu);
	gtk_box_pack_start(GTK_BOX(mainbox),
			labelled_box_new_expand(_("Choice _Type:"), pmdlg->typemenu, TRUE),
			FALSE, FALSE, 0);

	paned = gtk_hpaned_new();
	gtk_box_pack_start(GTK_BOX(mainbox), paned, TRUE, TRUE, 0);

	vbox = gtk_vbox_new(FALSE, 6);
	label = gtk_label_new_with_mnemonic(_("_Question:"));
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);

	pmdlg->question = gtk_text_view_new();
	gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(pmdlg->question), GTK_WRAP_WORD);
	gtk_label_set_mnemonic_widget(GTK_LABEL(label), pmdlg->question);
	gtk_box_pack_start(GTK_BOX(vbox),
			scroll_wrap(pmdlg->question),
			TRUE, TRUE, 0);

	gtk_paned_pack1(GTK_PANED(paned), vbox, TRUE, FALSE);

	vbox = gtk_vbox_new(FALSE, 6);
	pollmulti_make_list(pmdlg);
	label = gtk_label_new_with_mnemonic(_("O_ptions:"));
	gtk_label_set_mnemonic_widget(GTK_LABEL(label), pmdlg->answers.view);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), pmdlg->answers.box, TRUE, TRUE, 0);

	gtk_paned_pack2(GTK_PANED(paned), vbox, TRUE, FALSE);

	jam_dialog_set_contents(GTK_DIALOG(pmdlg->dlg), mainbox);
}
开发者ID:andy-shev,项目名称:LogJam,代码行数:57,代码来源:poll-questions.c


示例17: setup_reset_button

/*
 * setup_reset_button() - enables the reset button if any of the current
 * settings are not the default.
 */
static void setup_reset_button(CtkDitheringControls *ctk_dithering_controls)
{
    gint history;
    gint val;

    if (!GTK_WIDGET_SENSITIVE(ctk_dithering_controls->dithering_controls_box)) {
        /* Nothing is available, don't bother enabling the reset button yet. */
        return;
    }

    /* The config menu is always available */
    history = gtk_option_menu_get_history
        (GTK_OPTION_MENU(ctk_dithering_controls->dithering_config_menu));
    val = map_dithering_config_menu_idx_to_nvctrl(history);
    if (val != NV_CTRL_DITHERING_AUTO) {
        goto enable;
    }

    if (GTK_WIDGET_SENSITIVE(ctk_dithering_controls->dithering_mode_box)) {
        history = gtk_option_menu_get_history
            (GTK_OPTION_MENU(ctk_dithering_controls->dithering_mode_menu));
        val = ctk_dithering_controls->dithering_mode_table[history];
        if (val != NV_CTRL_DITHERING_MODE_AUTO) {
            goto enable;
        }
    }

    if (GTK_WIDGET_SENSITIVE(ctk_dithering_controls->dithering_depth_box)) {
        history = gtk_option_menu_get_history
            (GTK_OPTION_MENU(ctk_dithering_controls->dithering_depth_menu));
        val = map_dithering_depth_menu_idx_to_nvctrl(history);
        if (val != NV_CTRL_DITHERING_DEPTH_AUTO) {
            goto enable;
        }
    }

    /* Don't disable reset button here, since other settings that are not
     * managed by the ctk_image_slider here may need it enabled
     */
    return;

 enable:
    gtk_widget_set_sensitive(ctk_dithering_controls->reset_button, TRUE);
}
开发者ID:jethrogb,项目名称:nvidia-utils,代码行数:48,代码来源:ctkditheringcontrols.c


示例18: game_preferences_callback

static void
game_preferences_callback (GtkWidget *widget, void *data)
{
	GtkWidget *menu, *omenu, *l, *hb, *cb, *f, *fv;
	GtkWidget *button;

	if (pref_dialog)
		return;
	
	pref_dialog = gnome_dialog_new (_("Preferences"),
			GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL,
			NULL);
	gnome_dialog_set_parent (GNOME_DIALOG (pref_dialog), GTK_WINDOW (app));
	gtk_signal_connect (GTK_OBJECT(pref_dialog), "delete_event",
			    GTK_SIGNAL_FUNC (cancel), NULL);

	omenu = gtk_option_menu_new ();
	menu = gtk_menu_new ();
	fill_menu (menu);
	gtk_widget_show (omenu);
	gtk_option_menu_set_menu (GTK_OPTION_MENU(omenu), menu);

	f = gtk_frame_new (_ ("Scenario"));
	gtk_container_border_width (GTK_CONTAINER (f), 5);

	hb = gtk_hbox_new (FALSE, FALSE);
	gtk_widget_show (hb);
	
	l = gtk_label_new (_("Select scenario:"));
	gtk_widget_show (l);
	    
	gtk_box_pack_start_defaults (GTK_BOX(hb), l);
	gtk_box_pack_start_defaults (GTK_BOX(hb), omenu);

	cb = gtk_check_button_new_with_label ( _("Make it the default scenario") );
	gtk_signal_connect (GTK_OBJECT(cb), "clicked", (GtkSignalFunc)set_selection_def, NULL);
	gtk_widget_show (cb);

	fv = gtk_vbox_new (0, 5);
	gtk_container_border_width (GTK_CONTAINER (fv), 5);
	gtk_widget_show (fv);
	
	gtk_box_pack_start_defaults (GTK_BOX(fv), hb);
	gtk_box_pack_start_defaults (GTK_BOX(fv), cb);
	gtk_box_pack_start_defaults (GTK_BOX(GNOME_DIALOG(pref_dialog)->vbox), f);
	gtk_container_add (GTK_CONTAINER (f), fv);
	
	gtk_widget_show (f);
	
	gnome_dialog_button_connect (GNOME_DIALOG (pref_dialog), 0,
			GTK_SIGNAL_FUNC (load_scenario_callback), NULL);
	gnome_dialog_button_connect (GNOME_DIALOG (pref_dialog), 1,
			GTK_SIGNAL_FUNC (cancel), (gpointer)1);

        gtk_widget_show (pref_dialog);
}
开发者ID:cstrahan,项目名称:aduni,代码行数:56,代码来源:same-gnome.c


示例19: getRangeInMenu

/// 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;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:11,代码来源:toolkit.cpp


示例20: fill_in_info

static void
fill_in_info(EContactEditorIm *editor)
{
	GtkWidget *optmenu;

	fill_in_field(editor, "entry-username",  editor->username);

	optmenu = glade_xml_get_widget(editor->gui, "optmenu-service");

	if (optmenu != NULL)
		gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), editor->service - FIRST_IM_TYPE);

	optmenu = glade_xml_get_widget(editor->gui, "optmenu-location");

	if (optmenu != NULL)
		gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu),
					    (editor->location == NULL ? 2 :
					     !strcmp(editor->location, "WORK") ? 1 : 0));
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:19,代码来源:e-contact-editor-im.c



注:本文中的GTK_OPTION_MENU函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_ORIENTABLE函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_OBJECT_CLASS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap