Пример #1
0
/* callback to show and hide the toolbars */
G_MODULE_EXPORT void 
on_view_toolbar (GtkObject *object, gpointer user_data)
{
     GtkWidget *ringview_w, *menu_w, *view_w;

     /* g_print("on_view_toolbar\n"); */

     ringview_w = get_widget("ringview_handlebox");
     view_w = get_widget("view_handlebox");
     menu_w = get_widget("m_view_toolbar");

     g_signal_handlers_block_by_func(G_OBJECT(object), 
				     G_CALLBACK(on_view_toolbar), NULL);

     if (GTK_WIDGET_VISIBLE(ringview_w)) {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), FALSE);
  	  gtk_widget_hide(ringview_w);
  	  gtk_widget_hide(view_w);
     } else {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), TRUE);
  	  gtk_widget_show(ringview_w);
  	  gtk_widget_show(view_w);
     }

     g_signal_handlers_unblock_by_func(G_OBJECT(object), 
				       G_CALLBACK(on_view_toolbar), NULL);
}
Пример #2
0
NOT IMPLEMENTED YET

/* callback to show and hide the offsets columns pane */
G_MODULE_EXPORT void 
on_view_offsets (GtkObject *object, gpointer user_data)
{
  /* NOT YET TESTED */
     GtkWidget *offsets_w, *menu_w, *btn_w;

     offsets_w = get_widget("inst_list");
     menu_w = get_widget("m_view_metrics");
     btn_w = get_widget("view_metrics_btn");

     g_print("on_view_offsets\n");

     g_signal_handlers_block_by_func(G_OBJECT(object), 
				     G_CALLBACK(on_view_offsets), NULL);

     if (GTK_WIDGET_VISIBLE(offsets_w)) {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), FALSE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    FALSE);
  	  gtk_widget_hide(offsets_w);
     } else {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), TRUE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    TRUE);
	  gtk_widget_show(offsets_w);
     }

     g_signal_handlers_unblock_by_func(G_OBJECT(object), 
				       G_CALLBACK(on_view_offsets), NULL);
}
Пример #3
0
/* callback to show and hide the choice pane */
G_MODULE_EXPORT void 
on_view_choices (GtkObject *object, gpointer user_data)
{
     GtkWidget *scroll_w, *menu_w, *btn_w;

     scroll_w = get_widget("choice_scrollwin");
     menu_w = get_widget("m_view_choices");
     btn_w = get_widget("view_choice_btn");

     g_signal_handlers_block_by_func(G_OBJECT(object), 
				     G_CALLBACK(on_view_choices), NULL);

     if (GTK_WIDGET_VISIBLE(scroll_w)) {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), FALSE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    FALSE);
  	  gtk_widget_hide(scroll_w);
     } else {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), TRUE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    TRUE);
	  gtk_widget_show(scroll_w);
     }

     g_signal_handlers_unblock_by_func(G_OBJECT(object), 
				       G_CALLBACK(on_view_choices), NULL);
}
void VentanaCliente::initBotones() {
    Gtk::ToolButton* pAux;

    get_widget(BOTON_CONECTAR, pAux);
    botones[BOTON_CONECTAR] = pAux;
    pAux->signal_clicked().connect(sigc::mem_fun(*this,
                                   &VentanaCliente::on_conectar_button_clicked));

    get_widget(BOTON_ACTUALIZAR, pAux);
    botones[BOTON_ACTUALIZAR] = pAux;
    pAux->signal_clicked().connect(sigc::mem_fun(*this,
                                   &VentanaCliente::on_actualizar_button_clicked));

    get_widget(BOTON_DETENER_ACTUALIZAR, pAux);
    botones[BOTON_DETENER_ACTUALIZAR] = pAux;
    pAux->signal_clicked().connect(sigc::mem_fun(*this,
                                   &VentanaCliente::on_detenerActualizar_button_clicked));

    get_widget(BOTON_CONFIGURAR, pAux);
    botones[BOTON_CONFIGURAR] = pAux;
    pAux->signal_clicked().connect(sigc::mem_fun(*this,
                                   &VentanaCliente::on_configurar_button_clicked));

    get_widget(BOTON_SALIR, pAux);
    botones[BOTON_SALIR] = pAux;
    pAux->signal_clicked().connect(sigc::mem_fun(*this,
                                   &VentanaCliente::on_salir_button_clicked));
}
Пример #5
0
static void create_hand_widgets (window_board_t *win)
{
	static const char *alignment_a[] = {"alignment_w", "alignment_n", "alignment_e", "alignment_s"};
	static int dir[] = { 1, 2, 3, 4 };
	int h;
	GtkSizeGroup *sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);

	for (h = 0; h < 4; h++) {
		GtkWidget *alignment = get_widget (alignment_a[h]);
		GtkWidget *hand = hand_display_new(HAND_DISPLAY_MODE_HAND);
		gtk_container_add(GTK_CONTAINER(alignment), hand);
		gtk_widget_show(hand);
		g_signal_connect (hand, "card-clicked", G_CALLBACK (card_clicked), dir + h);
		g_signal_connect (hand, "card-enter", G_CALLBACK (card_enter), dir + h);
		g_signal_connect (hand, "card-leave", G_CALLBACK (card_leave), dir + h);
		g_signal_connect (hand, "card-drag-drop", G_CALLBACK (card_drag_drop), dir + h);
		win->handdisp[h] = HAND_DISPLAY(hand);
		hand_display_set_drag (HAND_DISPLAY (hand), 1);
		gtk_size_group_add_widget (sizegroup, hand);
	}
	g_object_unref (sizegroup);

	/* trick display */
	GtkWidget *grid = get_widget ("table1");
	GtkWidget *table = hand_display_new (HAND_DISPLAY_MODE_TABLE);
	gtk_table_attach_defaults (GTK_TABLE (grid), table, 1, 2, 1, 2);
	gtk_widget_show (table);
	win->table = HAND_DISPLAY (table);
}
void PanelConfigVista::initFiltradores(const Glib::ustring& nombreFilt,
                                       Gtk::VBox*& pFilt,
                                       const Glib::ustring& nombreBoton,
                                       Gtk::ToolButton*& pAgregar) {
    get_widget(nombreFilt, pFilt);
    get_widget(nombreBoton, pAgregar);
}
UmHistoryDialog *
um_history_dialog_new (void)
{
        GError *error = NULL;
        UmHistoryDialog *um;
        GtkWidget *widget;

        um = g_new0 (UmHistoryDialog, 1);
        um->builder = gtk_builder_new ();

        if (!gtk_builder_add_from_resource (um->builder, "/org/gnome/control-center/user-accounts/history-dialog.ui", &error)) {
                g_error ("%s", error->message);
                g_error_free (error);
                g_free (um);

                return NULL;
        }

        um->dialog = get_widget (um, "dialog");
        g_signal_connect (um->dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL);

        widget = get_widget (um, "close-button");
        g_signal_connect (widget, "clicked", G_CALLBACK (close_history_dialog), um);

        widget = get_widget (um, "next-button");
        g_signal_connect (widget, "clicked", G_CALLBACK (show_next), um);

        widget = get_widget (um, "previous-button");
        g_signal_connect (widget, "clicked", G_CALLBACK (show_previous), um);

        return um;
}
Пример #8
0
bool Render::on_expose_event(GdkEventExpose* event)
{
  GdkGLContext *glcontext = gtk_widget_get_gl_context (get_widget());
  GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (get_widget());

  if (!gldrawable || !gdk_gl_drawable_gl_begin (gldrawable, glcontext))
    return false;

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
  glLoadIdentity();
  glTranslatef (0.0, 0.0, -2.0 * m_zoom);
  glMultMatrixf (m_transform.M);
  CenterView();
  glPushMatrix();
  glColor3f(0.75f,0.75f,1.0f);

  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
  Gtk::TreeModel::iterator iter = m_selection->get_selected();

  m_view->Draw (iter);

  glPopMatrix();

  if (gdk_gl_drawable_is_double_buffered(gldrawable))
    gdk_gl_drawable_swap_buffers (gldrawable);
  else
    glFlush();

  gdk_gl_drawable_gl_end (gldrawable);

  return true;
}
Пример #9
0
void menu_init(void)
{
	GtkMenuShell *shell = GTK_MENU_SHELL(geany->main_widgets->editor_menu);
	GList *children = gtk_container_get_children(GTK_CONTAINER(shell));
	GtkWidget *search2 = find_widget(shell, "search2");

	block_execute = FALSE;
	active_menu = NULL;
	input = NULL;

	popup_item = get_widget("popup_item");
	menu_connect("popup_menu", &popup_menu_info, NULL);
	g_signal_connect(get_widget("popup_evaluate"), "button-release-event",
		G_CALLBACK(on_popup_evaluate_button_release), geany->main_widgets->editor_menu);

	if (search2)
		gtk_menu_shell_insert(shell, popup_item, g_list_index(children, search2) + 1);
	else
		gtk_menu_shell_append(shell, popup_item);

	modify_dialog = dialog_connect("modify_dialog");
	modify_value_label = GTK_LABEL(get_widget("modify_value_label"));
	modify_value = get_widget("modify_value");
	modify_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(modify_value));
	modify_ok = get_widget("modify_ok");
	utils_enter_to_clicked(modify_value, modify_ok);
}
Пример #10
0
void sdl_drawmode::mouse_move(SDL_MouseMotionEvent *from, SDL_MouseMotionEvent *to)
{	//TODO: handle click and drag movable widgets
	if (num_widgets > 0)
	{
		int from_w = get_widget(from->x, from->y);
		int to_w = get_widget(to->x, to->y);
		if ((from_w != -1) && (to_w != -1))
		{
			if (from_w != to_w)
			{	//only send events if the widgets are different
				mouse_from(from);
				mouse_to(to);
			}
			else
			{
				mouse_to(to);
			}
		}
		if ((from_w == -1) && (to_w != -1))
		{
			mouse_to(to);
		}
		if ((from_w != -1) && (to_w == -1))
		{
			mouse_from(from);
		}
	}
}
void
test_toggle_button (gconstpointer data)
{
    GtkWidget *button, *dependent_widget;
    gboolean widget_value;
    gboolean xinput_value;
    const gchar *widget_name;
    const gchar *xinput_name;
    const gchar *dependent_widget_name;

    widget_name = gcut_data_get_string(data, "widget-name");
    xinput_name = gcut_data_get_string(data, "xinput-name");
    dependent_widget_name = gcut_data_get_string(data, "dependent-widget-name");

    button = get_widget(widget_name);
    cut_assert_true(GTK_IS_TOGGLE_BUTTON(button));

    xinput_value = get_boolean_property_of_xinput(xinput_name);
    widget_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
    cut_assert_equal_int(xinput_value, widget_value);

    /* check widget sensitivity */
    dependent_widget = get_widget(dependent_widget_name);
    cut_assert_equal_int(widget_value, GTK_WIDGET_SENSITIVE(dependent_widget));

    gtk_test_widget_click(button, 1, 0);
    wait_action();
    xinput_value = get_boolean_property_of_xinput(xinput_name);
    cut_assert_equal_int(xinput_value, !widget_value);

    cut_assert_equal_int(!widget_value, GTK_WIDGET_SENSITIVE(dependent_widget));
}
static void
restore_widget_sensitivities (void)
{
    gtk_widget_set_sensitive(get_widget("wheel_emulation_box"),
                             wheel_emulation_box_sensitivity);
    gtk_widget_set_sensitive(get_widget("middle_button_emulation_box"),
                             middle_button_emulation_box_sensitivity);
}
static void
preserve_widget_sensitivities (void)
{
    wheel_emulation_box_sensitivity = 
        GTK_WIDGET_SENSITIVE(get_widget("wheel_emulation_box"));
    middle_button_emulation_box_sensitivity = 
        GTK_WIDGET_SENSITIVE(get_widget("middle_button_emulation_box"));
}
void TabAdminConfigConsultas::initTabConfig() {
    get_widget(ENTRY_TAB_LABEL, pEntryTabLabel);
    get_widget_derived(VBOX_TAB_CONFIG, pTabVista);

    Gtk::HBox* pHBoxTabSelec;
    get_widget(HBOX_TAB_SELEC, pHBoxTabSelec);
    pHBoxTabSelec->pack_start(comboTabSelec, false, false);
    comboTabSelec.show();
}
static void
show_user (UmUser *user, UmUserPanelPrivate *d)
{
    GtkWidget *image;
    GtkWidget *label;
    GtkWidget *label2;
    GtkWidget *label3;
    GdkPixbuf *pixbuf;
    gchar *lang;
    GtkWidget *widget;
    GtkTreeModel *model;
    GtkTreeIter iter;
    gboolean show, enable;

    pixbuf = um_user_render_icon (user, FALSE, 48);
    image = get_widget (d, "user-icon-image");
    gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
    image = get_widget (d, "user-icon-image2");
    gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
    g_object_unref (pixbuf);

    um_photo_dialog_set_user (d->photo_dialog, user);

    widget = get_widget (d, "full-name-entry");
    cc_editable_entry_set_text (CC_EDITABLE_ENTRY (widget), um_user_get_real_name (user));
    gtk_widget_set_tooltip_text (widget, um_user_get_user_name (user));

    widget = get_widget (d, "account-type-combo");
    um_editable_combo_set_active (UM_EDITABLE_COMBO (widget), um_user_get_account_type (user));

    widget = get_widget (d, "account-password-button");
    um_editable_button_set_text (UM_EDITABLE_BUTTON (widget), get_password_mode_text (user));
    enable = um_user_is_local_account (user);
    gtk_widget_set_sensitive (widget, enable);

    widget = get_widget (d, "account-language-combo");
    model = um_editable_combo_get_model (UM_EDITABLE_COMBO (widget));
    cc_add_user_languages (model);

    lang = g_strdup (um_user_get_language (user));
    if (!lang)
        lang = cc_common_language_get_current_language ();
    cc_common_language_get_iter_for_language (model, lang, &iter);
    um_editable_combo_set_active_iter (UM_EDITABLE_COMBO (widget), &iter);
    g_free (lang);

    /* Fingerprint: show when self, possible, and local account */
    widget = get_widget (d, "account-fingerprint-notebook");
    label = get_widget (d, "account-fingerprint-label");
    label2 = get_widget (d, "account-fingerprint-value-label");
    label3 = get_widget (d, "account-fingerprint-button-label");
    show = (um_user_get_uid (user) == getuid() &&
            um_user_is_local_account (user) &&
            set_fingerprint_label (label2, label3));
    gtk_widget_set_visible (label, show);
    gtk_widget_set_visible (widget, show);
}
Пример #16
0
static app_t *
app_new (pixman_image_t *original)
{
    GtkWidget *widget;
    app_t *app = g_malloc (sizeof *app);
    GError *err = NULL;

    app->builder = gtk_builder_new ();
    app->original = original;

    if (!gtk_builder_add_from_file (app->builder, "scale.ui", &err))
	g_error ("Could not read file scale.ui: %s", err->message);

    app->scale_x_adjustment =
        GTK_ADJUSTMENT (gtk_builder_get_object (app->builder, "scale_x_adjustment"));
    app->scale_y_adjustment =
        GTK_ADJUSTMENT (gtk_builder_get_object (app->builder, "scale_y_adjustment"));
    app->rotate_adjustment =
        GTK_ADJUSTMENT (gtk_builder_get_object (app->builder, "rotate_adjustment"));
    app->subsample_adjustment =
	GTK_ADJUSTMENT (gtk_builder_get_object (app->builder, "subsample_adjustment"));

    g_signal_connect (app->scale_x_adjustment, "value_changed", G_CALLBACK (rescale), app);
    g_signal_connect (app->scale_y_adjustment, "value_changed", G_CALLBACK (rescale), app);
    g_signal_connect (app->rotate_adjustment, "value_changed", G_CALLBACK (rescale), app);
    g_signal_connect (app->subsample_adjustment, "value_changed", G_CALLBACK (rescale), app);
    
    widget = get_widget (app, "scale_x_scale");
    gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL);
    g_signal_connect (widget, "format_value", G_CALLBACK (format_value), app);
    widget = get_widget (app, "scale_y_scale");
    gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL);
    g_signal_connect (widget, "format_value", G_CALLBACK (format_value), app);
    widget = get_widget (app, "rotate_scale");
    gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL);

    widget = get_widget (app, "drawing_area");
    g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);

    set_up_filter_box (app, "reconstruct_x_combo_box");
    set_up_filter_box (app, "reconstruct_y_combo_box");
    set_up_filter_box (app, "sample_x_combo_box");
    set_up_filter_box (app, "sample_y_combo_box");

    set_up_combo_box (
        app, "repeat_combo_box", G_N_ELEMENTS (repeats), repeats);

    g_signal_connect (
	gtk_builder_get_object (app->builder, "lock_checkbutton"),
	"toggled", G_CALLBACK (rescale), app);
    
    rescale (NULL, app);
    
    return app;
}
void TabAdminConfigConsultas::initBotones() {
    Gtk::Button* pAux;
    get_widget(BUTTON_AGREGAR_TAB, pAux);
    botones[BUTTON_AGREGAR_TAB] = pAux;

    get_widget(BUTTON_GUARDAR_CAMBIOS_TAB, pAux);
    botones[BUTTON_GUARDAR_CAMBIOS_TAB] = pAux;

    get_widget(BUTTON_ELIMINAR_TAB, pAux);
    botones[BUTTON_ELIMINAR_TAB] = pAux;
}
Пример #18
0
bool Render::on_configure_event(GdkEventConfigure* event)
{
  GdkGLContext *glcontext = gtk_widget_get_gl_context (get_widget());
  GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (get_widget());
  int w, h;

  if (!gldrawable || !gdk_gl_drawable_gl_begin (gldrawable, glcontext))
    return false;

  w = get_width();
  h = get_height();

  glLoadIdentity();
  glViewport (0, 0, w, h);
  glMatrixMode (GL_PROJECTION);
  glLoadIdentity ();
  gluPerspective (45.0f, (float)get_width()/(float)get_height(),1.0f, 1000000.0f);
  glMatrixMode (GL_MODELVIEW);
  glLoadIdentity ();
  
  if (w > 1 && h > 1) // Limit arcball minimum size or it asserts
    m_arcBall->setBounds(w, h);
  glEnable(GL_LIGHTING);

  struct { GLfloat x; GLfloat y; GLfloat z; } light_locations[] = {
    { -100,  100, 200 },
    {  100,  100, 200 },
    {  100, -100, 200 },
    {  100, -100, 200 }
  };
  for (uint i = 0; i < N_LIGHTS; i++) {
    delete (m_lights[i]);
    m_lights[i] = new gllight();
    m_lights[i]->Init((GLenum)(GL_LIGHT0+i));
    m_lights[i]->SetAmbient(0.2f, 0.2f, 0.2f, 1.0f);
    m_lights[i]->SetDiffuse(1.0f, 1.0f, 1.0f, 1.0f);
    m_lights[i]->SetSpecular(1.0f, 1.0f, 1.0f, 1.0f);
    m_lights[i]->Enable(false);
    m_lights[i]->SetLocation(light_locations[i].x,
			   light_locations[i].y,
			   light_locations[i].z, 0);
  }
  m_lights[0]->Enable(true);
  m_lights[3]->Enable(true);

  glDisable ( GL_LIGHTING);
  glDepthFunc (GL_LEQUAL);
  glEnable (GL_DEPTH_TEST);
  glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

  gdk_gl_drawable_gl_end (gldrawable);

  return true;
}
Пример #19
0
static void enable_stuff()
{
    GtkWidget *w;
    gboolean b;

    w = get_widget("place_mouse");
    b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));

    w = get_widget("primary_monitor_popup");
    b = gtk_combo_box_get_active(GTK_COMBO_BOX(w)) == PLACE_ON_FIXED;
    w = get_widget("fixed_monitor");
    gtk_widget_set_sensitive(w, b);
}
Пример #20
0
void
board_window_init (window_board_t *win)
{
	//win->window = create_window_hand ();
	win->window = get_widget ("window_hand");
	win->statusbar = GTK_STATUSBAR (get_widget ("statusbar1"));
	win->board_menu = get_widget ("board_menu1");
	create_hand_widgets(win);
	create_bidding_widget (win);

	/* set up "recently used" menu */
	GtkWidget *jump_menu = get_widget ("jump_to1");
#if GTK_CHECK_VERSION (2,10,0)
	GtkWidget *recentchooser = gtk_recent_chooser_menu_new ();
	gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (recentchooser),
			GTK_RECENT_SORT_MRU);
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (jump_menu), recentchooser);
	g_signal_connect (G_OBJECT (recentchooser), "item-activated",
			G_CALLBACK (jump_menu_select), NULL);
	GtkRecentFilter *filter = gtk_recent_filter_new ();
	gtk_recent_filter_add_pattern (filter, "*.lin");
	gtk_recent_filter_add_pattern (filter, "*.pbn");
	gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (recentchooser), filter);
#else
	gtk_widget_set_sensitive (jump_menu, FALSE);
#endif

	win->keyfile = g_key_file_new ();
	win->show_played_cards = 0;
	win->show_hands = seat_all;
	win->show_dd_scores = seat_all;
	win->svg = NULL;
	win->card_width = 70;

	win->filename = NULL;
	win->title = win->subtitle = win->team1 = win->team2 = NULL;
	win->boards = NULL;
	win->board_numbers = NULL;
	win->n_boards_alloc = 0;
	win->n_boards = 0;

	win->cutbuf = NULL;

	win->cur = 0;

	GdkColor bg = { 0, HAND_DISPLAY_TABLE_GDK_BG };
	gdk_colormap_alloc_color (gdk_colormap_get_system (), &bg, FALSE, TRUE);
	gtk_widget_modify_bg (win->window, GTK_STATE_NORMAL, &bg);

	gtk_widget_show (win->window);
}
Пример #21
0
void VentanaCliente::initBarraDeMenu() {
    Gtk::ImageMenuItem* pAux;

    get_widget(MENU_SALIR, pAux);
    pAux->signal_activate().connect(sigc::mem_fun(*this,
                                    &VentanaCliente::on_salir_button_clicked));

    get_widget(MENU_CONFIGURAR, pAux);
    pAux->signal_activate().connect(sigc::mem_fun(*this,
                                    &VentanaCliente::on_configurar_button_clicked));

    get_widget(MENU_ACERCA_DE, pAux);
    pAux->signal_activate().connect(sigc::mem_fun(*this,
                                    &VentanaCliente::on_acerca_de_button_clicked));
}
Пример #22
0
void configure_panel(void)
{
	gboolean short_tab_names = pref_panel_tab_pos == GTK_POS_LEFT ||
		pref_panel_tab_pos == GTK_POS_RIGHT ||
		geany_data->interface_prefs->msgwin_orientation == GTK_ORIENTATION_HORIZONTAL;

	gtk_label_set_label(GTK_LABEL(get_widget("program_terminal_label")),
		short_tab_names ? _("Program") : _("Program Terminal"));
	gtk_label_set_label(GTK_LABEL(get_widget("break_view_label")),
		short_tab_names ? _("Breaks") : _("Breakpoints"));
	gtk_label_set_label(GTK_LABEL(get_widget("debug_console_label")),
		short_tab_names ? _("Console") : _("Debug Console"));

	gtk_notebook_set_tab_pos(GTK_NOTEBOOK(debug_panel), pref_panel_tab_pos);
}
Пример #23
0
void windows_setup_tab()
{
    GtkWidget *w;
    gchar *s;

    mapping = TRUE;

    w = get_widget("focus_new");
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
                                 tree_get_bool("focus/focusNew", TRUE));

    w = get_widget("place_mouse");
    s = tree_get_string("placement/policy", "Smart");
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
                                 !g_ascii_strcasecmp(s, "UnderMouse"));
    g_free(s);

    w = get_widget("place_active_popup");
    s = tree_get_string("placement/monitor", "Any");
    if (!g_ascii_strcasecmp(s, "Active"))
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_ACTIVE);
    else if (!g_ascii_strcasecmp(s, "Mouse"))
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_MOUSE);
    else if (!g_ascii_strcasecmp(s, "Primary"))
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_PRIMARY);
    else
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_ALL);
    g_free(s);

    w = get_widget("primary_monitor_popup");
    s = tree_get_string("placement/primaryMonitor", "");
    if (!g_ascii_strcasecmp(s, "Active"))
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_ACTIVE);
    else if (!g_ascii_strcasecmp(s, "Mouse"))
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_MOUSE);
    else {
        gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_FIXED);

        w = get_widget("fixed_monitor");
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
                                  tree_get_int("placement/primaryMonitor", 1));
    }
    g_free(s);

    enable_stuff();

    mapping = FALSE;
}
static void
change_fingerprint (GtkButton *button, UmUserPanelPrivate *d)
{
    GtkWidget *label, *label2;
    UmUser *user;

    user = get_selected_user (d);

    g_assert (g_strcmp0 (g_get_user_name (), um_user_get_user_name (user)) == 0);

    label = get_widget (d, "account-fingerprint-value-label");
    label2 = get_widget (d, "account-fingerprint-button-label");
    fingerprint_button_clicked (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), label, label2, user);

    g_object_unref (user);
}
static void
language_response (GtkDialog         *dialog,
                   gint               response_id,
                   UmUserPanelPrivate *d)
{
    GtkWidget *combo;
    UmUser *user;
    gchar *lang;
    GtkTreeModel *model;
    GtkTreeIter iter;

    user = get_selected_user (d);

    combo = get_widget (d, "account-language-combo");
    model = um_editable_combo_get_model (UM_EDITABLE_COMBO (combo));

    if (response_id == GTK_RESPONSE_OK) {
        lang = cc_language_chooser_get_language (GTK_WIDGET (dialog));
        um_user_set_language (user, lang);
    }
    else {
        lang = g_strdup (um_user_get_language (user));
        if (!lang)
            lang = cc_common_language_get_current_language ();
    }
    cc_common_language_get_iter_for_language (model, lang, &iter);
    um_editable_combo_set_active_iter (UM_EDITABLE_COMBO (combo), &iter);
    g_free (lang);

    gtk_widget_hide (GTK_WIDGET (dialog));
    gtk_widget_set_sensitive (combo, TRUE);

    g_object_unref (user);
}
static void
user_removed (UmUserManager *um, UmUser *user, UmUserPanelPrivate *d)
{
    GtkTreeView *tv;
    GtkTreeModel *model;
    GtkTreeSelection *selection;
    GtkListStore *store;
    GtkTreeIter iter, next;
    UmUser *u;

    g_debug ("user removed: %s\n", um_user_get_user_name (user));
    tv = (GtkTreeView *)get_widget (d, "list-treeview");
    selection = gtk_tree_view_get_selection (tv);
    model = gtk_tree_view_get_model (tv);
    store = GTK_LIST_STORE (model);
    if (gtk_tree_model_get_iter_first (model, &iter)) {
        do {
            gtk_tree_model_get (model, &iter, USER_COL, &u, -1);

            if (u != NULL) {
                if (um_user_get_uid (user) == um_user_get_uid (u)) {
                    if (!get_next_user_row (model, &iter, &next))
                        get_previous_user_row (model, &iter, &next);
                    gtk_list_store_remove (store, &iter);
                    gtk_tree_selection_select_iter (selection, &next);
                    g_object_unref (u);
                    break;
                }
                g_object_unref (u);
            }
        } while (gtk_tree_model_iter_next (model, &iter));
    }
}
Пример #27
0
static pixman_kernel_t
get_value (app_t *app, const named_int_t table[], const char *box_name)
{
    GtkComboBox *box = GTK_COMBO_BOX (get_widget (app, box_name));

    return table[gtk_combo_box_get_active (box)].value;
}
Пример #28
0
static void
set_up_combo_box (app_t *app, const char *box_name,
                  int n_entries, const named_int_t table[])
{
    GtkWidget *widget = get_widget (app, box_name);
    GtkListStore *model;
    GtkCellRenderer *cell;
    int i;

    model = gtk_list_store_new (1, G_TYPE_STRING);
    
    cell = gtk_cell_renderer_text_new ();
    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), cell, TRUE);
    gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), cell,
				    "text", 0,
				    NULL);

    gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (model));
    
    for (i = 0; i < n_entries; ++i)
    {
	const named_int_t *info = &(table[i]);
	GtkTreeIter iter;

	gtk_list_store_append (model, &iter);
	gtk_list_store_set (model, &iter, 0, info->name, -1);
    }

    gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);

    g_signal_connect (widget, "changed", G_CALLBACK (rescale), app);
}
JNIEXPORT jintArray JNICALL 
Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetForeground
  (JNIEnv *env, jobject obj)
{
  void *ptr;
  jintArray array;
  jint *rgb;
  GdkColor fg;

  gdk_threads_enter ();

  ptr = gtkpeer_get_widget (env, obj);

  fg = get_widget(GTK_WIDGET (ptr))->style->fg[GTK_STATE_NORMAL];

  array = (*env)->NewIntArray (env, 3);

  rgb = (*env)->GetIntArrayElements (env, array, NULL);
  /* convert color data from 16 bit values down to 8 bit values */
  rgb[0] = fg.red   >> 8;
  rgb[1] = fg.green >> 8;
  rgb[2] = fg.blue  >> 8;
  (*env)->ReleaseIntArrayElements (env, array, rgb, 0);

  gdk_threads_leave ();

  return array;
}
Пример #30
0
int
main (int argc, char **argv)
{
    GtkWidget *window;
    pixman_image_t *image;
    app_t *app;
    
    gtk_init (&argc, &argv);

    if (argc < 2)
    {
	printf ("%s <image file>\n", argv[0]);
	return -1;
    }

    if (!(image = pixman_image_from_file (argv[1], PIXMAN_a8r8g8b8)))
    {
	printf ("Could not load image \"%s\"\n", argv[1]);
	return -1;
    }

    app = app_new (image);
    
    window = get_widget (app, "main");

    g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
    
    gtk_window_set_default_size (GTK_WINDOW (window), 1024, 768);
    
    gtk_widget_show_all (window);
    
    gtk_main ();

    return 0;
}