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

C++ GTK_EVENT_BOX函数代码示例

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

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



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

示例1: mc_create_command_entry

void
mc_create_command_entry (MCData *mc)
{

    mc->applet_box = icon_entry_new ();
    mc->entry= ICON_ENTRY(mc->applet_box)->entry;
    g_object_set_data (G_OBJECT (mc->applet_box), "mcdata", mc);
    gtk_entry_set_max_length (GTK_ENTRY (mc->entry), MC_MAX_COMMAND_LENGTH);
    
    mc->history_button = gtk_event_box_new ();
    gtk_event_box_set_visible_window (GTK_EVENT_BOX (mc->history_button), FALSE);
    mc->history_image = gtk_image_new_from_stock ("gtk-go-down", 
        GTK_ICON_SIZE_MENU);
    gtk_widget_show (mc->history_image);
    gtk_container_add (GTK_CONTAINER (mc->history_button), mc->history_image);
    icon_entry_pack_widget (ICON_ENTRY(mc->applet_box), mc->history_button, FALSE);
    
    mc->file_select_button = gtk_event_box_new ();
    gtk_event_box_set_visible_window (GTK_EVENT_BOX (mc->file_select_button), FALSE);
    mc->file_select_image = gtk_image_new_from_stock ("gtk-open", 
        GTK_ICON_SIZE_MENU);
    gtk_widget_show (mc->file_select_image);
    gtk_container_add (GTK_CONTAINER (mc->file_select_button), mc->file_select_image);
    icon_entry_pack_widget (ICON_ENTRY(mc->applet_box), 
        mc->file_select_button, FALSE);
    
    g_signal_connect (mc->entry, "key_press_event",
		      G_CALLBACK (command_key_event), mc);
   
    g_signal_connect (mc->entry, "button_press_event",
		      G_CALLBACK (button_press_cb), mc);

    g_signal_connect (mc->file_select_button, "button_press_event",
		      G_CALLBACK (button_press_hack), mc);
          
    g_signal_connect (mc->history_button, "button_press_event",
		      G_CALLBACK (button_press_hack), mc);

    if (!mc->preferences.show_default_theme)
    {
	    gtk_widget_set_name (mc->entry, "minicommander-applet-entry");
	    mc_command_update_entry_color (mc); 
    }
    else
	    gtk_widget_set_name (mc->entry,
			    "minicommander-applet-entry-default");

    mc_command_update_entry_size (mc);

    set_atk_name_description (mc->entry,
			      _("Command line"), 
			      _("Type a command here and Gnome will execute it for you"));
}
开发者ID:Metamorf,项目名称:mini-commander,代码行数:53,代码来源:command_line.c


示例2: assign_cellbutton

static GtkEventBox*
assign_cellbutton(UIMCandWinHorizontalGtk *horizontal_cwin,
		  gint cand_index, gint display_limit)
{
  struct index_button *idxbutton;
  int len;
  GPtrArray *buttons;

  buttons = horizontal_cwin->buttons;
  len = buttons->len;

  if (len <= cand_index) {
    GtkWidget *button;
    GtkWidget *label;

    button = gtk_event_box_new();
    gtk_event_box_set_above_child(GTK_EVENT_BOX(button), TRUE);
    label = gtk_label_new("");
    gtk_container_add(GTK_CONTAINER(button), label);
    scale_label(GTK_EVENT_BOX(button), PANGO_SCALE_LARGE);
    g_signal_connect(button, "button-press-event", G_CALLBACK(button_clicked), horizontal_cwin);
#if GTK_CHECK_VERSION(2, 90, 0)
    g_signal_connect_after(label, "draw", G_CALLBACK(label_draw), horizontal_cwin);
#else
    g_signal_connect_after(label, "expose-event", G_CALLBACK(label_exposed), horizontal_cwin);
#endif
#if GTK_CHECK_VERSION(3, 4, 0)
    gtk_widget_set_hexpand(button, TRUE);
    gtk_widget_set_vexpand(button, TRUE);
    gtk_grid_attach(GTK_GRID(UIM_CAND_WIN_GTK(horizontal_cwin)->view), button,
                    cand_index, 0, 1, 1);
#else
    gtk_table_attach_defaults(GTK_TABLE(UIM_CAND_WIN_GTK(horizontal_cwin)->view), button, cand_index, cand_index + 1, 0, 1);
#endif
    idxbutton = g_malloc(sizeof(struct index_button));
    if (idxbutton) {
      idxbutton->button = GTK_EVENT_BOX(button);
      clear_button(idxbutton, cand_index);
      idxbutton->cand_index_in_page = cand_index;
    }
    g_ptr_array_add(horizontal_cwin->buttons, idxbutton);
  } else {
    idxbutton = g_ptr_array_index(buttons, cand_index);
    idxbutton->cand_index_in_page = cand_index;
  }

  return idxbutton->button;
}
开发者ID:NgoHuy,项目名称:uim,代码行数:48,代码来源:uim-cand-win-horizontal-gtk.c


示例3: ccm_cell_extension_new

CCMCellExtension *
ccm_cell_extension_new (const gchar * path, int width)
{
    g_return_val_if_fail (path != NULL, NULL);

    CCMCellExtension *self = g_object_new (CCM_TYPE_CELL_EXTENSION, NULL);
    GtkWidget *vbox, *hbox, *button;

    self->priv->path = g_strdup (path);

    vbox = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (vbox);
    gtk_container_add (GTK_CONTAINER (self), vbox);

    // Name/description label
    self->priv->name = gtk_label_new ("\n");
    gtk_widget_set_size_request (self->priv->name, width - 4, -1);
    gtk_label_set_use_markup (GTK_LABEL (self->priv->name), TRUE);
    gtk_label_set_line_wrap (GTK_LABEL (self->priv->name), TRUE);
    gtk_widget_show (self->priv->name);
    gtk_box_pack_start (GTK_BOX (vbox), self->priv->name, TRUE, TRUE, 0);

    // Add activation line
    hbox = gtk_hbox_new (FALSE, 5);
    gtk_widget_show (hbox);
    gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
    gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);

    self->priv->author = gtk_label_new ("");
    gtk_label_set_use_markup (GTK_LABEL (self->priv->author), TRUE);
    gtk_widget_show (self->priv->author);
    gtk_box_pack_start (GTK_BOX (hbox), self->priv->author, TRUE, TRUE, 0);

    self->priv->enable = gtk_label_new ("");
    gtk_label_set_use_markup (GTK_LABEL (self->priv->enable), TRUE);
    gtk_label_set_markup (GTK_LABEL (self->priv->enable), "<span size='small'>Enable</span>");
    gtk_widget_show (self->priv->enable);

    button = gtk_button_new ();
    gtk_widget_show (button);
    gtk_container_add (GTK_CONTAINER (button), self->priv->enable);
    gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);

    gtk_event_box_set_above_child (GTK_EVENT_BOX (self), FALSE);
    gtk_event_box_set_visible_window (GTK_EVENT_BOX (self), FALSE);

    return self;
}
开发者ID:burzumishi,项目名称:XCompWMaker,代码行数:48,代码来源:ccm-cell-extension.c


示例4: tabmanagergui_create_label

void tabmanagergui_create_label (GuTabPage* tp, gchar* labeltext) {
    static unsigned count = 0;
    GtkRcStyle* rcstyle = NULL;
    GtkWidget* image = NULL;
    GtkHBox* hbox;

    tp->labelbox = gtk_event_box_new ();
    hbox = GTK_HBOX (gtk_hbox_new (FALSE, 0));
    tp->unsavednr = ++count;
    
    gtk_event_box_set_visible_window (GTK_EVENT_BOX (tp->labelbox), FALSE);
    gtk_container_add (GTK_CONTAINER(tp->labelbox), GTK_WIDGET (hbox));
    
    tp->label = GTK_LABEL (gtk_label_new (labeltext));

    gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (tp->label), TRUE, TRUE, 5);
    
    tp->button = GTK_BUTTON (gtk_button_new());
    image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
    gtk_button_set_image (tp->button, image);
    g_object_set (tp->button, "relief", GTK_RELIEF_NONE, 
                         "focus-on-click", FALSE, NULL);
    gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (tp->button), FALSE,FALSE,0);
    
    rcstyle = gtk_rc_style_new ();
    rcstyle->xthickness = rcstyle->ythickness = 0;
    gtk_widget_modify_style (GTK_WIDGET (tp->button), rcstyle);
    g_object_unref (rcstyle);

    gtk_widget_show_all (GTK_WIDGET (hbox));
}
开发者ID:JasonGross,项目名称:gummi,代码行数:31,代码来源:gui-tabmanager.c


示例5: main

int main(int argc, char *argv[]){

	GtkWidget *window, *eventbox, *label;

	gtk_init (&argc,&argv);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title (GTK_WINDOW (window), "Event Box");
	gtk_container_set_border_width (GTK_CONTAINER (window),10);
	gtk_widget_set_size_request (window, 200, 50);
		
	g_signal_connect (G_OBJECT (window),"destroy",
					  G_CALLBACK(destroy), NULL);

	eventbox = gtk_event_box_new();
	label = gtk_label_new ("Double-Click it!");
	
	/* Set the order in which the widgets will recieve notification of events. */
	gtk_event_box_set_above_child (GTK_EVENT_BOX (eventbox), FALSE);

	g_signal_connect (G_OBJECT (eventbox), "button_press_event", G_CALLBACK (button_pressed), (gpointer) label);
	
	gtk_container_add (GTK_CONTAINER (eventbox), label);
	gtk_container_add (GTK_CONTAINER (window), eventbox);

	/* ALlow the event box to catch button presses, realize the widget, and set the cursor that will be displayed when the mouse is over the event box*/
	gtk_widget_set_events (eventbox, GDK_BUTTON_PRESS_MASK);
	gtk_widget_realize(eventbox);
	gdk_window_set_cursor (eventbox->window, gdk_cursor_new (GDK_HAND1));
	gtk_widget_show_all (window);

	gtk_main();
	return 0;

}
开发者ID:robertrico,项目名称:workspace,代码行数:35,代码来源:eventboxes.c


示例6: gimp_color_bar_init

static void
gimp_color_bar_init (GimpColorBar *bar)
{
  gtk_event_box_set_visible_window (GTK_EVENT_BOX (bar), FALSE);

  bar->orientation = GTK_ORIENTATION_HORIZONTAL;
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:7,代码来源:gimpcolorbar.c


示例7: main

int
main (int argc, char *argv[])
{
	GtkWidget *window;
	GtkWidget *eventbox;
	GtkWidget *icon;

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL);

	icon = gtk_image_new_from_file ("bt-blocked.svg");
	eventbox = gtk_event_box_new ();
	gtk_widget_set_app_paintable(eventbox, TRUE);
	g_signal_connect (G_OBJECT (eventbox), "draw", G_CALLBACK (draw_box_back), NULL);
	gtk_event_box_set_visible_window (GTK_EVENT_BOX (eventbox), TRUE);

	gtk_container_add (GTK_CONTAINER (eventbox), icon);
	gtk_container_add (GTK_CONTAINER (window), eventbox);

	gtk_widget_show_all (window);

	gtk_main ();

	return 0;
}
开发者ID:lcp,项目名称:gtk-fun,代码行数:27,代码来源:widget-back.c


示例8: g_set_error_literal

Splash *oregano_splash_new (GError **error)
{
	GtkBuilder *gui;
	Splash *sp;
	GtkEventBox *event;

	if ((gui = gtk_builder_new ()) == NULL) {
		g_set_error_literal (error, OREGANO_ERROR, OREGANO_UI_ERROR_NO_BUILDER,
		                     _ ("Failed to spawn builder"));
		return NULL;
	}
	gtk_builder_set_translation_domain (gui, NULL);

	if (gtk_builder_add_from_file (gui, OREGANO_UIDIR "/splash.ui", error) <= 0) {
		return NULL;
	}

	sp = g_new0 (Splash, 1);
	sp->can_destroy = FALSE;

	sp->win = GTK_WINDOW (gtk_builder_get_object (gui, "splash"));
	sp->lbl = GTK_LABEL (gtk_builder_get_object (gui, "label"));
	sp->progress = GTK_WIDGET (gtk_builder_get_object (gui, "pbar"));

	event = GTK_EVENT_BOX (gtk_builder_get_object (gui, "event"));
	sp->event = GTK_WIDGET (event);

	gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (sp->progress), 0.07);
	gtk_widget_show_all (GTK_WIDGET (sp->win));

	while (gtk_events_pending ())
		gtk_main_iteration ();
	return sp;
}
开发者ID:felipebetancur,项目名称:oregano,代码行数:34,代码来源:splash.c


示例9: time_out_new

static TimeOutPlugin*
time_out_new (XfcePanelPlugin *plugin)
{
  TimeOutPlugin *time_out;
  GtkOrientation orientation;

  /* Allocate memory for the plugin structure */
  time_out = panel_slice_new0 (TimeOutPlugin);

  /* Store pointer to the plugin */
  time_out->plugin = plugin;

  /* Create lock screen */
  time_out->lock_screen = time_out_lock_screen_new ();

  /* Connect to 'postpone' signal of the lock screen */
  g_signal_connect (G_OBJECT (time_out->lock_screen), "postpone", G_CALLBACK (time_out_postpone), time_out);

  /* Connect to 'resume' signal of the lock screen */
  g_signal_connect (G_OBJECT (time_out->lock_screen), "resume", G_CALLBACK (time_out_resume), time_out);

  /* Create countdowns */
  time_out->break_countdown = time_out_countdown_new ();
  time_out->lock_countdown = time_out_countdown_new ();

  /* Connect to break countdown signals */
  g_signal_connect (G_OBJECT (time_out->break_countdown), "update", G_CALLBACK (time_out_break_countdown_update), time_out);
  g_signal_connect (G_OBJECT (time_out->break_countdown), "finish", G_CALLBACK (time_out_break_countdown_finish), time_out);

  /* Connect to lock countdown signals */
  g_signal_connect (G_OBJECT (time_out->lock_countdown), "update", G_CALLBACK (time_out_lock_countdown_update), time_out);
  g_signal_connect (G_OBJECT (time_out->lock_countdown), "finish", G_CALLBACK (time_out_lock_countdown_finish), time_out);

  /* Get the current orientation */
  orientation = xfce_panel_plugin_get_orientation (plugin);

  /* Create event box to catch user events */
  time_out->ebox = gtk_event_box_new ();
  gtk_event_box_set_visible_window(GTK_EVENT_BOX(time_out->ebox), FALSE);
  gtk_widget_show (time_out->ebox);

  /* Create flexible box which can do both, horizontal and vertical layout */
  time_out->hvbox = xfce_hvbox_new (orientation, FALSE, 2);
  gtk_container_add (GTK_CONTAINER (time_out->ebox), time_out->hvbox);
  gtk_widget_show (time_out->hvbox);

  /* Create time out icon */
  time_out->panel_icon = gtk_image_new_from_icon_name ("xfce4-time-out-plugin", GTK_ICON_SIZE_DIALOG);
  gtk_image_set_pixel_size (GTK_IMAGE (time_out->panel_icon), xfce_panel_plugin_get_size (time_out->plugin) - 8);
  gtk_box_pack_start (GTK_BOX (time_out->hvbox), time_out->panel_icon, TRUE, TRUE, 0);
  gtk_widget_show (time_out->panel_icon);

  /* Create label for displaying the remaining time until the next break */
  time_out->time_label = gtk_label_new (_("Inactive"));
  gtk_misc_set_alignment (GTK_MISC (time_out->time_label), 0.5, 0.5);
  gtk_box_pack_start (GTK_BOX (time_out->hvbox), time_out->time_label, TRUE, TRUE, 0);
  gtk_widget_show (time_out->time_label);

  return time_out;
}
开发者ID:xfce-mirror,项目名称:xfce4-time-out-plugin,代码行数:60,代码来源:time-out.c


示例10: gtk_event_box_new

static GtkWidget *ui_make_img_btn(char *img_btn)
{
	GtkWidget *image;
	GtkWidget *eventbox;

	eventbox = gtk_event_box_new();

	gtk_widget_set_events(eventbox, GDK_MOTION_NOTIFY | GDK_BUTTON_RELEASE
	  				| GDK_BUTTON_PRESS
	  				| GDK_ENTER_NOTIFY
	  				| GDK_LEAVE_NOTIFY);

	image = gtk_image_new_from_file(img_btn);

	gtk_container_add(GTK_CONTAINER(eventbox), image);

	/* set eventbox not visible, only accept event */
	gtk_event_box_set_visible_window(GTK_EVENT_BOX(eventbox), FALSE);

	/* just change the mouse style */
	g_signal_connect(eventbox, "button_press_event", G_CALLBACK(e_img_btn_handle), NULL);
	g_signal_connect(eventbox, "button_release_event", G_CALLBACK(e_img_btn_handle), NULL);
	g_signal_connect(eventbox, "enter_notify_event", G_CALLBACK(e_img_btn_handle), NULL);
	g_signal_connect(eventbox, "leave_notify_event", G_CALLBACK(e_img_btn_handle), NULL);

	return eventbox;
}
开发者ID:trazyn,项目名称:mpdcoverart,代码行数:27,代码来源:ui_player_control.c


示例11: colorful_tabs_deactivate_cb

static void
colorful_tabs_deactivate_cb (MidoriExtension* extension,
                             MidoriBrowser*   browser)
{
    guint i;
    GtkWidget* view;
    MidoriApp* app = midori_extension_get_app (extension);

    g_signal_handlers_disconnect_by_func (
        app, colorful_tabs_app_add_browser_cb, extension);
    g_signal_handlers_disconnect_by_func (
        browser, colorful_tabs_browser_add_tab_cb, extension);
    g_signal_handlers_disconnect_by_func (
        extension, colorful_tabs_deactivate_cb, browser);
    i = 0;
    while ((view = midori_browser_get_nth_tab (browser, i++)))
    {
        GtkWidget* label = midori_view_get_proxy_tab_label (MIDORI_VIEW (view));
        gtk_event_box_set_visible_window (GTK_EVENT_BOX (label), FALSE);
        gtk_widget_modify_bg (label, GTK_STATE_NORMAL, NULL);
        gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, NULL);
        gtk_container_foreach (GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (label))),
                               (GtkCallback) colorful_tabs_modify_fg,
                               NULL);
        g_signal_handlers_disconnect_by_func (
            view, colorful_tabs_view_notify_uri_cb, extension);
    }
}
开发者ID:OoberMick,项目名称:Midori,代码行数:28,代码来源:colorful-tabs.c


示例12: make_cancel_button

void make_cancel_button(GtkWidget *fixed_base)
{
	GtkWidget *fixed;
	GtkWidget *event_box;
	GtkWidget *label;

	fixed = fixed_base;

	label = gtk_label_new(cancel_text);
	gtk_widget_set_size_request(label, cancel_label_width, cancel_label_height);
	gtk_widget_show(label);

	GdkColor white = {0, 65535, 65535, 65535};
	GtkRcStyle *rc_style = gtk_rc_style_new ();
	rc_style->fg[GTK_STATE_NORMAL] = white;
	rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG;
	gtk_widget_modify_style(label, rc_style);
	gtk_rc_style_unref(rc_style);

	event_box = gtk_event_box_new();
	gtk_container_add(GTK_CONTAINER(event_box), label);
	gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box), FALSE);
	gtk_widget_show(event_box);
	g_signal_connect(G_OBJECT(event_box), "enter_notify_event",
						G_CALLBACK(cancel_enter), NULL);
	g_signal_connect(G_OBJECT(event_box), "leave_notify_event",
						G_CALLBACK(cancel_leave), NULL);
	g_signal_connect(G_OBJECT(event_box), "button_press_event",
						G_CALLBACK(cancel_press), NULL);

	gtk_widget_show(event_box);
	gtk_fixed_put(GTK_FIXED(fixed), event_box, cancel_label_pos_x, cancel_label_pos_y);
}
开发者ID:cherry-wb,项目名称:quietheart,代码行数:33,代码来源:main.c


示例13: g_object_new

// Public functions
GtkWidget *dtgtk_icon_new(DTGTKCairoPaintIconFunc paint, gint paintflags)
{
  GtkDarktableIcon *icon;
  icon = g_object_new(dtgtk_icon_get_type(), NULL);
  gtk_event_box_set_visible_window(GTK_EVENT_BOX(icon), FALSE);
  icon->icon = paint;
  icon->icon_flags = paintflags;
  return (GtkWidget *)icon;
}
开发者ID:CarVac,项目名称:darktable,代码行数:10,代码来源:icon.c


示例14: windowck_new

static WindowckPlugin * windowck_new(XfcePanelPlugin *plugin)
{
    WindowckPlugin *wckp;

    GtkOrientation orientation;
    GtkWidget *label;

    /* allocate memory for the plugin structure */
    wckp = g_slice_new0 (WindowckPlugin);

    /* pointer to plugin */
    wckp->plugin = plugin;

    /* read the user settings */
    windowck_read(wckp);

    /* get the current orientation */
    orientation = xfce_panel_plugin_get_orientation(plugin);

    /* not needed for shrink mode */
    if (!wckp->prefs->size_mode == SHRINK)
        xfce_panel_plugin_set_shrink (plugin, TRUE);

    /* create some panel widgets */
    wckp->ebox = gtk_event_box_new();
    gtk_event_box_set_visible_window(GTK_EVENT_BOX(wckp->ebox), FALSE);
    gtk_widget_set_name(wckp->ebox, "XfceWindowckPlugin");

    wckp->alignment = gtk_alignment_new (0.5, 0.5, 0, 0);

    wckp->hvbox = xfce_hvbox_new(orientation, FALSE, 2);

    /* some wckp widgets */
    label = gtk_label_new("");
    wckp->title = GTK_LABEL (label);

    create_icon (wckp);

    gtk_box_pack_start (GTK_BOX(wckp->hvbox), label, TRUE, TRUE, 0);

    if (wckp->prefs->icon_on_right)
    {
        gtk_box_reorder_child (GTK_BOX (wckp->hvbox), GTK_WIDGET(wckp->icon->eventbox), 1);
    }

    gtk_container_add(GTK_CONTAINER(wckp->alignment), GTK_WIDGET(wckp->hvbox));
    gtk_container_add(GTK_CONTAINER(wckp->ebox), wckp->alignment);

    /* show widgets */
    gtk_widget_show(wckp->ebox);
    gtk_widget_show(wckp->alignment);
    gtk_widget_show(wckp->hvbox);
    gtk_widget_show(label);

    return wckp;
}
开发者ID:tr33m4n,项目名称:xfce4-windowck-plugin,代码行数:56,代码来源:windowck.c


示例15: mb_panel_applet_create

G_MODULE_EXPORT GtkWidget *
mb_panel_applet_create (const char *id, GtkOrientation orientation)
{
  GtkWidget *box, *image;

  box = gtk_event_box_new ();
  gtk_event_box_set_visible_window (GTK_EVENT_BOX (box), FALSE);
  gtk_event_box_set_above_child (GTK_EVENT_BOX (box), TRUE);
  gtk_widget_set_name (box, "MatchboxPanelKeyboard");

  image = mb_panel_scaling_image2_new (orientation, "matchbox-keyboard");
  gtk_container_add (GTK_CONTAINER (box), image);

  g_signal_connect (box, "button-release-event", G_CALLBACK (on_toggled), NULL);

  gtk_widget_show_all (box);

  return box;
}
开发者ID:jku,项目名称:matchbox-keyboard,代码行数:19,代码来源:applet.c


示例16: ResData

void ArticleView::append_data_res_attachment(
	const std::string& key, const std::string& mark,
	bool& loaded)
{
	if (for_float_win) {
		loaded = true;
		if(mark.empty())
			pango_view_->append_widget(NULL);
		else
			pango_view_->insert_widget(NULL, mark.c_str());
	} else {
		GtkWidget *widget = NULL;
		if (dict_index.type == InstantDictType_LOCAL) {
			StorageType type = gpAppFrame->oLibs.GetStorageType(dict_index.index);
			if (type == StorageType_DATABASE || type == StorageType_FILE) {
				ResData *pResData
					= new ResData(dict_index.index, key);
				GtkWidget *button = NULL;
				GtkWidget *image = NULL;
				image = gtk_image_new_from_pixbuf(get_impl(
					gpAppFrame->oAppSkin.attachment));
				button = gtk_button_new();
				/* We need an event box to associate a custom cursor with the
				 * button. */
				widget = gtk_event_box_new();
				g_object_ref_sink(G_OBJECT(widget));
				gtk_container_add(GTK_CONTAINER(button), image);
				gtk_container_add(GTK_CONTAINER(widget), button);
#ifdef DEBUG
				/* when the tooltip appears a number of gtk-warnings are generated:
				 * Gtk-WARNING **: IA__gtk_text_view_window_to_buffer_coords: 
				 * can't get coords for private windows */
				gtk_widget_set_tooltip_text(GTK_WIDGET(widget),
					pResData->get_key().c_str());
#endif
				gtk_event_box_set_above_child(GTK_EVENT_BOX(widget), FALSE);
				gtk_widget_show_all(widget);
				g_signal_connect(G_OBJECT(button), "destroy",
					G_CALLBACK(on_resource_button_destroy), (gpointer)pResData);
				g_signal_connect(G_OBJECT(button), "clicked",
					G_CALLBACK(on_attachment_button_clicked), (gpointer)pResData);
				g_signal_connect(G_OBJECT(button), "realize",
					G_CALLBACK(on_resource_button_realize), (gpointer)widget);
			}
		}
		if(widget) {
			loaded = true;
			if(mark.empty())
				pango_view_->append_widget(widget);
			else
				pango_view_->insert_widget(widget, mark.c_str());
			g_object_unref(widget);
		}
	}
}
开发者ID:2php,项目名称:stardict-3,代码行数:55,代码来源:articleview.cpp


示例17: MyEvent

GtkWidget * MyEvent(char name[]){
		Widget eventBox;
		Widget childWidget;
		childWidget = gtk_image_new_from_file(name);
		eventBox = gtk_event_box_new();
		gtk_event_box_set_above_child(GTK_EVENT_BOX(eventBox), TRUE);
		gtk_widget_set_events(eventBox, GDK_BUTTON_PRESS_MASK);
		gtk_container_add(GTK_CONTAINER(eventBox), childWidget);	
		return eventBox;
	
}
开发者ID:NgesBrian,项目名称:the_bolf-Browser,代码行数:11,代码来源:bolf.c


示例18: initialiseEventBox

GtkWidget * initialiseEventBox( GtkWidget *childWidget){
	GtkWidget* eventBox;
	eventBox = gtk_event_box_new();
	//gdk_window_set_cursor ( eventBox->window, gdk_cursor_new (GDK_HAND1));

	gtk_event_box_set_above_child( GTK_EVENT_BOX(eventBox), FALSE);
	gtk_widget_set_events(eventBox, GDK_BUTTON_PRESS_MASK);
	gtk_container_add( GTK_CONTAINER(eventBox), childWidget);

	return eventBox;
}
开发者ID:Agobin,项目名称:Gtk_browser,代码行数:11,代码来源:browser.c


示例19: g_object_new

// Public functions
GtkWidget *dtgtk_icon_new(DTGTKCairoPaintIconFunc paint, gint paintflags, void *paintdata)
{
  GtkDarktableIcon *icon;
  icon = g_object_new(dtgtk_icon_get_type(), NULL);
  gtk_event_box_set_visible_window(GTK_EVENT_BOX(icon), FALSE);
  icon->icon = paint;
  icon->icon_flags = paintflags;
  icon->icon_data = paintdata;
  gtk_widget_set_name(GTK_WIDGET(icon), "dt-icon");
  return (GtkWidget *)icon;
}
开发者ID:AlicVB,项目名称:darktable,代码行数:12,代码来源:icon.c


示例20: create_tray_icon

void create_tray_icon(struct _tray_icon *tray, gboolean runned)
{
	gchar *hint;
	char *image_file;
	if (runned == TRUE)
	{
		hint = _("X Neural Switcher RUNNED");
		image_file = "gxneur-run.png";
	}
	else
	{
		hint = _("X Neural Switcher STOPPED");
		image_file = "gxneur-stop.png";
	}
	
	if (tray != NULL)
	{
		gtk_object_destroy (GTK_OBJECT (tray->tooltip));
		tray->tooltip = NULL;
		gtk_widget_destroy (GTK_WIDGET (tray->popup_menu));
		tray->popup_menu = NULL;
		gtk_widget_destroy (GTK_WIDGET (tray->image));
		tray->image = NULL;
		gtk_widget_destroy (GTK_WIDGET (tray->evbox));
		tray->evbox = NULL;
	}
	else
	{
		tray = g_new0(struct _tray_icon, 1);	
			
		tray->clock = egg_clock_new();
		g_signal_connect (G_OBJECT(tray->clock), "time-changed", G_CALLBACK (clock_check_xneur), tray);
		
		tray->eggtray = egg_tray_icon_new(_("X Neural Switcher"));
		g_signal_connect(G_OBJECT(tray->eggtray), "button_press_event", G_CALLBACK(tray_icon_press), tray);
		g_signal_connect(G_OBJECT(tray->eggtray), "button_release_event", G_CALLBACK(tray_icon_release), tray);
	}
		
	tray->tooltip		= gtk_tooltips_new();
	tray->popup_menu	= create_menu_icon(tray);
	tray->evbox		= gtk_event_box_new();

	gtk_event_box_set_visible_window(GTK_EVENT_BOX(tray->evbox), 0);
	gtk_widget_set_size_request(tray->evbox, 25, 20);

	gtk_tooltips_set_tip(tray->tooltip, GTK_WIDGET(tray->eggtray), hint, NULL);	
	tray->image = create_pixmap(tray->evbox, image_file);
		
	gtk_container_add(GTK_CONTAINER(tray->evbox), tray->image);
	gtk_container_add(GTK_CONTAINER(tray->eggtray), tray->evbox);
	gtk_widget_show_all (GTK_WIDGET (tray->eggtray));
	return;
}
开发者ID:voidptr,项目名称:xneur-option,代码行数:53,代码来源:trayicon.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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