Пример #1
0
// helper to create a dropdown menu item
void wxToolBarTool::CreateDropDown()
{
    gtk_tool_item_set_homogeneous(m_item, false);
    GtkOrientation orient = GTK_ORIENTATION_HORIZONTAL;
    GtkArrowType arrowType = GTK_ARROW_DOWN;
    if (GetToolBar()->HasFlag(wxTB_LEFT | wxTB_RIGHT))
    {
        orient = GTK_ORIENTATION_VERTICAL;
        arrowType = GTK_ARROW_RIGHT;
    }
    GtkWidget* box = gtk_box_new(orient, 0);
    GtkWidget* arrow = gtk_arrow_new(arrowType, GTK_SHADOW_NONE);
    GtkWidget* tool_button = gtk_bin_get_child(GTK_BIN(m_item));
    g_object_ref(tool_button);
    gtk_container_remove(GTK_CONTAINER(m_item), tool_button);
    gtk_container_add(GTK_CONTAINER(box), tool_button);
    g_object_unref(tool_button);
    GtkWidget* arrow_button = gtk_toggle_button_new();
    gtk_button_set_relief(GTK_BUTTON(arrow_button),
        gtk_tool_item_get_relief_style(GTK_TOOL_ITEM(m_item)));
    gtk_container_add(GTK_CONTAINER(arrow_button), arrow);
    gtk_container_add(GTK_CONTAINER(box), arrow_button);
    gtk_widget_show_all(box);
    gtk_container_add(GTK_CONTAINER(m_item), box);

    g_signal_connect(arrow_button, "toggled", G_CALLBACK(arrow_toggled), this);
    g_signal_connect(arrow_button, "button_press_event",
        G_CALLBACK(arrow_button_press_event), this);
}
Пример #2
0
static void
thunar_location_entry_init (ThunarLocationEntry *location_entry)
{
  GtkSizeGroup *size_group;
  GtkWidget    *button;
  GtkWidget    *arrow;

  gtk_box_set_spacing (GTK_BOX (location_entry), 0);
  gtk_container_set_border_width (GTK_CONTAINER (location_entry), 4);

  location_entry->path_entry = thunar_path_entry_new ();
  exo_binding_new (G_OBJECT (location_entry), "current-directory", G_OBJECT (location_entry->path_entry), "current-file");
  g_signal_connect_after (G_OBJECT (location_entry->path_entry), "activate", G_CALLBACK (thunar_location_entry_activate), location_entry);
  gtk_box_pack_start (GTK_BOX (location_entry), location_entry->path_entry, TRUE, TRUE, 0);
  gtk_widget_show (location_entry->path_entry);

  button = gtk_toggle_button_new ();
  g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (thunar_location_entry_button_clicked), location_entry);
  g_signal_connect (G_OBJECT (button), "pressed", G_CALLBACK (thunar_location_entry_button_clicked), location_entry);
  gtk_box_pack_start (GTK_BOX (location_entry), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
  gtk_container_add (GTK_CONTAINER (button), arrow);
  gtk_widget_show (arrow);

  /* make sure the entry and the button request the same height */
  size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
  gtk_size_group_add_widget (size_group, location_entry->path_entry);
  gtk_size_group_add_widget (size_group, button);
  g_object_unref (G_OBJECT (size_group));
}
Пример #3
0
static VALUE
rg_initialize(VALUE self, VALUE arrow_t, VALUE shadow_t)
{
    RBGTK_INITIALIZE(self, gtk_arrow_new(RVAL2GENUM(arrow_t, GTK_TYPE_ARROW_TYPE),
                                         RVAL2GENUM(shadow_t, GTK_TYPE_SHADOW_TYPE)));
    return Qnil;
}
gint
gnc_popup_get_button_width (void)
{
	GtkWidget *window, *button, *arrow;
	gint       width;

	GtkRequisition req;
	
	window = gtk_window_new (GTK_WINDOW_POPUP);
	
	button = gtk_button_new ();
	gtk_widget_show (button);
	gtk_container_add (GTK_CONTAINER (window), button);

	arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
	gtk_widget_show (arrow);
	gtk_container_add (GTK_CONTAINER (button), arrow);

	gtk_window_move (GTK_WINDOW (window), -500, -500);
	gtk_widget_show (window);

	gtk_widget_size_request (window, &req);
	
	width = req.width;

	gtk_widget_destroy (window);

	return width;
}
Пример #5
0
/**** Arrow constructor ****/
int
clip_GTK_ARROWNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   GtkArrowType arrow_type = _clip_parni(ClipMachineMemory, 2);

   GtkShadowType shadow_type = _clip_parni(ClipMachineMemory, 3);

   GtkWidget *wid = NULL;

   C_widget *cwid;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKOPT(2, NUMERIC_type_of_ClipVarType);
   CHECKOPT(3, NUMERIC_type_of_ClipVarType);

   wid = gtk_arrow_new(arrow_type, shadow_type);
   if (!wid)
      goto err;
   cwid = _register_widget(ClipMachineMemory, wid, cv);
   _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
   return 0;
 err:
   return 1;
}
Пример #6
0
static VALUE
rg_initialize(VALUE self, VALUE arrow_t, VALUE shadow_t)
{
    RBGTK_INITIALIZE(self, gtk_arrow_new(RVAL2GTKARROWTYPE(arrow_t),
                                         RVAL2GTKSHADOWTYPE(shadow_t)));
    return Qnil;
}
Пример #7
0
static void
egg_panel_init (EggPanel *panel)
{
	panel->priv = G_TYPE_INSTANCE_GET_PRIVATE(panel,
	                                          EGG_TYPE_PANEL,
	                                          EggPanelPrivate);

	/*
	 * Set default state.
	 */
	panel->priv->state = STATE_INITIAL;

	/*
	 * Create required children widgets.
	 */
	panel->priv->ebox = gtk_event_box_new();
	panel->priv->header = gtk_hbox_new(FALSE, 0);
	panel->priv->title = gtk_label_new(NULL);
	panel->priv->arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);

	/*
	 * Modify widget properties.
	 */
	gtk_misc_set_padding(GTK_MISC(panel->priv->title), 6, 3);
	gtk_misc_set_alignment(GTK_MISC(panel->priv->title), 0., .5);
	gtk_widget_set_app_paintable(panel->priv->ebox, TRUE);
	gtk_misc_set_padding(GTK_MISC(panel->priv->arrow), 1, 0);

	/*
	 * Pack children widgets.
	 */
	gtk_box_pack_start(GTK_BOX(panel), panel->priv->ebox,
	                   FALSE, TRUE, 0);
	gtk_container_add(GTK_CONTAINER(panel->priv->ebox),
	                  panel->priv->header);
	gtk_box_pack_start(GTK_BOX(panel->priv->header),
	                   panel->priv->arrow,
	                   FALSE, TRUE, 0);
	gtk_box_pack_start(GTK_BOX(panel->priv->header),
	                   panel->priv->title,
	                   TRUE, TRUE, 0);

	/*
	 * Attach signal handlers.
	 */
	g_signal_connect(panel->priv->ebox, "expose-event",
	                 G_CALLBACK(egg_panel_ebox_expose), panel);
	g_signal_connect(panel->priv->ebox, "button-press-event",
	                 G_CALLBACK(egg_panel_ebox_button_press), panel);

	/*
	 * Show chlidren widgets.
	 */
	gtk_widget_show(panel->priv->title);
	gtk_widget_show(panel->priv->header);
	gtk_widget_show(panel->priv->arrow);
	gtk_widget_show(panel->priv->ebox);
}
Пример #8
0
static void _check_arrows (AtkObject *obj)
{
  GtkWidget *content_area, *action_area;
  AtkRole role;
  MainDialog *md;
  static gint visibleDialog = 0;


  role = atk_object_get_role(obj);
  if(role == ATK_ROLE_FRAME) {

	md = (MainDialog *) malloc (sizeof(MainDialog));
	if (visibleDialog == 0)
    {
		md->arrow1 = gtk_arrow_new(GTK_ARROW_UP,GTK_SHADOW_IN);
		md->arrow2 = gtk_arrow_new(GTK_ARROW_DOWN,GTK_SHADOW_IN);
		md->arrow3 = gtk_arrow_new(GTK_ARROW_LEFT,GTK_SHADOW_OUT);
		md->arrow4 = gtk_arrow_new(GTK_ARROW_RIGHT,GTK_SHADOW_OUT);
		md->dialog = gtk_dialog_new();
		gtk_window_set_modal(GTK_WINDOW(md->dialog), TRUE);

                content_area = gtk_dialog_get_content_area (GTK_DIALOG (md->dialog));
                action_area = gtk_dialog_get_action_area (GTK_DIALOG (md->dialog));

                gtk_box_pack_start(GTK_BOX (content_area), md->arrow1, TRUE,TRUE, 0);
		gtk_box_pack_start(GTK_BOX (content_area), md->arrow2, TRUE,TRUE, 0);
		gtk_box_pack_start(GTK_BOX (content_area), md->arrow3, TRUE,TRUE, 0);
		gtk_box_pack_start(GTK_BOX (content_area), md->arrow4, TRUE,TRUE, 0);
		g_signal_connect(md->dialog, "destroy",
                                 G_CALLBACK (destroy), md->dialog);

	        md->image = GTK_IMAGE(gtk_image_new_from_file("circles.xbm"));
		gtk_box_pack_start(GTK_BOX (content_area), GTK_WIDGET(md->image), TRUE,TRUE, 0);
		md->close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
		g_signal_connect(md->close_button, "clicked",
                                 G_CALLBACK (destroy), md->dialog);

		gtk_box_pack_start(GTK_BOX (action_area), md->close_button, TRUE,TRUE, 0);

		gtk_widget_show_all(md->dialog);
		visibleDialog = 1;
    }
 }
}
Пример #9
0
static void
empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
{
	GtkWidget                  *arrow;
	GtkWidget                  *alignment;
	EmpathyPresenceChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
		EMPATHY_TYPE_PRESENCE_CHOOSER, EmpathyPresenceChooserPriv);

	chooser->priv = priv;
	gtk_button_set_relief (GTK_BUTTON (chooser), GTK_RELIEF_NONE);
	gtk_button_set_focus_on_click (GTK_BUTTON (chooser), FALSE);

	alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
	gtk_widget_show (alignment);
	gtk_container_add (GTK_CONTAINER (chooser), alignment);
	gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 1, 0);

	priv->hbox = gtk_hbox_new (FALSE, 1);
	gtk_widget_show (priv->hbox);
	gtk_container_add (GTK_CONTAINER (alignment), priv->hbox);

	priv->image = gtk_image_new ();
	gtk_widget_show (priv->image);
	gtk_box_pack_start (GTK_BOX (priv->hbox), priv->image, FALSE, TRUE, 0);

	priv->label = gtk_label_new (NULL);
	gtk_widget_show (priv->label);
	gtk_box_pack_start (GTK_BOX (priv->hbox), priv->label, TRUE, TRUE, 0);
	gtk_label_set_ellipsize (GTK_LABEL (priv->label), PANGO_ELLIPSIZE_END);
	gtk_misc_set_alignment (GTK_MISC (priv->label), 0, 0.5);
	gtk_misc_set_padding (GTK_MISC (priv->label), 4, 1);

	alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
	gtk_widget_show (alignment);
	gtk_box_pack_start (GTK_BOX (priv->hbox), alignment, FALSE, FALSE, 0);

	arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
	gtk_widget_show (arrow);
	gtk_container_add (GTK_CONTAINER (alignment), arrow);

	g_signal_connect (chooser, "toggled",
			  G_CALLBACK (presence_chooser_toggled_cb),
			  NULL);
	g_signal_connect (chooser, "button-press-event",
			  G_CALLBACK (presence_chooser_button_press_event_cb),
			  NULL);
	g_signal_connect (chooser, "scroll-event",
			  G_CALLBACK (presence_chooser_scroll_event_cb),
			  NULL);

	priv->idle = empathy_idle_dup_singleton ();
	presence_chooser_presence_changed_cb (chooser);
	g_signal_connect_swapped (priv->idle, "notify",
				  G_CALLBACK (presence_chooser_presence_changed_cb),
				  chooser);
}
Пример #10
0
GtkWidget *create_gtk_arrow(GtkArrowType arrow_type,
				GtkShadowType shadow_type) {
    GtkWidget *arrow;
    GtkWidget *button;
    
    arrow = gtk_arrow_new(arrow_type, shadow_type);
    button = gtk_button_new();
    gtk_container_add(GTK_CONTAINER(button), arrow);

    return button;
}
Пример #11
0
static void
gtk_combo_button_init (GtkComboButton * combo_button)
{
  GtkWidget *event_box;
  GdkCursor *cursor;
  GtkWidget *widget;
  GtkWidget *arrow;

  widget=GTK_WIDGET(combo_button);

  GTK_BOX(widget)->homogeneous = FALSE;

  combo_button->button = gtk_button_new ();
  combo_button->arrow = gtk_toggle_button_new ();

  arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
  gtk_widget_show (arrow);
  gtk_container_add (GTK_CONTAINER (combo_button->arrow), arrow);

  gtk_box_pack_start (GTK_BOX (combo_button), combo_button->button, TRUE, TRUE, 0);
  gtk_box_pack_end (GTK_BOX (combo_button), combo_button->arrow, FALSE, FALSE, 0);

  gtk_widget_show (combo_button->button);
  gtk_widget_show (combo_button->arrow);

  gtk_signal_connect (GTK_OBJECT (combo_button->arrow), "toggled",
		      (GtkSignalFunc) gtk_combo_button_arrow_press, combo_button);

                       
  combo_button->popwin = gtk_window_new (GTK_WINDOW_POPUP);
  gtk_widget_ref (combo_button->popwin);
  gtk_window_set_resizable (GTK_WINDOW (combo_button->popwin), FALSE);
  gtk_window_set_policy (GTK_WINDOW (combo_button->popwin), 1, 1, 0);
  gtk_widget_set_events (combo_button->popwin, GDK_KEY_PRESS_MASK);
 
  event_box = gtk_event_box_new ();
  gtk_container_add (GTK_CONTAINER (combo_button->popwin), event_box);
  gtk_widget_show (event_box);

  gtk_widget_realize (event_box);
  cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
  gdk_window_set_cursor (event_box->window, cursor);
  gdk_cursor_destroy (cursor);

  combo_button->frame = gtk_frame_new (NULL);
  gtk_container_add (GTK_CONTAINER (event_box), combo_button->frame);
  gtk_frame_set_shadow_type (GTK_FRAME (combo_button->frame), GTK_SHADOW_OUT);
  gtk_widget_show (combo_button->frame);

  gtk_signal_connect (GTK_OBJECT (combo_button->popwin), "button_press_event",
		      GTK_SIGNAL_FUNC (gtk_combo_button_button_press), combo_button);
  

}
Пример #12
0
static void
go_combo_box_init (GOComboBox *combo_box)
{
	GtkWidget *arrow;

	combo_box->priv = g_new0 (GOComboBoxPrivate, 1);
	combo_box->priv->updating_buttons = FALSE;

	combo_box->priv->arrow_button = gtk_toggle_button_new ();
	gtk_button_set_relief (GTK_BUTTON (combo_box->priv->arrow_button), GTK_RELIEF_NONE);
	gtk_widget_set_can_focus (combo_box->priv->arrow_button, FALSE);

	arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
	gtk_container_add (GTK_CONTAINER (combo_box->priv->arrow_button), arrow);
	gtk_box_pack_end (GTK_BOX (combo_box), combo_box->priv->arrow_button, FALSE, FALSE, 0);
	g_signal_connect_swapped (combo_box->priv->arrow_button,
		"button-press-event",
		G_CALLBACK (cb_arrow_pressed), combo_box);
	gtk_widget_show_all (combo_box->priv->arrow_button);

	/*
	 * prelight the display widget when mousing over the arrow.
	 */
	g_signal_connect (combo_box->priv->arrow_button, "state-changed",
			  G_CALLBACK (cb_state_change), combo_box);

	/*
	 * The pop-down container
	 */

	combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP);
	g_object_ref (combo_box->priv->toplevel);
	g_object_set (G_OBJECT (combo_box->priv->toplevel),
		      "type-hint", GDK_WINDOW_TYPE_HINT_COMBO,
		      NULL);

	combo_box->priv->popup = gtk_event_box_new ();
	gtk_container_add (GTK_CONTAINER (combo_box->priv->toplevel),
			   combo_box->priv->popup);
	gtk_widget_show (combo_box->priv->popup);

	combo_box->priv->torn_off = FALSE;
	combo_box->priv->tearoff_window = NULL;

	combo_box->priv->frame = gtk_frame_new (NULL);
	gtk_container_add (GTK_CONTAINER (combo_box->priv->popup),
			   combo_box->priv->frame);
	gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->frame), GTK_SHADOW_OUT);

	g_signal_connect (combo_box->priv->toplevel, "button_press_event",
			  G_CALLBACK (go_combo_box_button_press), combo_box);
	g_signal_connect (combo_box->priv->toplevel, "key_press_event",
			  G_CALLBACK (cb_combo_keypress), combo_box);
}
Пример #13
0
static gint
ensure_button_arrow_widget()
{
    if (!gParts->buttonArrowWidget) {
        ensure_toggle_button_widget();

        gParts->buttonArrowWidget = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
        gtk_container_add(GTK_CONTAINER(gParts->toggleButtonWidget), gParts->buttonArrowWidget);
        gtk_widget_realize(gParts->buttonArrowWidget);
    }
    return MOZ_GTK_SUCCESS;
}
Пример #14
0
static GtkWidget *
fcombo_create_arrow (SheetObject *so)
{
	GnmFilterCombo *fcombo = GNM_FILTER_COMBO (so);
	GtkWidget *arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
	gtk_style_context_add_class (gtk_widget_get_style_context (arrow),
				     "auto-filter");
	fcombo_arrow_format (fcombo, arrow);
	g_signal_connect_object (G_OBJECT (so),
		"cond-changed",
		G_CALLBACK (fcombo_arrow_format), arrow, 0);
	return arrow;
}
Пример #15
0
static void setup_toolbar ()
{
    GtkWidget *menu;
    GtkWidget *add_bookmark;
    GtkWidget *add_folder;
    GtkToggleButton *button;
    GtkWidget *hbox, *arrow, *label;

    /* add button */
    menu = gtk_menu_new ();
    add_bookmark = gtk_menu_item_new_with_mnemonic ("Add _Bookmark");
    add_folder = gtk_menu_item_new_with_mnemonic ("Add _Folder");
    
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), add_bookmark);
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), add_folder);
    gtk_widget_show_all (menu);
    editor->add_menu = GTK_MENU (menu);

    g_signal_connect (add_bookmark, "activate",
                      G_CALLBACK (add_bookmark_cb), NULL);

    g_signal_connect (add_folder, "activate",
                      G_CALLBACK (add_folder_cb), NULL);


    button = editor->add_button;
    gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
    g_signal_connect (button, "button_press_event",
                      G_CALLBACK (button_press_cb), NULL);

    hbox = gtk_hbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (button), hbox);

    label = gtk_label_new ("Add");
    gtk_box_pack_start (GTK_BOX (hbox), label,
                        FALSE, FALSE, 0);
    arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
    gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);

	g_signal_connect (menu, "deactivate", G_CALLBACK (menu_deactivate_cb), 
                      button);

    /* other button */
    g_signal_connect (editor->delete_button, "clicked",
                      G_CALLBACK (delete_cb), NULL);
    
    g_signal_connect (editor->save_button, "clicked",
                      G_CALLBACK (save_button_clicked_cb), NULL);
    g_signal_connect (editor->connect_button, "clicked",
                      G_CALLBACK (connect_button_clicked_cb), NULL);
}
Пример #16
0
static GtkWidget*
create_zoom_widget(DDisplay *ddisp) { 
  GtkWidget *combo;
  GtkWidget *entry;
  GtkWidget *menu;
  GtkWidget *button;
  GtkWidget *arrow;

  combo = gtk_hbox_new(FALSE, 0);
  entry = gtk_entry_new();
  g_signal_connect (G_OBJECT (entry), "activate",
		    G_CALLBACK(zoom_activate_callback),
		      ddisp);
  gtk_box_pack_start(GTK_BOX(combo), entry, TRUE, TRUE, 0);
  g_object_set_data (G_OBJECT(combo), "user_data", entry);
  gtk_entry_set_width_chars(GTK_ENTRY(entry), 8);
  gtk_widget_show(entry);

  button = gtk_button_new();
#if GTK_CHECK_VERSION(2,18,0)
  gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
#else
  GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
#endif
  arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
  gtk_container_add(GTK_CONTAINER(button), arrow);
  gtk_box_pack_start(GTK_BOX(combo), button, TRUE, TRUE, 0);
  g_object_set_data (G_OBJECT(combo), "user_data", entry);
  gtk_widget_show_all(button);

  menu = gtk_menu_new();
  zoom_add_zoom_amount(menu, "800%", ddisp);
  zoom_add_zoom_amount(menu, "400%", ddisp);
  zoom_add_zoom_amount(menu, "200%", ddisp);
  zoom_add_zoom_amount(menu, "100%", ddisp);
  zoom_add_zoom_amount(menu, "50%", ddisp);
  zoom_add_zoom_amount(menu, "25%", ddisp);
  zoom_add_zoom_amount(menu, "12%", ddisp);

  gtk_widget_show_all(menu);

  g_signal_connect (G_OBJECT (button), "button_press_event",
		    G_CALLBACK(zoom_popup_menu),
		      menu);

  return combo;
}
Пример #17
0
static GtkWidget *
make_sbutton (GtkArrowType type, void *click_cb, void *userdata)
{
    GtkWidget *button, *arrow;

    button = gtk_button_new ();
    arrow = gtk_arrow_new (type, GTK_SHADOW_NONE);
    gtk_container_add (GTK_CONTAINER (button), arrow);
    gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
    g_signal_connect (G_OBJECT (button), "clicked",
                      G_CALLBACK (click_cb), userdata);
    g_signal_connect (G_OBJECT (button), "scroll_event",
                      G_CALLBACK (tab_scroll_cb), userdata);
    gtk_widget_show (arrow);

    return button;
}
Пример #18
0
static void
gctt_init (GncCombott *combott)
{
    GtkWidget *hbox;
    GtkWidget *label;
    GtkWidget *arrow;
    GtkWidget *button;
    GtkWidget *sep;

    GncCombottPrivate *priv = GNC_COMBOTT_GET_PRIVATE (combott);

    priv->active = 0;
    priv->text_col = 0;
    priv->tip_col = 1;

    hbox = gtk_hbox_new(FALSE, 0);

    arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
    gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);

    sep = gtk_vseparator_new();
    gtk_box_pack_end (GTK_BOX (hbox), sep, FALSE, FALSE, 0);

    label = gtk_label_new(NULL);
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
    priv->label = label;

    button = gtk_button_new();
    gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(hbox));
    priv->button = button;

    gtk_container_add(GTK_CONTAINER(combott), GTK_WIDGET(button));

    g_signal_connect (button, "event",
                      G_CALLBACK (button_press_cb), combott);

    gtk_widget_set_has_tooltip (GTK_WIDGET(combott), TRUE);

    g_signal_connect(G_OBJECT(combott), "query-tooltip",
                     G_CALLBACK(which_tooltip_cb), combott);

    g_signal_connect(G_OBJECT(combott), "size-allocate",
                     G_CALLBACK(button_getsize_cb), combott);

    gtk_widget_show(GTK_WIDGET(priv->button));
}
Пример #19
0
static void
dia_pattern_selector_init (DiaPatternSelector *ps)
{
  ps->state = gtk_toggle_button_new_with_label(_("No"));
  g_signal_connect(G_OBJECT(ps->state), "toggled",
                   G_CALLBACK (_pattern_toggled), ps);
  gtk_widget_show (ps->state);

  ps->menu_button = gtk_button_new();
  gtk_container_add(GTK_CONTAINER(ps->menu_button),
		    gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_OUT));
  g_signal_connect(G_OBJECT(ps->menu_button), "button_press_event",
		   G_CALLBACK(_popup_button_press), ps);
  gtk_widget_show_all (ps->menu_button);

  gtk_box_pack_start(GTK_BOX(ps), GTK_WIDGET(ps->state), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(ps), GTK_WIDGET(ps->menu_button), FALSE, TRUE, 0);
}
Пример #20
0
static void
gnc_query_list_column_title (GNCQueryList *list, gint column, const gchar *title)
{
    GtkWidget *hbox, *label, *arrow;

    hbox = gtk_hbox_new(FALSE, 2);
    gtk_widget_show(hbox);
    gtk_clist_set_column_widget(GTK_CLIST(list), column, hbox);

    label = gtk_label_new(title);
    gtk_widget_show(label);
    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);

    arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_ETCHED_IN);
    list->title_arrows[column] = arrow;
    if (column == 0)
        gtk_widget_show(arrow);
    gtk_box_pack_end(GTK_BOX(hbox), arrow, FALSE, FALSE, 0);
}
Пример #21
0
void ygtk_menu_button_set_label (YGtkMenuButton *button, const gchar *label)
{
	if (!button->label) {
		GtkWidget *hbox, *arrow;
		hbox = gtk_hbox_new (FALSE, 4);
		arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
		button->label = gtk_label_new ("");
		gtk_box_pack_start (GTK_BOX (hbox), button->label, TRUE, TRUE, 0);
		gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, TRUE, 0);
		gtk_container_add (GTK_CONTAINER (button), hbox);
		gtk_widget_show_all (hbox);
	}
	if (label && *label) {
		gtk_widget_show (button->label);
		gtk_label_set_text_with_mnemonic (GTK_LABEL (button->label), label);
	}
	else
		gtk_widget_hide (button->label);
}
Пример #22
0
static GtkWidget*
add_arrow_button (GtkBox      * box,
		  GtkArrowType  arrow,
		  GtkWidget   * display)
{
	GtkWidget* button = add_button (box,
					gtk_arrow_new (arrow,
						       GTK_SHADOW_IN),
					display);

	if (arrow == GTK_ARROW_RIGHT) {
		bind_sensitive (button,  "clicked", G_CALLBACK (display_scroll_right),
				display, "can-scroll-right");
	} else {
		bind_sensitive (button,  "clicked", G_CALLBACK (display_scroll_left),
				display, "can-scroll-left");
	}

	return button;
}
Пример #23
0
static void
thunar_chooser_button_init (ThunarChooserButton *chooser_button)
{
  GtkWidget *separator;
  GtkWidget *arrow;
  GtkWidget *hbox;

  /* grab a reference on the mime database */
  chooser_button->database = thunar_vfs_mime_database_get_default ();

  gtk_widget_push_composite_child ();

  chooser_button->button = gtk_button_new ();
  g_signal_connect_swapped (G_OBJECT (chooser_button->button), "pressed", G_CALLBACK (thunar_chooser_button_pressed), chooser_button);
  gtk_box_pack_start (GTK_BOX (chooser_button), chooser_button->button, TRUE, TRUE, 0);
  gtk_widget_show (chooser_button->button);

  hbox = gtk_hbox_new (FALSE, 4);
  gtk_container_add (GTK_CONTAINER (chooser_button->button), hbox);
  gtk_widget_show (hbox);

  chooser_button->image = gtk_image_new ();
  gtk_box_pack_start (GTK_BOX (hbox), chooser_button->image, FALSE, FALSE, 0);
  gtk_widget_show (chooser_button->image);

  chooser_button->label = g_object_new (GTK_TYPE_LABEL, "xalign", 0.0f, "yalign", 0.0f, NULL);
  gtk_box_pack_start (GTK_BOX (hbox), chooser_button->label, TRUE, TRUE, 0);
  gtk_widget_show (chooser_button->label);

  separator = g_object_new (GTK_TYPE_VSEPARATOR, "height-request", 16, NULL);
  gtk_box_pack_start (GTK_BOX (hbox), separator, FALSE, FALSE, 0);
  gtk_widget_show (separator);

  arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
  gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
  gtk_widget_show (arrow);

  gtk_widget_pop_composite_child ();
}
Пример #24
0
void create_symbol (WindowckPlugin *wckp)
{
    if (wckp->icon->symbol)
        gtk_widget_destroy (wckp->icon->symbol);

    if (wckp->prefs->show_icon)
        wckp->icon->symbol = gtk_image_new();
    else if (wckp->prefs->show_window_menu)
        wckp->icon->symbol = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
    else
        wckp->icon->symbol = NULL;


    if (wckp->prefs->show_icon || wckp->prefs->show_window_menu)
    {
        gtk_container_add (GTK_CONTAINER (wckp->icon->eventbox), wckp->icon->symbol);
        gtk_widget_show_all (GTK_WIDGET(wckp->icon->eventbox));
    }
    else
    {
        gtk_widget_hide_all (GTK_WIDGET(wckp->icon->eventbox));
    }
}
Пример #25
0
void gcb_main()
{

  GtkWidget *hbox,*vbox;
  int i;
#if 1
  if (gcb_enabled==old_gcb_enabled && gcb_position==old_gcb_position && gcb_position_x==old_gcb_position_x
      && gcb_position_y==old_gcb_position_y)
    return;
#endif
  old_gcb_enabled = gcb_enabled;
  old_gcb_position = gcb_position;
  old_gcb_position_x = gcb_position_x;
  old_gcb_position_y = gcb_position_y;

  if (mainwin) {
    gtk_widget_destroy(mainwin);
    mainwin = NULL;
  }
#if 0
  if (button_bar_tips)
    gtk_widget_destroy(button_bar_tips);
#endif
  if (hist_window) {
    gtk_widget_destroy(hist_window);
    hist_window = NULL;
  }

  if (!gcb_enabled)
    return;

//  printf("gcb_position:%d\n", gcb_position);

  static char geo[][2]={{0,0},{'+','-'},{'+','+'},{'-','-'},{'-','+'}};
  g_free(geomstr);
  geomstr = g_strdup_printf("%c%d%c%d",
  geo[gcb_position][0], gcb_position_x, geo[gcb_position][1], gcb_position_y);
  dbg("geomstr %s\n", geomstr);

  if (!buttonArr) {
    buttonArr=(GtkWidget**)g_malloc(gcb_button_n * sizeof(GtkWidget *));
    buttonStr=(gchar**)g_malloc0(gcb_button_n * sizeof(gchar *));
  }

  if (!hist_strArr) {
    hist_strArr=(gchar**)g_malloc0(gcb_history_n * sizeof(gchar *));
    hist_buttonArr=(GtkWidget**)g_malloc(gcb_history_n * sizeof(GtkWidget *));
  }

  mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_has_resize_grip(GTK_WINDOW(mainwin), FALSE);
  gtk_window_set_decorated(GTK_WINDOW(mainwin),FALSE);
  gtk_window_set_focus_on_map (GTK_WINDOW(mainwin), FALSE);

  hist_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_has_resize_grip(GTK_WINDOW(hist_window), FALSE);

  char icon_path[40];
  sys_icon_fname("gcb.png", icon_path);
  GtkWidget *win_icon=gtk_image_new_from_file(icon_path);
  gtk_window_set_icon(GTK_WINDOW(mainwin),
     gtk_image_get_pixbuf(GTK_IMAGE(win_icon)));
  gtk_window_set_icon(GTK_WINDOW(hist_window),
     gtk_image_get_pixbuf(GTK_IMAGE(win_icon)));

  // Under gnome 2.0, the mainwin is not fixed if decorated, annoying
  gtk_window_set_decorated(GTK_WINDOW(hist_window),FALSE);
  gtk_window_set_skip_pager_hint(GTK_WINDOW(hist_window),TRUE);
  gtk_window_set_skip_taskbar_hint(GTK_WINDOW(hist_window),TRUE);
  gtk_window_set_title (GTK_WINDOW (hist_window),"gcb history");

  gtk_window_set_title (GTK_WINDOW(mainwin), "gcb: gtk copy-paste buffer");
  gtk_window_stick(GTK_WINDOW(mainwin));

//  g_signal_connect(G_OBJECT (mainwin),"destroy", G_CALLBACK (do_exit), NULL);
  g_signal_connect(G_OBJECT (hist_window),"delete_event",
    G_CALLBACK (delete_hist_win), NULL);
  g_signal_connect(G_OBJECT (hist_window),"focus-out-event",
    G_CALLBACK (hist_focus_out_callback), NULL);

#if !GTK_CHECK_VERSION(2,12,0)
  button_bar_tips = gtk_tooltips_new ();
#endif

  hbox = gtk_hbox_new (FALSE, 1);
  gtk_container_add (GTK_CONTAINER(mainwin), hbox);

  gtk_window_parse_geometry(GTK_WINDOW(mainwin),geomstr);

  for(i=0;i<gcb_button_n;i++) {
    buttonArr[i] = gtk_button_new_with_label ("---");
//    gtk_container_set_border_width(GTK_CONTAINER(buttonArr[i]),0);
    gtk_box_pack_start (GTK_BOX(hbox), buttonArr[i], TRUE, TRUE, FALSE);
    gtk_widget_show (buttonArr[i]);
    g_signal_connect (G_OBJECT (buttonArr[i]), "button-press-event",
                      G_CALLBACK (get_mouse_button), (gpointer) buttonArr[i]);
#if 0
    g_signal_connect (G_OBJECT (buttonArr[i]), "key-press-event",
                      G_CALLBACK (key_press_event), NULL);
#endif
#if 1
    g_signal_connect (G_OBJECT (buttonArr[i]), "scroll-event",
                      G_CALLBACK (gcb_button_scroll_event), NULL);
#endif
  }

  vbox = gtk_vbox_new (FALSE, 1);
  gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL);
  gtk_container_add (GTK_CONTAINER(hist_window), vbox);

  for(i=0;i<gcb_history_n;i++) {
    hist_buttonArr[i] = gtk_button_new_with_label ("---");
    gtk_container_set_border_width(GTK_CONTAINER(hist_buttonArr[i]),0);
    gtk_box_pack_start (GTK_BOX(vbox), hist_buttonArr[i], TRUE, TRUE, FALSE);
    gtk_widget_show (hist_buttonArr[i]);
    g_signal_connect (G_OBJECT (hist_buttonArr[i]), "button-press-event",
                      G_CALLBACK (hist_get_mouse_button), (gpointer) hist_buttonArr[i]);
#if 1
    g_signal_connect (G_OBJECT (hist_buttonArr[i]), "key-press-event",
                      G_CALLBACK (hist_key_press_event), NULL);
#endif
  }

#if 1
  // need this because on win32 scoll is not recieved if win is not focused.
  gtk_box_pack_start (GTK_BOX (hbox), gtk_vseparator_new(), FALSE, FALSE, 0);
  GtkWidget *eve_arrow = gtk_event_box_new();
  gtk_event_box_set_visible_window (GTK_EVENT_BOX(eve_arrow), FALSE);
  gtk_box_pack_start (GTK_BOX(hbox), eve_arrow, FALSE, FALSE, FALSE);
    g_signal_connect(G_OBJECT(eve_arrow),"button-press-event", G_CALLBACK(mouse_button_callback), NULL);
  gtk_container_add(GTK_CONTAINER(eve_arrow), gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_IN));
#endif


  gtk_widget_show_all(hbox);
  gtk_widget_show (vbox);
  gtk_widget_show (mainwin);


  pclipboard_prim = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
  pclipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);

  set_snoop_button(buttonArr[0]);
  get_selection(pclipboard);
  get_selection(pclipboard_prim);
  gtk_container_set_border_width(GTK_CONTAINER(hbox),0);
  gtk_container_set_border_width(GTK_CONTAINER(mainwin),0);

  gtk_window_parse_geometry(GTK_WINDOW(mainwin),geomstr);
#if GTK_CHECK_VERSION(2,6,0)
  g_signal_connect(pclipboard, "owner-change", G_CALLBACK (cb_owner_change), NULL);
  g_signal_connect(pclipboard_prim, "owner-change", G_CALLBACK (cb_owner_change), NULL);
#endif
}
Пример #26
0
GtkWidget *
create_file_view(FileView *view)
{
  GtkWidget *vbox;
  GtkWidget *hbox;
  GtkWidget *menu_bar;
  GtkWidget *button;
  GtkWidget *pixmapwid;
  GdkPixmap *pixmap;
  GdkBitmap *mask;
  GtkStyle *style;
  GdkFont *font;
  GtkWidget *sw;
  gint i;

  /* Top Pane */
  vbox = gtk_vbox_new(FALSE, 0);
  gtk_widget_show(vbox);

  menu_bar = create_filelist_menu_bar(view);
  gtk_widget_show(menu_bar);
  gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0);

  hbox = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox);

  /* Show/Hide Button */
  if (view == &app.right_view)
    button = gtk_button_new_with_label("<");
  else
    button = gtk_button_new_with_label(">");
  GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
  gtk_signal_connect(GTK_OBJECT(button), "button_press_event", 
                    GTK_SIGNAL_FUNC(show_hide_file_view_cb), view);
  gtk_tooltips_set_tip(GTK_TOOLTIPS(app.tooltips), button,
                       _("Left Click: Maximize/Minimize File View\n"
                         "Right Click: Sync Dirs"), NULL);
  gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
  gtk_widget_show(button);

  /* Hidden files toggle button */
  view->hidden_toggle = gtk_toggle_button_new_with_label("H");
  GTK_WIDGET_UNSET_FLAGS(view->hidden_toggle, GTK_CAN_FOCUS);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(view->hidden_toggle),
                               view->show_hidden);
  gtk_signal_connect(GTK_OBJECT(view->hidden_toggle), "toggled",
                     GTK_SIGNAL_FUNC(toggle_show_hidden_cb), view);
  gtk_tooltips_set_tip(GTK_TOOLTIPS(app.tooltips), view->hidden_toggle,
                       _("Show/Hide hidden files"), NULL);
  gtk_box_pack_start(GTK_BOX(hbox), view->hidden_toggle, FALSE, FALSE, 0);
  gtk_widget_show(view->hidden_toggle);

  /* Dir Entry Combo */
  view->dir_entry = gtk_combo_new();
  gtk_combo_disable_activate(GTK_COMBO(view->dir_entry));
  gtk_combo_set_use_arrows_always(GTK_COMBO(view->dir_entry), TRUE);
  gtk_combo_set_case_sensitive(GTK_COMBO(view->dir_entry), TRUE);
  gtk_signal_connect(GTK_OBJECT(GTK_COMBO(view->dir_entry)->entry), 
              "activate", GTK_SIGNAL_FUNC(dir_entry_cb), view);
  gtk_signal_connect(GTK_OBJECT(GTK_COMBO(view->dir_entry)->popwin),
              "hide", GTK_SIGNAL_FUNC(dir_popwin_cb), view);
  gtk_box_pack_start(GTK_BOX(hbox), view->dir_entry, TRUE, TRUE, 0);
  gtk_widget_show(view->dir_entry);

  /* Up Dir Button */
  button = gtk_button_new();
  GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
  gtk_signal_connect(GTK_OBJECT(button), "button_press_event",
                     GTK_SIGNAL_FUNC(updir_click_cb), view);
  gtk_tooltips_set_tip(GTK_TOOLTIPS(app.tooltips), button,
                       _("Left Click: Up Dir   Right Click: Home"), NULL);
  gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
  gtk_widget_show(button);

  style = gtk_widget_get_style(app.main_window);
  pixmap = gdk_pixmap_create_from_xpm_d(app.main_window->window, &mask, 
                                        &style->bg[GTK_STATE_NORMAL], 
                                        icon_dirparent_xpm);
  pixmapwid = gtk_pixmap_new(pixmap, mask);
  gtk_container_add(GTK_CONTAINER(button), pixmapwid);
  gtk_widget_show(pixmapwid);

  gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

  sw = gtk_scrolled_window_new(NULL, NULL);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
          GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW(sw), cfg.scrollbar_pos);
  gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
  gtk_widget_show(sw);

  /* File List */
  view->clist = gtk_clist_new(MAX_COLUMNS);
  for (i = 0; i < MAX_COLUMNS; i++)
  {
    GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
    GtkWidget *label = gtk_label_new(all_columns[i].title);

    view->sort_arrows[i] = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_IN);
    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0);
    gtk_box_pack_end(GTK_BOX(hbox), view->sort_arrows[i], FALSE, TRUE, 0);

    gtk_widget_show(label);
    gtk_widget_show(hbox);
    gtk_clist_set_column_widget(GTK_CLIST(view->clist), i, hbox);
    GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(view->clist)->column[i].button,
                           GTK_CAN_FOCUS);
  } 
  gtk_clist_column_titles_show(GTK_CLIST(view->clist));
  gtk_clist_set_shadow_type(GTK_CLIST(view->clist), GTK_SHADOW_ETCHED_IN);
  gtk_clist_set_selection_mode(GTK_CLIST(view->clist), GTK_SELECTION_EXTENDED);
  gtk_clist_set_use_drag_icons(GTK_CLIST(view->clist), TRUE);
  gtk_clist_set_row_height(GTK_CLIST(view->clist), 0);
  
  font = gdk_font_load(cfg.list_font);
  if (font != NULL)
  {
    style = gtk_style_copy(gtk_widget_get_style(view->clist));
    style->font = font;
    gtk_widget_set_style(view->clist, style);
  }

  for (i = 0; i < MAX_COLUMNS; i++)
  {
    gtk_clist_set_column_width(GTK_CLIST(view->clist), i, all_columns[i].size);
    gtk_clist_set_column_visibility(GTK_CLIST(view->clist), i,
                                    all_columns[i].is_visible);
  }

  gtk_signal_connect(GTK_OBJECT(view->clist), "select_row",
                     GTK_SIGNAL_FUNC(select_row_cb), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "button_press_event",
                     GTK_SIGNAL_FUNC(mouse_click_cb), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "key_press_event",
                     GTK_SIGNAL_FUNC(file_list_key_press_cb), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "click_column",
                     GTK_SIGNAL_FUNC(column_button_cb), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "drag_data_get",
                     GTK_SIGNAL_FUNC(clist_drag_data_get), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "drag_motion",
                     GTK_SIGNAL_FUNC(clist_drag_motion), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "drag_leave",
                     GTK_SIGNAL_FUNC(clist_drag_leave), view);
  gtk_signal_connect(GTK_OBJECT(view->clist), "drag_data_received",
                     GTK_SIGNAL_FUNC(clist_drag_data_received), view);
  gtk_drag_dest_set(view->clist, GTK_DEST_DEFAULT_MOTION |
    GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, target_table,
    n_targets, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK |
    GDK_ACTION_ASK);

  gtk_container_add(GTK_CONTAINER(sw), view->clist);
  gtk_widget_show(view->clist);

  /* Set the CLIST_COLOR for resetting from the DRAG_HILIGHT color */
  {
    GtkStyle *style = gtk_widget_get_style(view->clist);
    CLIST_COLOR.red   = style->base[GTK_STATE_NORMAL].red;
    CLIST_COLOR.green = style->base[GTK_STATE_NORMAL].green;
    CLIST_COLOR.blue  = style->base[GTK_STATE_NORMAL].blue;
  }

  return vbox;
}
Пример #27
0
void FindTextureDialog::BuildDialog(){
	GtkWidget *dlg, *vbox, *hbox, *table, *label;
	GtkWidget *button, *check, *entry, *arrow;

	dlg = m_pWidget;
	gtk_window_set_title( GTK_WINDOW( dlg ), _( "Find / Replace Texture(s)" ) );
	gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );

	hbox = gtk_hbox_new( FALSE, 5 );
	gtk_container_add( GTK_CONTAINER( dlg ), hbox );
	gtk_container_set_border_width( GTK_CONTAINER( hbox ), 5 );
	gtk_widget_show( hbox );

	vbox = gtk_vbox_new( FALSE, 5 );
	gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 5 );
	gtk_widget_show( vbox );

	table = gtk_table_new( 2, 3, FALSE );
	gtk_box_pack_start( GTK_BOX( vbox ), table, TRUE, TRUE, 0 );
	gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
	gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
	gtk_widget_show( table );

	label = gtk_label_new( _( "Find:" ) );
	gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
					  (GtkAttachOptions) ( GTK_FILL ),
					  (GtkAttachOptions) ( 0 ), 0, 0 );
	gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
	gtk_widget_show( label );

	label = gtk_label_new( _( "Replace:" ) );
	gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
					  (GtkAttachOptions) ( GTK_FILL ),
					  (GtkAttachOptions) ( 0 ), 0, 0 );
	gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
	gtk_widget_show( label );

	entry = gtk_entry_new();
	gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
					  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
					  (GtkAttachOptions) ( 0 ), 0, 0 );
	gtk_widget_show( entry );
	g_signal_connect( G_OBJECT( entry ), "focus-in-event",
						G_CALLBACK( find_focus_in ), NULL );
	AddDialogData( entry, &m_strFind, DLG_ENTRY_TEXT );

	button = gtk_button_new();
	gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
					  (GtkAttachOptions) ( GTK_FILL ),
					  (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
	gtk_widget_show( button );
	g_signal_connect( G_OBJECT( button ), "clicked",
						G_CALLBACK( find_clicked ), entry );

	arrow = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT );
	gtk_container_add( GTK_CONTAINER( button ), arrow );
	gtk_widget_show( arrow );

	entry = gtk_entry_new();
	gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
					  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
					  (GtkAttachOptions) ( 0 ), 0, 0 );
	gtk_widget_show( entry );
	g_signal_connect( G_OBJECT( entry ), "focus-in-event",
						G_CALLBACK( replace_focus_in ), NULL );
	AddDialogData( entry, &m_strReplace, DLG_ENTRY_TEXT );

	button = gtk_button_new();
	gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
					  (GtkAttachOptions) ( GTK_FILL ),
					  (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
	gtk_widget_show( button );
	g_signal_connect( G_OBJECT( button ), "clicked",
						G_CALLBACK( find_clicked ), entry );

	arrow = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT );
	gtk_container_add( GTK_CONTAINER( button ), arrow );
	gtk_widget_show( arrow );

	check = gtk_check_button_new_with_label( _( "Use selected brushes only" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), check, TRUE, TRUE, 0 );
	gtk_widget_show( check );
	AddDialogData( check, &m_bSelectedOnly, DLG_CHECK_BOOL );

	check = gtk_check_button_new_with_label( _( "Replace everywhere (selected/active), don't test against Find" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), check, TRUE, TRUE, 0 );
	gtk_widget_show( check );
	AddDialogData( check, &m_bForce, DLG_CHECK_BOOL );

	check = gtk_check_button_new_with_label( _( "Live updates from Texture/Camera windows" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), check, TRUE, TRUE, 0 );
	gtk_widget_show( check );
	AddDialogData( check, &m_bLive, DLG_CHECK_BOOL );

	vbox = gtk_vbox_new( FALSE, 5 );
	gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 0 );
	gtk_widget_show( vbox );

	button = gtk_button_new_with_label( _( "Find" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
	g_signal_connect( G_OBJECT( button ), "clicked",
						G_CALLBACK( OnFind ), NULL );
	gtk_widget_set_size_request( button, 60, -1 );
	gtk_widget_show( button );

	button = gtk_button_new_with_label( _( "OK" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
	g_signal_connect( G_OBJECT( button ), "clicked",
						G_CALLBACK( OnOK ), NULL );
	gtk_widget_set_size_request( button, 60, -1 );
	gtk_widget_show( button );

	button = gtk_button_new_with_label( _( "Apply" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
	g_signal_connect( G_OBJECT( button ), "clicked",
						G_CALLBACK( OnApply ), NULL );
	gtk_widget_set_size_request( button, 60, -1 );
	gtk_widget_show( button );

	button = gtk_button_new_with_label( _( "Close" ) );
	gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
	g_signal_connect( G_OBJECT( button ), "clicked",
						G_CALLBACK( OnClose ), NULL );
	gtk_widget_set_size_request( button, 60, -1 );
	gtk_widget_show( dlg );
}
Пример #28
0
void
ags_navigation_init(AgsNavigation *navigation)
{
  GtkHBox *hbox;
  GtkLabel *label;

  navigation->flags = 0;

  navigation->soundcard = NULL;

  g_signal_connect_after(G_OBJECT(navigation), "parent-set\0",
			 G_CALLBACK(ags_navigation_parent_set_callback), NULL);

  /* GtkWidget */
  hbox = (GtkHBox *) gtk_hbox_new(FALSE, 0);
  gtk_box_pack_start((GtkBox *) navigation, (GtkWidget *) hbox, FALSE, FALSE, 2);

  navigation->expander = (GtkToggleButton *) gtk_toggle_button_new();
  gtk_box_pack_start((GtkBox*) hbox, (GtkWidget *) navigation->expander, FALSE, FALSE, 2);
  gtk_container_add((GtkContainer *) navigation->expander,
		    (GtkWidget *) gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE));

  label = (GtkLabel *) gtk_label_new("bpm\0");
  gtk_box_pack_start((GtkBox*) hbox, (GtkWidget *) label, FALSE, FALSE, 2);

  navigation->bpm = (GtkSpinButton *) gtk_spin_button_new_with_range(1.0, 1000.0, 1.0);
  navigation->bpm->adjustment->value = 120.0;
  gtk_box_pack_start((GtkBox*) hbox, (GtkWidget *) navigation->bpm, FALSE, FALSE, 2);

  navigation->current_bpm = 120.0;

  navigation->rewind = (GtkToggleButton *) g_object_new(GTK_TYPE_TOGGLE_BUTTON,
							"image\0", (GtkWidget *) gtk_image_new_from_stock(GTK_STOCK_MEDIA_REWIND, GTK_ICON_SIZE_LARGE_TOOLBAR),
							NULL);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->rewind, FALSE, FALSE, 0);

  navigation->previous = (GtkButton *) g_object_new(GTK_TYPE_BUTTON,
						    "image\0", (GtkWidget *) gtk_image_new_from_stock(GTK_STOCK_MEDIA_PREVIOUS, GTK_ICON_SIZE_LARGE_TOOLBAR),
						    NULL);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->previous, FALSE, FALSE, 0);

  navigation->play = (GtkToggleButton *) g_object_new(GTK_TYPE_TOGGLE_BUTTON,
						      "image\0", (GtkWidget *) gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_LARGE_TOOLBAR),
						      NULL);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->play, FALSE, FALSE, 0);

  navigation->stop = (GtkButton *) g_object_new(GTK_TYPE_BUTTON,
						"image\0", (GtkWidget *) gtk_image_new_from_stock(GTK_STOCK_MEDIA_STOP, GTK_ICON_SIZE_LARGE_TOOLBAR),
						NULL);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->stop, FALSE, FALSE, 0);

  navigation->next = (GtkButton *) g_object_new(GTK_TYPE_BUTTON,
						"image\0", (GtkWidget *) gtk_image_new_from_stock(GTK_STOCK_MEDIA_NEXT, GTK_ICON_SIZE_LARGE_TOOLBAR),
						NULL);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->next, FALSE, FALSE, 0);

  navigation->forward = (GtkToggleButton *) g_object_new(GTK_TYPE_TOGGLE_BUTTON,
							 "image\0", (GtkWidget *) gtk_image_new_from_stock(GTK_STOCK_MEDIA_FORWARD, GTK_ICON_SIZE_LARGE_TOOLBAR),
							 NULL);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->forward, FALSE, FALSE, 0);


  navigation->loop = (GtkCheckButton *) gtk_check_button_new_with_label("loop\0");
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(navigation->loop),
			       TRUE);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->loop, FALSE, FALSE, 2);

  label = (GtkLabel *) gtk_label_new("position\0");
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) label, FALSE, FALSE, 2);

  navigation->position_time = (GtkLabel *) gtk_label_new(g_strdup("00:00.00\0"));
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->position_time, FALSE, FALSE, 2);

  navigation->position_tact = (GtkSpinButton *) gtk_spin_button_new_with_range(0.0, AGS_NOTE_EDIT_MAX_CONTROLS * 64.0, 1.0);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->position_tact, FALSE, FALSE, 2);


  label = (GtkLabel *) gtk_label_new("duration\0");
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) label, FALSE, FALSE, 2);

  navigation->duration_time = (GtkLabel *) gtk_label_new(NULL);
  g_object_set(navigation->duration_time,
	       "label\0", g_strdup("0000:00.00\0"),
	       NULL);
  gtk_widget_queue_draw(navigation->duration_time);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->duration_time, FALSE, FALSE, 2);

  navigation->duration_tact = (GtkSpinButton *) gtk_spin_button_new_with_range(0.0, AGS_NOTE_EDIT_MAX_CONTROLS * 64.0, 1.0);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->duration_tact, FALSE, FALSE, 2);


  /* expansion */
  hbox = (GtkHBox *) gtk_hbox_new(FALSE, 0);
  //  GTK_WIDGET_SET_FLAGS((GtkWidget *) hbox, GTK_NO_SHOW_ALL);
  gtk_box_pack_start((GtkBox *) navigation, (GtkWidget *) hbox, FALSE, FALSE, 2);

  label = (GtkLabel *) gtk_label_new("loop L\0");
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) label, FALSE, FALSE, 2);

  navigation->loop_left_tact = (GtkSpinButton *) gtk_spin_button_new_with_range(0.0, 65000.0, 1.0);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->loop_left_tact, FALSE, FALSE, 2);

  label = (GtkLabel *) gtk_label_new("loop R\0");
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) label, FALSE, FALSE, 2);

  navigation->loop_right_tact = (GtkSpinButton *) gtk_spin_button_new_with_range(0.0, 65000.0, 1.0);
  gtk_spin_button_set_value(navigation->loop_right_tact,
			    4.0);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->loop_right_tact, FALSE, FALSE, 2);

  navigation->scroll = (GtkCheckButton *) gtk_check_button_new_with_label("auto-scroll\0");
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(navigation->scroll),
			       TRUE);
  gtk_box_pack_start((GtkBox *) hbox, (GtkWidget *) navigation->scroll, FALSE, FALSE, 2);
}
Пример #29
0
int l_spisok(int metka, //0-список складов 1-список групп 2-список подразделений в услугах 3-список групп услуг 100-список единиц измерения
int skl, //склад для списка групп
iceb_u_str *kodv, //Возвращаемый код
int podr, //подразделение для которого нужно выбрать список складов
GtkWidget *wpredok)
{
spisok_data data;
char strsql[300];
printf("l_spisok %d %d\n",metka,skl);

data.metka_sp=metka;
data.skl=skl;
data.podr=podr;

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);

gtk_window_set_default_size (GTK_WINDOW  (data.window),-1,600);
//gdk_color_parse("black",&color);
//gtk_widget_modify_bg(data.window,GTK_STATE_NORMAL,&color);

if(metka == 0)
  sprintf(strsql,"%s %s",name_system,gettext("Список складов"));
if(metka == 1)
  sprintf(strsql,"%s %s",name_system,gettext("Список групп"));

if(metka == 2)
  sprintf(strsql,"%s %s",name_system,gettext("Список подразделений"));
if(metka == 3)
  sprintf(strsql,"%s %s",name_system,gettext("Список групп"));

gtk_window_set_title (GTK_WINDOW (data.window),strsql);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

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),NULL);


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);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(spisok_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox);

data.label_kolstr=gtk_label_new (gettext("Выберите нужную запись"));
//gdk_color_parse("green",&color);
//gtk_widget_modify_fg(data.label_kolstr,GTK_STATE_NORMAL,&color);


gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);

data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),400,300);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];

sprintf(strsql,"F2 %s",gettext("Выбор"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(spisok_knopka),&data);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Выбор отмеченной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_widget_show(data.knopka[FK2]);

GtkWidget *arrow=gtk_arrow_new(GTK_ARROW_UP,GTK_SHADOW_OUT);

data.knopka[FK_VVERH]=gtk_button_new();
gtk_container_add(GTK_CONTAINER(data.knopka[FK_VVERH]),arrow);

gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK_VVERH], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK_VVERH]), "pressed",GTK_SIGNAL_FUNC(l_spisok_knopka_vverh_press),&data);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK_VVERH]), "released",GTK_SIGNAL_FUNC(l_spisok_knopka_released),&data);
//tooltips[FK_VVERH]=gtk_tooltips_new();
//gtk_tooltips_set_tip(tooltips[FK_VVERH],data.knopka[FK_VVERH],gettext("Выбор отмеченной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK_VVERH]),(gpointer)FK_VVERH);
gtk_widget_show(data.knopka[FK_VVERH]);
gtk_widget_show(arrow);

arrow=gtk_arrow_new(GTK_ARROW_DOWN,GTK_SHADOW_OUT);


data.knopka[FK_VNIZ]=gtk_button_new();
gtk_container_add(GTK_CONTAINER(data.knopka[FK_VNIZ]),arrow);

gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK_VNIZ], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK_VNIZ]), "pressed",GTK_SIGNAL_FUNC(l_spisok_knopka_vniz_press),&data);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK_VNIZ]), "released",GTK_SIGNAL_FUNC(l_spisok_knopka_released),&data);
//tooltips[FK_VNIZ]=gtk_tooltips_new();
//gtk_tooltips_set_tip(tooltips[FK_VNIZ],data.knopka[FK_VNIZ],gettext("Выбор отмеченной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK_VNIZ]),(gpointer)FK_VNIZ);
gtk_widget_show(data.knopka[FK_VNIZ]);
gtk_widget_show(arrow);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1),data.knopka[FK10],TRUE,TRUE, 0);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]), "clicked",GTK_SIGNAL_FUNC(spisok_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_widget_show(data.knopka[FK10]);


gtk_widget_realize(data.window);
gdk_window_set_cursor(data.window->window,gdk_cursor_new(ICEB_CURSOR));

gtk_widget_grab_focus(data.knopka[FK10]);

spisok_create_list (&data);

//gtk_window_maximize(GTK_WINDOW(data.window));
//gtk_window_fullscreen(GTK_WINDOW(data.window));
gtk_widget_show(data.window);


gtk_main();

printf("l_spisok end\n");
kodv->new_plus(data.kod.ravno());
if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));
return(data.voz);
}
Пример #30
0
static void
gdict_sidebar_init (GdictSidebar *sidebar)
{
  GdictSidebarPrivate *priv;
  GtkWidget *hbox;
  GtkWidget *select_hbox;
  GtkWidget *select_button;
  GtkWidget *close_button;
  GtkWidget *arrow;

  sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar);

  /* we store all the pages inside the list, but we keep
   * a pointer inside the hash table for faster look up
   * times; what's inside the table will be destroyed with
   * the list, so there's no need to supply the destroy
   * functions for keys and values.
   */
  priv->pages = NULL;
  priv->pages_by_id = g_hash_table_new (g_str_hash, g_str_equal);

  /* top option menu */
  hbox = gtk_hbox_new (FALSE, 0);
  gtk_box_pack_start (GTK_BOX (sidebar), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);
  priv->hbox = hbox;

  select_button = gtk_toggle_button_new ();
  gtk_button_set_relief (GTK_BUTTON (select_button), GTK_RELIEF_NONE);
  g_signal_connect (select_button, "button-press-event",
		    G_CALLBACK (gdict_sidebar_select_button_press_cb),
		    sidebar);
  g_signal_connect (select_button, "key-press-event",
		    G_CALLBACK (gdict_sidebar_select_key_press_cb),
		    sidebar);
  priv->select_button = select_button;

  select_hbox = gtk_hbox_new (FALSE, 0);

  priv->label = gtk_label_new (NULL);
  gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
  gtk_box_pack_start (GTK_BOX (select_hbox), priv->label, FALSE, FALSE, 0);
  gtk_widget_show (priv->label);

  arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
  gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
  gtk_widget_show (arrow);

  gtk_container_add (GTK_CONTAINER (select_button), select_hbox);
  gtk_widget_show (select_hbox);

  gtk_box_pack_start (GTK_BOX (hbox), select_button, TRUE, TRUE, 0);
  gtk_widget_show (select_button);

  close_button = gtk_button_new ();
  gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
  gtk_button_set_image (GTK_BUTTON (close_button),
		        gtk_image_new_from_stock (GTK_STOCK_CLOSE,
						  GTK_ICON_SIZE_SMALL_TOOLBAR));
  g_signal_connect (close_button, "clicked",
		    G_CALLBACK (gdict_sidebar_close_clicked_cb),
		    sidebar);
  gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
  gtk_widget_show (close_button);
  priv->close_button = close_button;

  sidebar->priv->menu = gtk_menu_new ();
  g_signal_connect (sidebar->priv->menu, "deactivate",
		    G_CALLBACK (gdict_sidebar_menu_deactivate_cb),
		    sidebar);
  gtk_menu_attach_to_widget (GTK_MENU (sidebar->priv->menu),
		  	     GTK_WIDGET (sidebar),
			     gdict_sidebar_menu_detach_cb);
  gtk_widget_show (sidebar->priv->menu);

  sidebar->priv->notebook = gtk_notebook_new ();
  gtk_notebook_set_show_border (GTK_NOTEBOOK (sidebar->priv->notebook), FALSE);
  gtk_notebook_set_show_tabs (GTK_NOTEBOOK (sidebar->priv->notebook), FALSE);
  gtk_box_pack_start (GTK_BOX (sidebar), sidebar->priv->notebook, TRUE, TRUE, 6);
  gtk_widget_show (sidebar->priv->notebook);
}