📄 startup.c
字号:
/*************************************************************************** * Copyright (C) 2003 by zhong * * zhongz@163.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/#include <gtk/gtk.h>#include "startup.h"static void startup_popup_cb( gpointer data );static voidstartup_popup_cb(gpointer data){ gtk_widget_destroy(GTK_WIDGET(data));}void chmsee_startup_popup_new (void){ // 这段代码来自 StarDict http://stardict.sourceforge.net gtk_window_set_auto_startup_notification(FALSE); GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(PACKAGE_DATA_DIR "/chmsee/chmsee-splash.png", NULL); gint w = gdk_pixbuf_get_width(pixbuf); gint h = gdk_pixbuf_get_height(pixbuf); GtkWidget *window = gtk_window_new (GTK_WINDOW_POPUP); gtk_widget_set_app_paintable(window, TRUE); gtk_window_set_title (GTK_WINDOW (window), "ChmSee"); gtk_window_set_position(GTK_WINDOW (window), GTK_WIN_POS_CENTER); gtk_widget_set_size_request(window, w, h); gtk_widget_show(window); GdkPixmap *pixmap = gdk_pixmap_new (window->window, w, h, -1); gdk_pixbuf_render_to_drawable (pixbuf, pixmap, window->style->fg_gc[GTK_STATE_NORMAL], 0, 0, 0, 0, w, h, GDK_RGB_DITHER_NORMAL, 0, 0); gdk_window_set_back_pixmap (window->window, pixmap, FALSE); gdk_window_clear (window->window); g_object_unref(pixbuf); g_object_unref(pixmap); while(gtk_events_pending()) gtk_main_iteration(); gtk_init_add ((GtkFunction)startup_popup_cb, (gpointer)window); gtk_window_set_auto_startup_notification(TRUE);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -