本文整理汇总了C++中GTK_RADIO_BUTTON函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_RADIO_BUTTON函数的具体用法?C++ GTK_RADIO_BUTTON怎么用?C++ GTK_RADIO_BUTTON使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_RADIO_BUTTON函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: wxFAIL_MSG
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[], int majorDim,
long style, const wxValidator& validator,
const wxString &name )
{
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxRadioBox creation failed") );
return false;
}
m_widget = gtk_frame_new( wxGTK_CONV( title ) );
// majorDim may be 0 if all trailing parameters were omitted, so don't
// assert here but just use the correct value for it
m_majorDim = majorDim == 0 ? n : majorDim;
int num_per_major = (n - 1) / m_majorDim +1;
int num_of_cols = 0;
int num_of_rows = 0;
if (HasFlag(wxRA_SPECIFY_COLS))
{
num_of_cols = m_majorDim;
num_of_rows = num_per_major;
}
else
{
num_of_cols = num_per_major;
num_of_rows = m_majorDim;
}
GtkRadioButton *m_radio = (GtkRadioButton*) NULL;
GtkWidget *table = gtk_table_new( num_of_rows, num_of_cols, FALSE );
gtk_table_set_col_spacings( GTK_TABLE(table), 1 );
gtk_table_set_row_spacings( GTK_TABLE(table), 1 );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER(m_widget), table );
wxString label;
GSList *radio_button_group = (GSList *) NULL;
for (int i = 0; i < n; i++)
{
if ( i != 0 )
radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) );
label.Empty();
for ( const wxChar *pc = choices[i]; *pc; pc++ )
{
if ( *pc != wxT('&') )
label += *pc;
}
m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, wxGTK_CONV( label ) ) );
gtk_widget_show( GTK_WIDGET(m_radio) );
gtk_signal_connect( GTK_OBJECT(m_radio), "key_press_event",
GTK_SIGNAL_FUNC(gtk_radiobox_keypress_callback), (gpointer)this );
m_boxes.Append( (wxObject*) m_radio );
if (HasFlag(wxRA_SPECIFY_COLS))
{
int left = i%num_of_cols;
int right = (i%num_of_cols) + 1;
int top = i/num_of_cols;
int bottom = (i/num_of_cols)+1;
gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom,
GTK_FILL, GTK_FILL, 1, 1 );
}
else
{
int left = i/num_of_rows;
int right = (i/num_of_rows) + 1;
int top = i%num_of_rows;
int bottom = (i%num_of_rows)+1;
gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom,
GTK_FILL, GTK_FILL, 1, 1 );
}
ConnectWidget( GTK_WIDGET(m_radio) );
if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE );
gtk_signal_connect( GTK_OBJECT(m_radio), "clicked",
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
gtk_signal_connect( GTK_OBJECT(m_radio), "focus_in_event",
GTK_SIGNAL_FUNC(gtk_radiobutton_focus_in), (gpointer)this );
gtk_signal_connect( GTK_OBJECT(m_radio), "focus_out_event",
GTK_SIGNAL_FUNC(gtk_radiobutton_focus_out), (gpointer)this );
}
m_parent->DoAddChild( this );
SetLabel( title );
//.........这里部分代码省略.........
开发者ID:HackLinux,项目名称:chandler-1,代码行数:101,代码来源:radiobox.cpp
示例2: setPageLayout
//This function returns a table containing the elements of the page arranged
GtkWidget * setPageLayout(GtkWidget* window, GtkWidget* browserForm){
GtkWidget * tableInitialing;
GtkWidget *image;
GtkWidget * mainSearchBox, *miniSearchBox, *centerSearchBox;
GtkWidget *searchMainBut, *searchMiniBut, *searchCenterBut, *exitButton , *goBackBut, *stopBut, *frontBut;
GtkWidget *scrolledWindow;
GtkWidget *webView;
GtkWidget *pageLayoutExpander;
webView = webkit_web_view_new();
pageLayoutExpander = gtk_expander_new_with_mnemonic("V_iew page");
//creates a table with 20 rows and 17 columns
tableInitialing = gtk_table_new( 30, 17, TRUE);
exitButton = gtk_button_new_with_mnemonic("E_xit One click browser");
g_signal_connect_swapped( G_OBJECT(exitButton), "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer) window);
gtk_table_attach_defaults( GTK_TABLE(tableInitialing), exitButton, 0, 17, 29,30);
//Start of expander setting
//declaration of variables involved in setting position of tabs
GtkWidget *settingExpander, *expanderVBox;
GtkWidget *setTapUpRadio, *setTapDownRadio, *clearHistoryBut, *viewHistoryBut;
GtkWidget *facebookLogo, *twitterLogo, *gmailLogo, *skypeLogo, *googleLogo;
GtkWidget *facebookEventBox, *twitterEventBox, *gmailEventBox, *skypeEventBox, *googleEventBox;
//Initialising variables
setTapUpRadio = gtk_radio_button_new_with_label(NULL,"Set tab position up");
setTapDownRadio = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(setTapUpRadio), "Set tab position down");
//Initialises the clearHistoryBut and associate a callback to it
clearHistoryBut = gtk_button_new_with_mnemonic("_Clear history");
g_signal_connect(G_OBJECT(clearHistoryBut), "clicked", G_CALLBACK(clearHistory), NULL);
viewHistoryBut = gtk_button_new_with_mnemonic("_View history");
g_signal_connect_swapped(G_OBJECT(viewHistoryBut),"clicked", G_CALLBACK(viewHistory), NULL);
//Initialises the expander and the vbox
settingExpander = gtk_expander_new_with_mnemonic("_Settings");
expanderVBox = gtk_vbox_new(TRUE, 0);
//Adds radio buttons to the vbox
gtk_box_pack_start_defaults( GTK_BOX(expanderVBox), setTapUpRadio);
gtk_box_pack_start_defaults( GTK_BOX(expanderVBox), setTapDownRadio);
gtk_box_pack_start_defaults( GTK_BOX(expanderVBox), clearHistoryBut);
gtk_box_pack_start_defaults( GTK_BOX(expanderVBox), viewHistoryBut);
//Linking signals of radio buttons to the respective callbacks
g_signal_connect_swapped( G_OBJECT(setTapUpRadio), "toggled", G_CALLBACK(setTapUp), browserForm);
g_signal_connect_swapped( G_OBJECT(setTapDownRadio), "toggled", G_CALLBACK(setTapDown), browserForm);
gtk_container_add( GTK_CONTAINER(settingExpander), expanderVBox);
gtk_table_attach_defaults( GTK_TABLE(tableInitialing),settingExpander, 0,3,20,24);
//End of expander setting
goBackBut = gtk_button_new_with_label(" <-- ");
gtk_widget_set_size_request(goBackBut, 10, 25);
gtk_table_attach_defaults( GTK_TABLE(tableInitialing), goBackBut, 1, 2, 1, 2);
g_signal_connect_swapped(goBackBut, "clicked", G_CALLBACK(back), webView);
stopBut = gtk_button_new_with_label(" X ");
gtk_widget_set_size_request(stopBut, 10, 25);
gtk_table_attach_defaults( GTK_TABLE(tableInitialing), stopBut, 2, 3, 1, 2);
g_signal_connect_swapped(stopBut, "clicked", G_CALLBACK(stop), webView);
frontBut = gtk_button_new_with_label(" --> ");
gtk_widget_set_size_request(frontBut, 10, 25);
gtk_table_attach_defaults( GTK_TABLE(tableInitialing), frontBut, 16, 17, 1, 2);
g_signal_connect_swapped(frontBut, "clicked", G_CALLBACK(forward), webView);
//This patch of code initiates autocompletion of the search box
GtkEntryCompletion *completion;
GtkTreeIter *iter;
GtkListStore *store_list;
FILE * historyPtr;
store_list = gtk_list_store_new(1,G_TYPE_STRING);
completion = gtk_entry_completion_new();
if( (historyPtr = fopen("History/History.htm","r+")) == NULL)
g_print("Error");
gchar historyString[100];
while( !feof(historyPtr)){
fscanf(historyPtr,"%s",historyString);
gtk_list_store_append(store_list, iter);
gtk_list_store_set(store_list, iter, 0, historyString, -1);
}
fclose(historyPtr);
gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store_list));
gtk_entry_completion_set_text_column(completion, 0);
mainSearchBox = gtk_entry_new();
//.........这里部分代码省略.........
开发者ID:Agobin,项目名称:Gtk_browser,代码行数:101,代码来源:browser.c
示例3: build_properties_area
static GtkWidget * build_properties_area(WBPlugin *wb, const gchar *buffer, gsize length) {
GError *error = NULL;
GObject *area = NULL;
GtkRadioButton *only_maximized, *active_window;
GtkToggleButton *show_on_desktop, *sync_wm_theme;
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
GtkListStore *list_store;
GtkWidget *view, *theme_name_treeview;
GtkEntry *button_layout;
wb->prefs->builder = gtk_builder_new();
if (gtk_builder_add_from_string(wb->prefs->builder, buffer, length, &error)) {
area = gtk_builder_get_object(wb->prefs->builder, "alignment0");
if (G_LIKELY (area != NULL))
{
only_maximized = GTK_RADIO_BUTTON(gtk_builder_get_object(wb->prefs->builder, "only_maximized"));
active_window = GTK_RADIO_BUTTON(gtk_builder_get_object(wb->prefs->builder, "active_window"));
if (G_LIKELY (only_maximized != NULL))
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(only_maximized), wb->prefs->only_maximized);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(active_window), !wb->prefs->only_maximized);
g_signal_connect(only_maximized, "toggled", G_CALLBACK(on_only_maximized_toggled), wb);
}
else {
DBG("No widget with the name \"only_maximized\" found");
}
show_on_desktop = GTK_TOGGLE_BUTTON(gtk_builder_get_object(wb->prefs->builder, "show_on_desktop"));
if (G_LIKELY (show_on_desktop != NULL)) {
gtk_toggle_button_set_active(show_on_desktop, wb->prefs->show_on_desktop);
g_signal_connect(show_on_desktop, "toggled", G_CALLBACK(on_show_on_desktop_toggled), wb);
}
else {
DBG("No widget with the name \"show_on_desktop\" found");
}
/* Style widgets */
theme_name_treeview = GTK_WIDGET (gtk_builder_get_object (wb->prefs->builder, "theme_name_treeview"));
/* theme name */
{
list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (list_store), COL_THEME_NAME,
(GtkTreeIterCompareFunc) wckbuttons_theme_sort_func,
NULL, NULL);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list_store), COL_THEME_NAME, GTK_SORT_ASCENDING);
gtk_tree_view_set_model (GTK_TREE_VIEW (theme_name_treeview), GTK_TREE_MODEL (list_store));
g_object_unref (G_OBJECT (list_store));
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (theme_name_treeview),
0, _("Directory"), renderer, "text", 1, NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (theme_name_treeview),
0, _("Themes usable"), renderer, "text", 0, NULL);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_name_treeview));
g_signal_connect (selection, "changed", G_CALLBACK (wckbuttons_theme_selection_changed),
wb);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
view = GTK_WIDGET (gtk_builder_get_object (wb->prefs->builder, "theme_name_treeview"));
wckbuttons_load_themes (view, wb);
}
sync_wm_theme = GTK_TOGGLE_BUTTON(gtk_builder_get_object(wb->prefs->builder, "sync_wm_theme"));
if (G_LIKELY (sync_wm_theme != NULL))
{
if (wb->wm_channel)
{
gtk_toggle_button_set_active(sync_wm_theme, wb->prefs->sync_wm_theme);
g_signal_connect(sync_wm_theme, "toggled", G_CALLBACK(on_sync_theme_with_wm_toggled), wb);
}
else {
gtk_widget_set_sensitive (GTK_WIDGET(sync_wm_theme), FALSE);
}
}
else {
DBG("No widget with the name \"sync_wm_theme\" found");
}
button_layout = GTK_ENTRY(gtk_builder_get_object(wb->prefs->builder, "button_layout"));
if (G_LIKELY (button_layout != NULL))
{
gtk_entry_set_text(button_layout, wb->prefs->button_layout);
g_signal_connect(GTK_EDITABLE(button_layout), "changed", G_CALLBACK(on_button_layout_changed), wb);
}
else {
DBG("No widget with the name \"button_layout\" found");
}
return GTK_WIDGET(area) ;
}
else {
g_set_error_literal(&error, 0, 0, "No widget with the name \"contentarea\" found");
//.........这里部分代码省略.........
开发者ID:tr33m4n,项目名称:xfce4-windowck-plugin,代码行数:101,代码来源:wckbuttons-dialogs.c
示例4: grg_pref_dialog
void
grg_pref_dialog (GtkWidget * parent)
{
GtkWidget *prefs, *notebook, *tab1, *tab2, *tab3;
GtkWidget *frame1, *frame2, *frame3;
GtkWidget *crypt_box, *hash_box, *comp_box;
GtkWidget *frame_font;
GtkWidget *frame_file, *but_file, *box_file, *but_file_clear;
GtkWidget *frame_save, *box_save;
GtkWidget *frame_misc, *box_misc;
GtkWidget *frame_xpire, *box_xpire, *xpire_lbl;
GtkWidget *frame_passes, *box_passes, *lbl_passes;
GtkWidget *frame_clip, *box_clip;
gint response;
PangoFontDescription *fdesc;
if (active_flag)
return;
prefs = gtk_dialog_new_with_buttons (_("Preferences"),
GTK_WINDOW (parent),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GTK_STOCK_APPLY,
GTK_RESPONSE_APPLY,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, NULL);
//first page: algorithms
tab1 = gtk_table_new (3, 2, FALSE);
frame1 = gtk_frame_new (_("Encryption"));
gtk_table_attach_defaults (GTK_TABLE (tab1), frame1, 0, 1, 0, 3);
crypt_box = gtk_vbox_new (FALSE, GRG_PAD);
gtk_container_add (GTK_CONTAINER (frame1), crypt_box);
NEW_RADIO_BUTTON (rij1_but, NULL, modify_crypto, GRG_AES,
"AES (Rijndael 128)", crypt_box);
NEW_RADIO_BUTTON (ser_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_SERPENT, "Serpent", crypt_box);
NEW_RADIO_BUTTON (twof_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_TWOFISH, "Twofish", crypt_box);
NEW_RADIO_BUTTON (cast_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_CAST_256, "Cast 256", crypt_box);
NEW_RADIO_BUTTON (safer_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_SAFERPLUS, "Safer+", crypt_box);
NEW_RADIO_BUTTON (loki_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_LOKI97, "Loki97", crypt_box);
NEW_RADIO_BUTTON (tdes_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_3DES, "3-DES", crypt_box);
NEW_RADIO_BUTTON (rij2_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(rij1_but)),
modify_crypto, GRG_RIJNDAEL_256, "Rijndael 256",
crypt_box);
NEW_ROW_SEPARATOR (crypt_box);
NEW_LABEL (crypto_block_lbl, crypt_box, "");
NEW_LABEL (crypto_key_lbl, crypt_box, "");
update_crypto_label ();
frame2 = gtk_frame_new (_("Hashing"));
gtk_table_attach_defaults (GTK_TABLE (tab1), frame2, 1, 2, 0, 1);
hash_box = gtk_vbox_new (FALSE, GRG_PAD);
gtk_container_add (GTK_CONTAINER (frame2), hash_box);
NEW_RADIO_BUTTON (sha_but, NULL, modify_hash, GRG_SHA1, "SHA1",
hash_box);
NEW_RADIO_BUTTON (ripe_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(sha_but)), modify_hash,
GRG_RIPEMD_160, "RIPEMD 160", hash_box);
frame3 = gtk_frame_new (_("Compression"));
gtk_table_attach_defaults (GTK_TABLE (tab1), frame3, 1, 2, 1, 2);
comp_box = gtk_vbox_new (FALSE, GRG_PAD);
gtk_container_add (GTK_CONTAINER (frame3), comp_box);
NEW_RADIO_BUTTON (zlib_but, NULL, modify_comp, GRG_ZLIB, "ZLib",
comp_box);
NEW_RADIO_BUTTON (bz_but,
gtk_radio_button_get_group (GTK_RADIO_BUTTON
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:gringotts-svn,代码行数:101,代码来源:grg_prefs.c
示例5: xpad_preferences_init
static void
xpad_preferences_init (XpadPreferences *pref)
{
GtkWidget *hbox, *font_hbox, *vbox;
const GdkColor *color;
const gchar *fontname;
GtkStyle *style;
GtkWidget *label, *appearance_frame, *alignment, *appearance_vbox;
GtkWidget *options_frame, *options_vbox, *global_vbox;
gchar *text;
GtkSizeGroup *size_group_labels = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
GtkRequisition req;
pref->priv = XPAD_PREFERENCES_GET_PRIVATE (pref);
text = g_strconcat ("<b>", _("Appearance"), "</b>", NULL);
label = GTK_WIDGET (g_object_new (GTK_TYPE_LABEL,
"label", text,
"use-markup", TRUE,
"xalign", 0.0,
NULL));
g_free (text);
appearance_vbox = GTK_WIDGET (g_object_new (GTK_TYPE_VBOX,
"homogeneous", FALSE,
"spacing", 18,
NULL));
alignment = gtk_alignment_new (1, 1, 1, 1);
g_object_set (G_OBJECT (alignment),
"left-padding", 12,
"top-padding", 12,
"child", appearance_vbox,
NULL);
appearance_frame = GTK_WIDGET (g_object_new (GTK_TYPE_FRAME,
"label-widget", label,
"shadow-type", GTK_SHADOW_NONE,
"child", alignment,
NULL));
pref->priv->textbutton = gtk_color_button_new ();
pref->priv->backbutton = gtk_color_button_new ();
pref->priv->fontbutton = gtk_font_button_new ();
pref->priv->antifontcheck = gtk_radio_button_new_with_mnemonic (NULL, _("Use font from theme"));
pref->priv->fontcheck = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (pref->priv->antifontcheck), _("Use this font:"));
pref->priv->anticolorcheck = gtk_radio_button_new_with_mnemonic (NULL, _("Use colors from theme"));
pref->priv->colorcheck = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (pref->priv->anticolorcheck), _("Use these colors:"));
font_hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (font_hbox), pref->priv->fontcheck, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (font_hbox), pref->priv->fontbutton, TRUE, TRUE, 0);
pref->priv->colorbox = gtk_vbox_new (FALSE, 6);
hbox = gtk_hbox_new (FALSE, 12);
label = gtk_label_new_with_mnemonic (_("Background:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_size_group_add_widget (size_group_labels, label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), pref->priv->backbutton, TRUE, TRUE, 0);
g_object_set (G_OBJECT (pref->priv->colorbox), "child", hbox, NULL);
hbox = gtk_hbox_new (FALSE, 12);
label = gtk_label_new_with_mnemonic (_("Foreground:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_size_group_add_widget (size_group_labels, label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), pref->priv->textbutton, TRUE, TRUE, 0);
g_object_set (G_OBJECT (pref->priv->colorbox), "child", hbox, NULL);
alignment = gtk_alignment_new (1, 1, 1, 1);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (alignment), pref->priv->colorbox);
pref->priv->editcheck = gtk_check_button_new_with_mnemonic (_("_Edit lock"));
pref->priv->stickycheck = gtk_check_button_new_with_mnemonic (_("_Pads start on all workspaces"));
pref->priv->confirmcheck = gtk_check_button_new_with_mnemonic (_("_Confirm pad deletion"));
gtk_dialog_add_button (GTK_DIALOG (pref), "gtk-close", GTK_RESPONSE_CLOSE);
gtk_dialog_set_default_response (GTK_DIALOG (pref), GTK_RESPONSE_CLOSE);
gtk_dialog_set_has_separator (GTK_DIALOG (pref), FALSE);
g_signal_connect (pref, "response", G_CALLBACK (xpad_preferences_response), NULL);
gtk_window_set_title (GTK_WINDOW (pref), _("Xpad Preferences"));
gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (pref->priv->textbutton), FALSE);
gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (pref->priv->backbutton), xpad_app_get_translucent ());
gtk_color_button_set_title (GTK_COLOR_BUTTON (pref->priv->textbutton), _("Set Foreground Color"));
gtk_color_button_set_title (GTK_COLOR_BUTTON (pref->priv->backbutton), _("Set Background Color"));
gtk_font_button_set_title (GTK_FONT_BUTTON (pref->priv->fontbutton), _("Set Font"));
/* Set current state */
style = gtk_widget_get_default_style ();
color = xpad_settings_get_back_color (xpad_settings ());
if (color)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref->priv->colorcheck), TRUE);
gtk_color_button_set_color (GTK_COLOR_BUTTON (pref->priv->backbutton), color);
}
else
{
//.........这里部分代码省略.........
开发者ID:abhinandh,项目名称:xpad,代码行数:101,代码来源:xpad-preferences.c
示例6: create_configure_dialog
//.........这里部分代码省略.........
/* calculated cpu clock */
realclock_label = gtk_label_new("MHz");
gtk_widget_show(realclock_label);
gtk_box_pack_start(GTK_BOX(cpuframe_vbox), realclock_label, FALSE, FALSE, 2);
gtk_misc_set_alignment(GTK_MISC(realclock_label), 1.0, 0.5);
g_signal_connect(GTK_OBJECT(baseclock_entry), "changed",
G_CALLBACK(clock_changed), (gpointer)realclock_label);
g_signal_connect(GTK_OBJECT(clockmult_entry), "changed",
G_CALLBACK(clock_changed), (gpointer)realclock_label);
clock_changed(NULL, realclock_label);
/* OK, Cancel button base widget */
confirm_widget = gtk_vbutton_box_new();
gtk_widget_show(confirm_widget);
gtk_box_pack_start(GTK_BOX(cpu_hbox), confirm_widget, TRUE, TRUE, 0);
gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_widget), GTK_BUTTONBOX_END);
//gtk_button_box_set_spacing(GTK_BUTTON_BOX(confirm_widget), 0);
/*
* Architecture frame
*/
arch_frame = gtk_frame_new("Architecture");
gtk_widget_show(arch_frame);
gtk_box_pack_start(GTK_BOX(main_widget), arch_frame, TRUE, TRUE, 0);
/* architecture */
arch_hbox = gtk_hbox_new(TRUE, 0);
gtk_widget_show(arch_hbox);
gtk_container_add(GTK_CONTAINER(arch_frame), arch_hbox);
for (i = 0; i < NELEMENTS(architecture); i++) {
arch_radiobutton[i] = gtk_radio_button_new_with_label_from_widget(i > 0 ? GTK_RADIO_BUTTON(arch_radiobutton[i-1]) : NULL, architecture[i].label);
gtk_widget_show(arch_radiobutton[i]);
gtk_box_pack_start(GTK_BOX(arch_hbox), arch_radiobutton[i], FALSE, FALSE, 0);
#if GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18)
gtk_widget_set_can_focus(arch_radiobutton[i], FALSE);
#else
GTK_WIDGET_UNSET_FLAGS(rate_radiobutton[i], GTK_CAN_FOCUS);
#endif
g_signal_connect(GTK_OBJECT(arch_radiobutton[i]), "clicked",
G_CALLBACK(arch_radiobutton_clicked), (gpointer)architecture[i].arch);
}
for (i = 0; i < NELEMENTS(architecture); i++) {
if (strcmp(np2cfg.model, architecture[i].arch) == 0) {
break;
}
}
if (i == NELEMENTS(architecture)) {
i = 1;
milstr_ncpy(np2cfg.model, "VX", sizeof(np2cfg.model));
sysmng_update(SYS_UPDATECFG);
}
g_signal_emit_by_name(GTK_OBJECT(arch_radiobutton[i]), "clicked");
/*
* Sound frame
*/
sound_frame = gtk_frame_new("Sound");
gtk_widget_show(sound_frame);
gtk_box_pack_start(GTK_BOX(main_widget), sound_frame, TRUE, TRUE, 0);
soundframe_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(soundframe_vbox), 5);
gtk_widget_show(soundframe_vbox);
开发者ID:aliaspider,项目名称:np2,代码行数:67,代码来源:dialog_config.c
示例7: do_form_model_change
GtkWidget *
do_form_model_change (GtkWidget *do_widget)
{
if (!window) {
GdaStatement *stmt;
GtkWidget *vbox;
GtkWidget *label;
GdaDataModel *models [3];
window = gtk_dialog_new_with_buttons ("Changing data in a GdauiForm",
GTK_WINDOW (do_widget),
0,
"Close", GTK_RESPONSE_NONE,
NULL);
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The data in the same GdauiForm widget can be change don the fly.");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
/* creating data models */
stmt = gda_sql_parser_parse_string (demo_parser, "SELECT * FROM products ORDER BY ref, category LIMIT 15", NULL, NULL);
models[0] = gda_connection_statement_execute_select (demo_cnc, stmt, NULL, NULL);
gda_data_select_compute_modification_statements (GDA_DATA_SELECT (models[0]), NULL);
g_object_unref (stmt);
stmt = gda_sql_parser_parse_string (demo_parser, "SELECT * FROM products WHERE price > 20.2 ORDER BY ref, category LIMIT 10", NULL, NULL);
models[1] = gda_connection_statement_execute_select (demo_cnc, stmt, NULL, NULL);
gda_data_select_compute_modification_statements (GDA_DATA_SELECT (models[1]), NULL);
g_object_unref (stmt);
stmt = gda_sql_parser_parse_string (demo_parser, "SELECT name, price, ref, category FROM products WHERE price > 20.2 ORDER BY name LIMIT 30", NULL, NULL);
models[2] = gda_connection_statement_execute_select (demo_cnc, stmt, NULL, NULL);
gda_data_select_compute_modification_statements (GDA_DATA_SELECT (models[2]), NULL);
g_object_unref (stmt);
/* allow choosing which data model to display */
label = gtk_label_new ("");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_label_set_markup (GTK_LABEL (label), "<b>Choose which data model to display:</b>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
GtkWidget *layout, *rb;
GSList *group = NULL;
gint i;
layout = gtk_grid_new ();
gtk_box_pack_start (GTK_BOX (vbox), layout, FALSE, FALSE, 0);
for (i = 0; i < 3; i++) {
gchar *str;
str = g_strdup_printf ("%d columns x %d rows", gda_data_model_get_n_columns (models[i]),
gda_data_model_get_n_rows (models[i]));
rb = gtk_radio_button_new_with_label (group, str);
g_free (str);
gtk_grid_attach (GTK_GRID (layout), rb, i, 0, 1, 1);
g_signal_connect (rb, "toggled", G_CALLBACK (model_toggled_cb), models[i]);
g_object_set_data_full (G_OBJECT (rb), "model", models[i], g_object_unref);
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rb));
}
/* Create the form widget */
label = gtk_label_new ("");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_label_set_markup (GTK_LABEL (label), "<b>GdauiForm:</b>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
form = gdaui_form_new (models[0]);
g_object_set (G_OBJECT (form), "info-flags",
GDAUI_DATA_PROXY_INFO_CURRENT_ROW |
GDAUI_DATA_PROXY_INFO_ROW_MOVE_BUTTONS |
GDAUI_DATA_PROXY_INFO_ROW_MODIFY_BUTTONS, NULL);
gtk_box_pack_start (GTK_BOX (vbox), form, TRUE, TRUE, 0);
GdaDataProxy *proxy;
proxy = gdaui_data_proxy_get_proxy (GDAUI_DATA_PROXY (form));
g_object_set (proxy, "cache-changes", TRUE, NULL);
}
gboolean visible;
g_object_get (G_OBJECT (window), "visible", &visible, NULL);
if (!visible)
gtk_widget_show_all (window);
else {
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
开发者ID:arthurnn,项目名称:libgda,代码行数:98,代码来源:form_model_change.c
示例8: settings_show
void
settings_show (GtkWidget *widget, SchematicView *sv)
{
gint i;
GtkWidget *engine_group = NULL;
GtkWidget *w, *pbox, *toplevel;
GtkBuilder *gui;
GError *perror = NULL;
gchar *msg;
Settings *s;
Schematic *sm;
g_return_if_fail (sv != NULL);
// If no engine available, stop oregano
if ((g_find_program_in_path (engine[0]) == NULL) &&
(g_find_program_in_path (engine[1]) == NULL)) {
gchar *msg;
msg = g_strdup_printf (
_("No engine allowing analysis is available.\n"
"You might install one, at least! \n"
"Either ngspice or gnucap."));
oregano_error_with_title (_("Could not create settings dialog"), msg);
g_free (msg);
return;
}
g_return_if_fail (sv != NULL);
if ((gui = gtk_builder_new ()) == NULL) {
oregano_error (_("Could not create settings dialog"));
return;
}
gtk_builder_set_translation_domain (gui, NULL);
sm = schematic_view_get_schematic (sv);
s = schematic_get_settings (sm);
// Only allow one instance of the property box per schematic.
if (GTK_WIDGET (SETTINGS (s)->pbox)) {
gdk_window_raise (gtk_widget_get_window (
GTK_WIDGET (SETTINGS (s)->pbox)));
return;
}
if (gtk_builder_add_from_file (gui, OREGANO_UIDIR "/settings.ui", &perror) <= 0) {
msg = perror->message;
oregano_error_with_title (_("Could not create settings dialog"), msg);
g_error_free (perror);
return;
}
w = toplevel = GTK_WIDGET (gtk_builder_get_object (gui, "toplevel"));
if (!w) {
oregano_error (_("Could not create settings dialog"));
return;
}
g_signal_connect (G_OBJECT (w), "delete_event",
G_CALLBACK (delete_event_callback), s);
pbox = toplevel;
s->pbox = GTK_WIDGET (pbox);
w = GTK_WIDGET (gtk_builder_get_object (gui, "close_bt"));
g_signal_connect (G_OBJECT (w), "clicked",
G_CALLBACK (apply_callback), s);
w = GTK_WIDGET (gtk_builder_get_object (gui, "splash-enable"));
s->w_show_splash = w;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), oregano.show_splash);
w = GTK_WIDGET (gtk_builder_get_object (gui, "compress-enable"));
s->w_compress_files = w;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
oregano.compress_files);
w = GTK_WIDGET (gtk_builder_get_object (gui, "log-enable"));
s->w_show_log = w;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), oregano.show_log);
w = GTK_WIDGET (gtk_builder_get_object (gui, "grid-size"));
gtk_widget_set_sensitive (w, FALSE);
w = GTK_WIDGET (gtk_builder_get_object (gui, "realtime-enable"));
gtk_widget_set_sensitive (w, FALSE);
w = GTK_WIDGET (gtk_builder_get_object (gui, "engine_table"));
for (i = 0; i < OREGANO_ENGINE_COUNT; i++) {
if (engine_group)
button[i] = gtk_radio_button_new_with_label_from_widget (
GTK_RADIO_BUTTON (engine_group), engine[i]);
else
button[i] = engine_group =
gtk_radio_button_new_with_label_from_widget (NULL, engine[i]);
g_object_set_data (G_OBJECT (button[i]), "id", GUINT_TO_POINTER (i));
gtk_grid_attach (GTK_GRID (w), button[i], 0, i, 1, 1);
g_signal_connect (G_OBJECT (button[i]), "clicked",
G_CALLBACK (set_engine_name), s);
}
//.........这里部分代码省略.........
开发者ID:dionysos-sf,项目名称:oregano,代码行数:101,代码来源:settings.c
示例9: gtk_window_set_keep_above
//*********************************************************************************
void guiControl::guiControl(void *button, void* data)
{
if (pos_winPid != NULL)
{
gtk_window_set_keep_above (GTK_WINDOW(pos_winPid),true);
return;
}
gtkClassData* currentClassData = (gtkClassData*) data;
partMover *currentPart = currentClassData->partPointer;
joint = currentClassData->indexPointer;
icntrl2 = currentPart->get_IControlMode2();
iinteract = currentPart->get_IInteractionMode();
ipid = currentPart->get_IPidControl();
iamp = currentPart->get_IAmplifierControl();
bool ret = true;
int control_mode=VOCAB_CM_UNKNOWN;
yarp::dev::InteractionModeEnum interaction_mode=VOCAB_IM_UNKNOWN;
ret &= icntrl2->getControlMode(*joint, &control_mode);
ret &= iinteract->getInteractionMode(*joint, &interaction_mode);
if (control_mode==VOCAB_CM_HW_FAULT)
{
printf("WARNING: you cannot change control mode of a joint in HARDWARE FAULT\n");
return;
}
//GtkWidget *winPid = NULL;
GtkWidget *inv = NULL;
//adding a popup window
pos_winPid = gtk_window_new (GTK_WINDOW_TOPLEVEL);
char title[255];
sprintf(title,"Control mode JNT:%d",*joint);
gtk_window_set_title (GTK_WINDOW (pos_winPid), title);
//adding a set of display
inv = gtk_fixed_new ();
gtk_container_add (GTK_CONTAINER (pos_winPid), inv);
label_title = gtk_label_new (title);
sprintf(title,"Interaction mode JNT:%d",*joint);
label_title2 = gtk_label_new (title);
radiobutton_mode_idl = gtk_radio_button_new_with_label (NULL, "idle");
radiobutton_mode_pos = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "position");
radiobutton_mode_vel = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "velocity");
radiobutton_mode_trq = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "torque");
radiobutton_mode_imp_pos = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "impedance position");
radiobutton_mode_imp_vel = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "impedance velocity");
radiobutton_mode_open = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "openloop");
radiobutton_mode_pos_direct = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "position direct");
radiobutton_mode_mixed = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_mode_idl), "mixed");
radiobutton_interaction_stiff = gtk_radio_button_new_with_label (NULL, "stiff mode");
radiobutton_interaction_compl = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radiobutton_interaction_stiff), "compliant mode");
gtk_fixed_put (GTK_FIXED(inv), label_title, 10, 10 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_idl, 10, 30 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_pos, 10, 50 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_pos_direct, 10, 70 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_mixed, 10, 90 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_vel, 10, 110 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_trq, 10, 130 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_imp_pos, 10, 150 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_imp_vel, 10, 170 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_mode_open, 10, 190 );
gtk_fixed_put (GTK_FIXED(inv), label_title2, 10, 210 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_interaction_stiff,10, 230 );
gtk_fixed_put (GTK_FIXED(inv), radiobutton_interaction_compl,10, 250 );
update_menu(control_mode, interaction_mode);
gtk_widget_set_sensitive (GTK_WIDGET(radiobutton_mode_pos_direct), position_direct_enabled);
gtk_widget_set_sensitive (GTK_WIDGET(radiobutton_mode_open), openloop_enabled);
gtk_widget_set_sensitive (GTK_WIDGET(radiobutton_mode_imp_pos), old_impedance_enabled);
gtk_widget_set_sensitive (GTK_WIDGET(radiobutton_mode_imp_vel), old_impedance_enabled);
//Rememeber: these signal_connect MUST be placed after the update_menu!
g_signal_connect (radiobutton_mode_idl, "clicked",G_CALLBACK (radio_click_idl), &radiobutton_mode_idl);
g_signal_connect (radiobutton_mode_pos, "clicked",G_CALLBACK (radio_click_pos), &radiobutton_mode_pos);
g_signal_connect (radiobutton_mode_pos_direct, "clicked",G_CALLBACK (radio_click_pos_direct), &radiobutton_mode_pos_direct);
g_signal_connect (radiobutton_mode_mixed, "clicked",G_CALLBACK (radio_click_mode_mixed), &radiobutton_mode_mixed);
g_signal_connect (radiobutton_mode_vel, "clicked",G_CALLBACK (radio_click_vel), &radiobutton_mode_vel);
g_signal_connect (radiobutton_mode_trq, "clicked",G_CALLBACK (radio_click_trq), &radiobutton_mode_trq);
g_signal_connect (radiobutton_mode_imp_pos, "clicked",G_CALLBACK (radio_click_imp_pos), &radiobutton_mode_imp_pos);
g_signal_connect (radiobutton_mode_imp_vel, "clicked",G_CALLBACK (radio_click_imp_vel), &radiobutton_mode_imp_vel);
g_signal_connect (radiobutton_mode_open, "clicked",G_CALLBACK (radio_click_open), &radiobutton_mode_open);
g_signal_connect (radiobutton_interaction_stiff, "clicked",G_CALLBACK (radio_click_stiff), &radiobutton_interaction_stiff);
g_signal_connect (radiobutton_interaction_compl, "clicked",G_CALLBACK (radio_click_compl), &radiobutton_interaction_compl);
g_signal_connect (radiobutton_mode_idl, "key_press_event", G_CALLBACK (on_key_press), &radiobutton_mode_idl);
g_signal_connect (radiobutton_mode_pos, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_pos);
g_signal_connect (radiobutton_mode_pos_direct, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_pos_direct);
g_signal_connect (radiobutton_mode_mixed, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_mixed);
g_signal_connect (radiobutton_mode_vel, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_vel);
g_signal_connect (radiobutton_mode_trq, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_trq);
g_signal_connect (radiobutton_mode_imp_pos, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_imp_pos);
g_signal_connect (radiobutton_mode_imp_vel, "key_press_event",G_CALLBACK (on_key_press), &radiobutton_mode_imp_vel);
//.........这里部分代码省略.........
开发者ID:Karma-Revolution,项目名称:yarp,代码行数:101,代码来源:guicontrol.cpp
示例10: iceb_l_sklad_v
int iceb_l_sklad_v(class iceb_u_str *sklad_k,GtkWidget *wpredok)
{
char strsql[512];
iceb_u_str kikz;
class iceb_l_sklad_v data;
data.sklad_i.new_plus(sklad_k->ravno());
data.rk.clear_zero();
if(data.sklad_i.getdlinna() > 1)
{
data.rk.kod.new_plus(data.sklad_i.ravno());
sprintf(strsql,"select * from Sklad where kod=%s",data.sklad_i.ravno());
SQL_str row;
SQLCURSOR cur;
if(sql_readkey(&bd,strsql,&row,&cur) < 1)
{
iceb_menu_soob(gettext("Не найдена запись для корректировки !"),wpredok);
return(1);
}
data.rk.fmol.new_plus(row[2]);
data.rk.dolg.new_plus(row[3]);
data.rk.naim.new_plus(row[1]);
kikz.plus(iceb_kikz(row[4],row[5],wpredok));
data.rk.metka_isp_skl=atoi(row[6]);
}
else
{
sprintf(strsql,"%d",iceb_get_new_kod("Sklad",0,wpredok));
// printf("%s\n",strsql);
data.rk.kod.new_plus(strsql);
}
data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);
GtkWidget *label=NULL;
if(data.sklad_i.getdlinna() <= 1)
{
sprintf(strsql,"%s %s",name_system,gettext("Ввод новой записи"));
label=gtk_label_new(gettext("Ввод новой записи"));
}
else
{
sprintf(strsql,"%s %s",name_system,gettext("Корректировка записи"));
iceb_u_str repl;
repl.plus(gettext("Корректировка записи"));
repl.ps_plus(kikz.ravno());
label=gtk_label_new(repl.ravno_toutf());
}
gtk_window_set_title(GTK_WINDOW(data.window),strsql);
gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),&data.window);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(sklad_v_key_press),&data);
if(wpredok != NULL)
{
gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
//Удерживать окно над породившем его окном всегда
gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
//Закрыть окно если окно предок удалено
gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
}
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);
for(int i=0; i < KOLENTER; i++)
gtk_box_pack_start (GTK_BOX (vbox),hbox[i], TRUE, TRUE, 2);
// gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);
GtkWidget *separator1=gtk_hseparator_new();
GtkWidget *separator3=gtk_hseparator_new();
gtk_box_pack_start (GTK_BOX (vbox),separator1, TRUE, TRUE, 2);
//Вставляем радиокнопки
data.radiobutton2[0]=gtk_radio_button_new_with_label_from_widget(NULL,gettext("Используется"));
data.radiobutton2[1]=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(data.radiobutton2[0]),gettext("Неиспользуется"));
gtk_box_pack_start (GTK_BOX (vbox), data.radiobutton2[0], TRUE, TRUE, 1);
gtk_box_pack_start (GTK_BOX (vbox), data.radiobutton2[1], TRUE, TRUE, 1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data.radiobutton2[data.rk.metka_isp_skl]),TRUE); //Устанавливем активной кнопку
gtk_box_pack_start (GTK_BOX (vbox),separator3, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (vbox),hboxknop, TRUE, TRUE, 2);
//gtk_container_add (GTK_CONTAINER (vbox), hboxknop);
//.........这里部分代码省略.........
开发者ID:zaharchuktv,项目名称:linuxbuh,代码行数:101,代码来源:iceb_l_sklad_v.c
示例11: fprintf
GtkWidget *create_kbm_widget()
{
if (kbm_widget != NULL)
fprintf(stderr, "create_kbm_widget: kbm_widget was not NULL!\n");
load_settings();
GtkWidget *vbox_top = gtk_vbox_new (FALSE, 3);
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox_top), GTK_ORIENTATION_VERTICAL);
kbm_widget = vbox_top;
GtkWidget *hbox_lr = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_top), hbox_lr, FALSE, FALSE, 0);
GtkWidget *vbox_l = gtk_vbox_new (FALSE, 0);
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox_l), GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width (GTK_CONTAINER (vbox_l), 10);
gtk_box_pack_start (GTK_BOX (hbox_lr), vbox_l, TRUE, TRUE, 10);
GtkWidget *vbox_r = gtk_vbox_new (FALSE, 0);
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox_r), GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width (GTK_CONTAINER (vbox_r), 10);
gtk_box_pack_start (GTK_BOX (hbox_lr), vbox_r, TRUE, TRUE, 10);
GtkWidget *frame_kbm = gtk_frame_new(_("鍵盤排列方式/選擇鍵/選單每列字數"));
gtk_box_pack_start (GTK_BOX (vbox_l), frame_kbm, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (frame_kbm), 1);
gtk_container_add (GTK_CONTAINER (frame_kbm), create_kbm_opts());
gtk_box_pack_start (GTK_BOX (vbox_l), create_en_pho_key_sel(_("(詞音) 切換[中/英]輸入"), 0), FALSE, FALSE, 0);
GtkWidget *frame_tsin_space_opt = gtk_frame_new(_("(詞音) 鍵入空白鍵"));
gtk_box_pack_start (GTK_BOX (vbox_l), frame_tsin_space_opt, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (frame_tsin_space_opt), 1);
GtkWidget *box_tsin_space_opt = gtk_vbox_new (FALSE, 0);
gtk_orientable_set_orientation(GTK_ORIENTABLE(box_tsin_space_opt), GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (frame_tsin_space_opt), box_tsin_space_opt);
gtk_container_set_border_width (GTK_CONTAINER (box_tsin_space_opt), 1);
GSList *group_tsin_space_opt = NULL;
int current_idx = get_currnet_tsin_space_option_idx();
new_select_idx_tsin_space_opt = current_idx;
gsize i;
for(i=0; i< tsin_space_optionsN; i++) {
GtkWidget *button = gtk_radio_button_new_with_label (group_tsin_space_opt, _(tsin_space_options[i].name));
gtk_box_pack_start (GTK_BOX (box_tsin_space_opt), button, FALSE, FALSE, 0);
group_tsin_space_opt = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (callback_button_clicked_tsin_space_opt), (gpointer) i);
if (i==current_idx)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
}
GtkWidget *hbox_tsin_phrase_pre_select = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_l), hbox_tsin_phrase_pre_select , FALSE, FALSE, 1);
check_button_tsin_phrase_pre_select = gtk_check_button_new_with_label(_("詞音輸入預選詞視窗"));
gtk_box_pack_start (GTK_BOX (hbox_tsin_phrase_pre_select), check_button_tsin_phrase_pre_select, FALSE, FALSE, 0);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(check_button_tsin_phrase_pre_select), tsin_phrase_pre_select);
GtkWidget *hbox_phonetic_char_dynamic_sequence = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_l), hbox_phonetic_char_dynamic_sequence , FALSE, FALSE, 1);
check_button_phonetic_char_dynamic_sequence = gtk_check_button_new_with_label(_("依使用頻率調整字的順序"));
gtk_box_pack_start (GTK_BOX (hbox_phonetic_char_dynamic_sequence), check_button_phonetic_char_dynamic_sequence, FALSE, FALSE, 0);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(check_button_phonetic_char_dynamic_sequence), phonetic_char_dynamic_sequence);
GtkWidget *hbox_pho_hide_row2 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_r), hbox_pho_hide_row2 , FALSE, FALSE, 1);
check_button_pho_hide_row2 = gtk_check_button_new_with_label(_("注音隱藏第二列 (注音符號)"));
gtk_box_pack_start (GTK_BOX (hbox_pho_hide_row2), check_button_pho_hide_row2, FALSE, FALSE, 0);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(check_button_pho_hide_row2), pho_hide_row2);
GtkWidget *hbox_pho_in_row1 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_r), hbox_pho_in_row1 , FALSE, FALSE, 1);
check_button_pho_in_row1 = gtk_check_button_new_with_label(_("注音符號移至第一列"));
gtk_box_pack_start (GTK_BOX (hbox_pho_in_row1), check_button_pho_in_row1, FALSE, FALSE, 0);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(check_button_pho_in_row1), pho_in_row1);
GtkWidget *hbox_phonetic_huge_tab = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_r), hbox_phonetic_huge_tab , FALSE, FALSE, 1);
check_button_phonetic_huge_tab = gtk_check_button_new_with_label(_("使用巨大 UTF-8 字集"));
gtk_box_pack_start (GTK_BOX (hbox_phonetic_huge_tab), check_button_phonetic_huge_tab, FALSE, FALSE, 0);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(check_button_phonetic_huge_tab), phonetic_huge_tab);
GtkWidget *hbox_tsin_tone_char_input = gtk_hbox_new(FALSE, 0);
//.........这里部分代码省略.........
开发者ID:Explorer09,项目名称:hime,代码行数:101,代 |
请发表评论