static void mate_volume_applet_dock_init (MateVolumeAppletDock *dock) { dock->orientation = -1; dock->timeout = 0; #if 1 /* We can't use a simple GDK_WINDOW_TYPE_HINT_DOCK here since * the dock windows don't accept input by default. Instead we use * the popup menu type. In the end we set everything by hand anyway * since what happens depends very heavily on the window manager. */ // gtk_window_set_type_hint (GTK_WINDOW (dock), // GDK_WINDOW_TYPE_HINT_POPUP_MENU); gtk_window_set_keep_above (GTK_WINDOW (dock), TRUE); gtk_window_set_decorated (GTK_WINDOW (dock), FALSE); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dock), TRUE); gtk_window_set_skip_pager_hint (GTK_WINDOW (dock), TRUE); gtk_window_set_resizable (GTK_WINDOW (dock), FALSE); gtk_window_stick (GTK_WINDOW (dock)); #else /* This works well, except that keyboard focus is impossible. */ gtk_window_set_type_hint (GTK_WINDOW (dock), GDK_WINDOW_TYPE_HINT_DOCK); gtk_window_set_decorated (GTK_WINDOW (dock), FALSE); gtk_window_set_resizable (GTK_WINDOW (dock), FALSE); gtk_window_stick (GTK_WINDOW (dock)); GTK_WIDGET_SET_FLAGS (dock, GTK_CAN_FOCUS); #endif }
static void cheese_flash_init (CheeseFlash *self) { CheeseFlashPrivate *priv = CHEESE_FLASH_GET_PRIVATE (self); GtkWindow *window; priv->flash_timeout_tag = 0; priv->fade_timeout_tag = 0; window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_POPUP)); /* make it so it doesn't look like a window on the desktop (+fullscreen) */ gtk_window_set_decorated (window, FALSE); gtk_window_set_skip_taskbar_hint (window, TRUE); gtk_window_set_skip_pager_hint (window, TRUE); gtk_window_set_keep_above (window, TRUE); /* Don't take focus */ gtk_window_set_accept_focus (window, FALSE); gtk_window_set_focus_on_map (window, FALSE); /* Don't consume input */ gtk_widget_realize (GTK_WIDGET (window)); GdkRegion *input_region; input_region = gdk_region_new (); gdk_window_input_shape_combine_region (gtk_widget_get_window (GTK_WIDGET (window)), input_region, 0, 0); gdk_region_destroy (input_region); g_signal_connect (G_OBJECT (window), "expose-event", G_CALLBACK (cheese_flash_window_expose_event_cb), NULL); priv->window = window; }
/* Sticky Window Callback : Skip taskbar and pager when exposing the widow */ gboolean stickynote_expose_cb(GtkWidget *widget, GdkEventExpose *event, StickyNote *note) { gtk_window_set_skip_taskbar_hint(GTK_WINDOW(note->w_window), TRUE); gtk_window_set_skip_pager_hint(GTK_WINDOW(note->w_window), TRUE); return FALSE; }
/** * Make the argument dialog transient to the currently active document * window. */ void sp_transientize(GtkWidget *dialog) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); #ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs // _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs // are made transient (_set_transient_for), they are already removed from // the taskbar in Win32. if (prefs->getBool( "/options/dialogsskiptaskbar/value")) { gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE); } #endif gint transient_policy = prefs->getIntLimited("/options/transientpolicy/value", 1, 0, 2); #ifdef WIN32 // Win32 special code to enable transient dialogs transient_policy = 2; #endif if (transient_policy) { // if there's an active document window, attach dialog to it as a transient: if ( SP_ACTIVE_DESKTOP ) { SP_ACTIVE_DESKTOP->setWindowTransient (dialog, transient_policy); } } } // end of sp_transientize()
static void xmr_chooser_init(XmrChooser *chooser) { XmrChooserPrivate *priv; chooser->priv = G_TYPE_INSTANCE_GET_PRIVATE(chooser, XMR_TYPE_CHOOSER, XmrChooserPrivate); priv = chooser->priv; priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->hide_on_clicked = TRUE; priv->widget = NULL; priv->view = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(priv->view), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(chooser), priv->view); g_signal_connect(chooser, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); gtk_window_set_position(GTK_WINDOW(chooser), GTK_WIN_POS_CENTER); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(chooser), TRUE); }
/********************************************************************\ * gnc_verify_dialog * * display a message, and asks the user to press "Yes" or "No" * * * * NOTE: This function does not return until the dialog is closed * * * * Args: parent - the parent window * * yes_is_default - If true, "Yes" is default, * * "No" is the default button. * * format - the format string for the message to display * * This is a standard 'printf' style string. * * args - a pointer to the first argument for the format * * string. * \********************************************************************/ gboolean gnc_verify_dialog(GtkWidget *parent, gboolean yes_is_default, const gchar *format, ...) { GtkWidget *dialog; gchar *buffer; gint result; va_list args; if (parent == NULL) parent = gnc_ui_get_toplevel(); va_start(args, format); buffer = g_strdup_vprintf(format, args); dialog = gtk_message_dialog_new (GTK_WINDOW(parent), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", buffer); g_free(buffer); va_end(args); if (parent == NULL) gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), (yes_is_default ? GTK_RESPONSE_YES : GTK_RESPONSE_NO)); result = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); return (result == GTK_RESPONSE_YES); }
void wxTopLevelWindowGTK::SetWindowStyleFlag( long style ) { #if defined(__WXGTK24__) || GTK_CHECK_VERSION(2,2,0) // Store which styles were changed long styleChanges = style ^ m_windowStyle; #endif // Process wxWindow styles. This also updates the internal variable // Therefore m_windowStyle bits carry now the _new_ style values wxWindow::SetWindowStyleFlag(style); // just return for now if widget does not exist yet if (!m_widget) return; #ifdef __WXGTK24__ if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) ) gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP); #endif // GTK+ 2.4 #if GTK_CHECK_VERSION(2,2,0) if ( (styleChanges & wxFRAME_NO_TASKBAR) && !gtk_check_version(2,2,0) ) { gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_widget), m_windowStyle & wxFRAME_NO_TASKBAR); } #endif // GTK+ 2.2 }
JNIEXPORT void JNICALL Java_org_gnome_gtk_GtkWindow_gtk_1window_1set_1skip_1taskbar_1hint ( JNIEnv* env, jclass cls, jlong _self, jboolean _setting ) { GtkWindow* self; gboolean setting; // convert parameter self self = (GtkWindow*) _self; // convert parameter setting setting = (gboolean) _setting; // call function gtk_window_set_skip_taskbar_hint(self, setting); // cleanup parameter self // cleanup parameter setting }
static void cheese_flash_init (CheeseFlash *self) { CheeseFlashPrivate *priv = self->priv = CHEESE_FLASH_GET_PRIVATE (self); cairo_region_t *input_region; GtkWindow *window = GTK_WINDOW (self); const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 }; priv->flash_timeout_tag = 0; priv->fade_timeout_tag = 0; /* make it so it doesn't look like a window on the desktop (+fullscreen) */ gtk_window_set_decorated (window, FALSE); gtk_window_set_skip_taskbar_hint (window, TRUE); gtk_window_set_skip_pager_hint (window, TRUE); gtk_window_set_keep_above (window, TRUE); /* Don't take focus */ gtk_window_set_accept_focus (window, FALSE); gtk_window_set_focus_on_map (window, FALSE); /* Make it white */ gtk_widget_override_background_color (GTK_WIDGET (window), GTK_STATE_NORMAL, &white); /* Don't consume input */ gtk_widget_realize (GTK_WIDGET (window)); input_region = cairo_region_create (); gdk_window_input_shape_combine_region (gtk_widget_get_window (GTK_WIDGET (window)), input_region, 0, 0); cairo_region_destroy (input_region); }
/* Display a window containing the standard calendar widget. */ static GtkWidget * dclock_create_calendar(DClockPlugin * dc) { /* Create a new window. */ GtkWidget * win = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(win), 180, 180); gtk_window_set_decorated(GTK_WINDOW(win), FALSE); gtk_window_set_resizable(GTK_WINDOW(win), FALSE); gtk_container_set_border_width(GTK_CONTAINER(win), 5); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(win), TRUE); gtk_window_set_skip_pager_hint(GTK_WINDOW(win), TRUE); gtk_window_stick(GTK_WINDOW(win)); /* Create a vertical box as a child of the window. */ GtkWidget * box = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(box)); /* Create a standard calendar widget as a child of the vertical box. */ GtkWidget * calendar = gtk_calendar_new(); gtk_calendar_display_options( GTK_CALENDAR(calendar), GTK_CALENDAR_SHOW_WEEK_NUMBERS | GTK_CALENDAR_SHOW_DAY_NAMES | GTK_CALENDAR_SHOW_HEADING); gtk_box_pack_start_defaults(GTK_BOX(box), calendar); /* Connect signals. */ g_signal_connect(G_OBJECT(win), "map", G_CALLBACK(dclock_popup_map), dc); /* Return the widget. */ return win; }
static void set_app_window(HippoWindowGtk *window_gtk, gboolean app_window) { GtkWindow *window = GTK_WINDOW(window_gtk); GtkWidget *widget = GTK_WIDGET(window_gtk); app_window = app_window != FALSE; if (window_gtk->app_window == app_window) return; window_gtk->app_window = app_window; gtk_window_set_skip_taskbar_hint(window, !app_window); gtk_window_set_skip_pager_hint(window, !app_window); if (app_window) { gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_NORMAL); gtk_window_set_accept_focus(window, TRUE); } else { /* NOTIFICATION is the right type hint, but that's new in GTK+-2.10 */ gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_DOCK); gtk_window_set_accept_focus(window, FALSE); } /* See note about "background none" in hippo_window_gtk_realize() */ if (GTK_WIDGET_REALIZED(widget)) { if (app_window) { /* This should cause the right pixel to be set, replacing background-none */ gtk_style_set_background (widget->style, widget->window, widget->state); } else { gdk_window_set_back_pixmap(widget->window, NULL, FALSE); } } }
float_shape_t *make_shape_from_pixbuf(GdkPixbuf *pixbuf) { float_shape_t *s = alloc_shape(); s->x = 0; s->y = 0; s->pixbuf = pixbuf; s->width = gdk_pixbuf_get_width(pixbuf); s->height = gdk_pixbuf_get_height(pixbuf); s->window = gtk_window_new(GTK_WINDOW_POPUP); gtk_window_set_decorated(GTK_WINDOW(s->window), FALSE); gtk_window_set_title(GTK_WINDOW(s->window), "shape"); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(s->window), TRUE); gtk_window_set_keep_above(GTK_WINDOW(s->window), TRUE); s->image = gtk_image_new_from_pixbuf(pixbuf); gtk_container_add(GTK_CONTAINER(s->window), s->image); get_alpha_mask(s); gtk_widget_shape_combine_mask(s->window, s->mask_bitmap, 0, 0); g_signal_connect(G_OBJECT(s->window), "destroy", G_CALLBACK(quit_callback), NULL); return s; }
/* From marco */ static void kill_window_question (gpointer window) { GtkWidget *dialog; dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, _("Force this application to exit?")); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), _("If you choose to force an application " "to exit, unsaved changes in any open documents " "in it might get lost.")); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, PANEL_STOCK_FORCE_QUIT, GTK_RESPONSE_ACCEPT, NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE); gtk_window_set_title (GTK_WINDOW (dialog), _("Force Quit")); g_signal_connect (dialog, "response", G_CALLBACK (kill_window_response), window); gtk_widget_show (dialog); }
/********************************************************************\ * gnc_ok_cancel_dialog * * display a message, and asks the user to press "Ok" or "Cancel" * * * * NOTE: This function does not return until the dialog is closed * * * * Args: parent - the parent window * * default - the button that will be the default * * message - the message to display * * format - the format string for the message to display * * This is a standard 'printf' style string. * * args - a pointer to the first argument for the format * * string. * * Return: the result the user selected * \********************************************************************/ gint gnc_ok_cancel_dialog(GtkWidget *parent, gint default_result, const gchar *format, ...) { GtkWidget *dialog = NULL; gint result; gchar *buffer; va_list args; if (parent == NULL) parent = gnc_ui_get_toplevel(); va_start(args, format); buffer = g_strdup_vprintf(format, args); dialog = gtk_message_dialog_new (GTK_WINDOW(parent), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", buffer); g_free(buffer); va_end(args); if (parent == NULL) gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); gtk_dialog_set_default_response (GTK_DIALOG(dialog), default_result); result = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); return(result); }
static void csm_logout_dialog_init (CsmLogoutDialog *logout_dialog) { logout_dialog->priv = CSM_LOGOUT_DIALOG_GET_PRIVATE (logout_dialog); logout_dialog->priv->timeout_id = 0; logout_dialog->priv->timeout = 0; logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL; gtk_window_set_skip_taskbar_hint (GTK_WINDOW (logout_dialog), TRUE); gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE); gtk_window_stick (GTK_WINDOW (logout_dialog)); #ifdef HAVE_OLD_UPOWER logout_dialog->priv->up_client = up_client_new (); #endif logout_dialog->priv->system = csm_get_system (); g_signal_connect (logout_dialog, "destroy", G_CALLBACK (csm_logout_dialog_destroy), NULL); g_signal_connect (logout_dialog, "show", G_CALLBACK (csm_logout_dialog_show), NULL); }
void wxTopLevelWindowGTK::SetWindowStyleFlag( long style ) { // Store which styles were changed long styleChanges = style ^ m_windowStyle; // Process wxWindow styles. This also updates the internal variable // Therefore m_windowStyle bits carry now the _new_ style values wxWindow::SetWindowStyleFlag(style); // just return for now if widget does not exist yet if (!m_widget) return; if ( styleChanges & wxSTAY_ON_TOP ) { gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP); } if ( styleChanges & wxFRAME_NO_TASKBAR ) { gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_widget), m_windowStyle & wxFRAME_NO_TASKBAR); } }
static void show_dialog ( TpSimpleApprover *self, TpChannelDispatchOperation *cdo, TpContact *target) { GFile *avatar_file = tp_contact_get_avatar_file (target); GtkWidget *dialog = gtk_message_dialog_new_with_markup (NULL, 0, /* flags */ GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "<b>%s</b> (<i>%s</i>) would like to edit a spreadsheet in LibreOffice " "with you.", tp_contact_get_alias (target), tp_contact_get_identifier (target)); if (avatar_file != NULL) { GtkWidget *avatar = gtk_image_new_from_file (g_file_get_path (avatar_file)); gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), avatar); } gtk_dialog_add_buttons (GTK_DIALOG (dialog), "_Reject", GTK_RESPONSE_REJECT, "_Accept", GTK_RESPONSE_ACCEPT, NULL); g_object_set_data_full (G_OBJECT (dialog), "client", g_object_ref (self), g_object_unref); g_signal_connect (dialog, "response", G_CALLBACK (dialog_response_cb), g_object_ref (cdo)); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE); gtk_widget_show_all (dialog); }
void fx_search_initialize(FxSearch *search , GtkTreeModel *model , const char *str , int x , int y) { GtkWidget *frame; search->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_decorated(GTK_WINDOW(search->window) , FALSE); gtk_window_set_type_hint(GTK_WINDOW(search->window), GDK_WINDOW_TYPE_HINT_DIALOG); // gtk_widget_set_name(search->window , "mainwindow"); gtk_window_set_default_size(GTK_WINDOW(search->window) , 240 , 60); gtk_window_set_skip_taskbar_hint (GTK_WINDOW(search->window), TRUE); gtk_window_move(GTK_WINDOW(search->window) , x , y); g_signal_connect(search->window , "focus-out-event" , GTK_SIGNAL_FUNC(window_focus_out) , search); frame = gtk_frame_new(NULL); gtk_frame_set_shadow_type(GTK_FRAME(frame) , GTK_SHADOW_ETCHED_IN); GtkTreeModel *nmodel = create_model(model , str); search->view = gtk_tree_view_new_with_model(nmodel); gtk_widget_set_usize(search->view , 320 , 0); create_column(search->view , search->fxmain); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(search->view) , FALSE); //gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (search->view), TRUE); gtk_tree_view_set_hover_selection(GTK_TREE_VIEW(search->view) , TRUE); gtk_container_add(GTK_CONTAINER(search->window) , frame); gtk_container_add(GTK_CONTAINER(frame) , search->view); g_signal_connect(search->view , "row-activated" , G_CALLBACK(row_activate_func) , search); g_signal_connect(search->view , "button-press-event" , G_CALLBACK(button_press_func) , search); g_signal_connect(search->view , "key-press-event" , G_CALLBACK(key_press_func) , search); gtk_widget_show_all(search->window); }
static void gsm_logout_dialog_init (GsmLogoutDialog *logout_dialog) { logout_dialog->priv = GSM_LOGOUT_DIALOG_GET_PRIVATE (logout_dialog); logout_dialog->priv->timeout_id = 0; logout_dialog->priv->timeout = 0; logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL; gtk_window_set_skip_taskbar_hint (GTK_WINDOW (logout_dialog), TRUE); gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE); gtk_window_stick (GTK_WINDOW (logout_dialog)); #ifdef HAVE_UPOWER logout_dialog->priv->up_client = up_client_new (); #endif #ifdef HAVE_SYSTEMD if (LOGIND_RUNNING()) logout_dialog->priv->systemd = gsm_get_systemd (); else #endif logout_dialog->priv->consolekit = gsm_get_consolekit (); g_signal_connect (logout_dialog, "destroy", G_CALLBACK (gsm_logout_dialog_destroy), NULL); g_signal_connect (logout_dialog, "show", G_CALLBACK (gsm_logout_dialog_show), NULL); }
/********************************************************************\ * gnc_info_dialog * * displays an information dialog box * * * * Args: parent - the parent window * * format - the format string for the message to display * * This is a standard 'printf' style string. * * args - a pointer to the first argument for the format * * string. * * Return: none * \********************************************************************/ void gnc_info_dialog(GtkWidget *parent, const gchar *format, ...) { GtkWidget *dialog; gchar *buffer; va_list args; if (parent == NULL) parent = gnc_ui_get_toplevel(); va_start(args, format); buffer = g_strdup_vprintf(format, args); dialog = gtk_message_dialog_new (GTK_WINDOW(parent), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s", buffer); va_end(args); if (parent == NULL) gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); }
GtkWidget *stk_window_create() { GdkColor color; GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); /* * set main window attribution */ /* not to display the window in the task bar, only works under Linux, gtk bugs? */ #if !GTK_CHECK_VERSION(2,2,0) gtk_window_set_skip_taskbar_hint(GTK_WINDOW(window),TRUE); #else gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU); #endif //gtk_window_unmaximize(GTK_WINDOW(window)); gtk_window_set_title(GTK_WINDOW(window), "stkserver"); gtk_widget_set_size_request(window, STK_MAINWIN_WIDTH, STK_MAINWIN_HEIGHT); gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); //gtk_window_set_resizable(GTK_WINDOW(window),FALSE); //gtk_window_set_keep_above(GTK_WINDOW(window),TRUE); /* set window background color */ gdk_color_parse(MAIN_COLRO_STRING, &color); gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color); gtk_window_set_icon(GTK_WINDOW(window), gdk_pixbuf_new_from_file(STK_ICON_PNG, NULL)); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(gtk_main_quit), NULL); return window; }
static void on_file_save_button_clicked(GtkButton *button, PropertyDialogElements *e) { #ifdef G_OS_WIN32 gchar *path = win32_show_project_open_dialog(e->dialog, _("Choose Project Filename"), gtk_entry_get_text(GTK_ENTRY(e->file_name)), TRUE, TRUE); if (path != NULL) { gtk_entry_set_text(GTK_ENTRY(e->file_name), path); g_free(path); } #else GtkWidget *dialog; /* initialise the dialog */ dialog = gtk_file_chooser_dialog_new(_("Choose Project Filename"), NULL, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); gtk_widget_set_name(dialog, "GeanyDialogProject"); gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), TRUE); gtk_window_set_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); run_dialog(dialog, e->file_name); #endif }
int setupwindow() { GdkPixmap *background; GdkPixbuf *pixbuf; GdkPixbuf *scaled; GdkScreen *screen; GdkColormap *colormap; GError *error=NULL; GtkStyle *style; window=gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(window), "expose_event", G_CALLBACK(expose_window),NULL); gtk_window_set_title(GTK_WINDOW(window), "clock"); gtk_window_stick(GTK_WINDOW(window)); gtk_window_set_resizable(GTK_WINDOW(window),TRUE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(window),TRUE); gtk_window_set_keep_above(GTK_WINDOW(window),TRUE); gtk_container_set_border_width(GTK_CONTAINER(window), 3); gtk_window_set_decorated(GTK_WINDOW(window),TRUE); gtk_window_set_default_size(GTK_WINDOW(window),100,100); gtk_widget_set_app_paintable(window,TRUE); /* Get the screen to get the colormap */ screen=gtk_widget_get_screen(window); colormap = gdk_screen_get_rgba_colormap(screen); if(colormap != NULL){ alpha_channel_support=TRUE; } else { alpha_channel_support=FALSE; colormap=gdk_screen_get_rgb_colormap(screen); g_print("Sorry, no alpha!\n"); } /* Tell the window to use the colormap */ gtk_widget_set_colormap(window,colormap); /* Get a pixbuf from the image file */ pixbuf=gdk_pixbuf_new_from_file("clockface.png",&error); if(pixbuf==NULL){ g_print("Failed to open background image: %s\n", error->message); g_error_free(error); error=NULL; return 0; } /* Make it the same size as the window */ scaled=gdk_pixbuf_scale_simple(pixbuf,100,100, GDK_INTERP_BILINEAR); /* Render it using the colormap of the window */ gdk_pixbuf_render_pixmap_and_mask_for_colormap(scaled,colormap,&background,NULL,0); /* Make a new style, stick the background in it, tell window to use it. */ style = gtk_style_new(); style->bg_pixmap[0] = background; gtk_widget_set_style(GTK_WIDGET(window),GTK_STYLE(style)); /*gtk_window_set_opacity(GTK_WINDOW(window),0.3);*/ gtk_window_move(GTK_WINDOW(window), 0, 0); gtk_widget_show_all(window); return 1; }
GtkWidget * panel_error_dialog (GtkWindow *parent, GdkScreen *screen, const char *dialog_class, gboolean auto_destroy, const char *primary_text, const char *secondary_text) { GtkWidget *dialog; char *freeme; freeme = NULL; if (primary_text == NULL) { g_warning ("NULL dialog"); /* No need to translate this, this should NEVER happen */ freeme = g_strdup_printf ("Error with displaying error " "for dialog of class %s", dialog_class); primary_text = freeme; } dialog = gtk_message_dialog_new (parent, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", primary_text); if (secondary_text != NULL) gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", secondary_text); /* FIXME: we're losing this feature gtk_widget_add_events (dialog, GDK_KEY_PRESS_MASK); g_signal_connect (dialog, "event", G_CALLBACK (panel_dialog_window_event), NULL); */ if (screen) gtk_window_set_screen (GTK_WINDOW (dialog), screen); if (!parent) { gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE); /* FIXME: We need a title in this case, but we don't know what * the format should be. Let's put something simple until * the following bug gets fixed: * http://bugzilla.gnome.org/show_bug.cgi?id=165132 */ gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); } gtk_widget_show_all (dialog); if (auto_destroy) g_signal_connect_swapped (G_OBJECT (dialog), "response", G_CALLBACK (gtk_widget_destroy), G_OBJECT (dialog)); if (freeme) g_free (freeme); return dialog; }
/** * gdl_dock_set_skip_taskbar: * @dock: The dock whose property should be set. * @skip: %TRUE if floating docks should be prevented from appearing in the taskbar * * Sets whether or not a floating dock window should be prevented from * appearing in the system taskbar. * * Since: 3.6 */ void gdl_dock_set_skip_taskbar (GdlDock *dock, gboolean skip) { dock->priv->skip_taskbar = (skip != FALSE); if (dock->priv->window && dock->priv->window) { gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dock->priv->window), dock->priv->skip_taskbar); } }
/** * 运行对话框. * @param dialog 对话框指针 */ void HelpDialog::RunHelpDialog(GtkWidget **dialog) { g_signal_connect(*dialog, "close", G_CALLBACK(gtk_widget_destroy), NULL); g_signal_connect(*dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); g_signal_connect_swapped(*dialog, "destroy", G_CALLBACK(DialogDestroy), dialog); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(*dialog), TRUE); gtk_window_set_skip_pager_hint(GTK_WINDOW(*dialog), TRUE); gtk_widget_show_all(*dialog); }
static void show_help (FishApplet *fish, const char *link_id) { GError *error = NULL; char *uri; #define FISH_HELP_DOC "fish" if (link_id) uri = g_strdup_printf ("help:%s/%s", FISH_HELP_DOC, link_id); else uri = g_strdup_printf ("help:%s", FISH_HELP_DOC); gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (fish)), uri, gtk_get_current_event_time (), &error); g_free (uri); if (error && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) g_error_free (error); else if (error) { GtkWidget *dialog; char *primary; primary = g_markup_printf_escaped ( _("Could not display help document '%s'"), FISH_HELP_DOC); dialog = gtk_message_dialog_new ( NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", primary); gtk_message_dialog_format_secondary_text ( GTK_MESSAGE_DIALOG (dialog), "%s", error->message); g_error_free (error); g_free (primary); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_set_icon_name (GTK_WINDOW (dialog), FISH_ICON); gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (GTK_WIDGET (fish))); /* we have no parent window */ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE); gtk_window_set_title (GTK_WINDOW (dialog), _("Error displaying help document")); gtk_widget_show (dialog); } }
static GtkWidget * pop_calendar_window(GtkWidget *parent, int orientation, gboolean week_start_monday, const char *date_string) { GtkWidget *window; GtkWidget *frame; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *cal; GtkWidget *entry; GtkWidget *label; GtkCalendarDisplayOptions display_options; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_decorated(GTK_WINDOW(window), FALSE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(window), TRUE); gtk_window_set_skip_pager_hint(GTK_WINDOW(window), TRUE); g_object_set_data(G_OBJECT(window), "calendar-parent", parent); frame = gtk_frame_new(NULL); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_OUT); gtk_container_add (GTK_CONTAINER(window), frame); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add (GTK_CONTAINER(frame), vbox); cal = gtk_calendar_new(); display_options = GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_WEEK_NUMBERS | GTK_CALENDAR_SHOW_DAY_NAMES; if (week_start_monday) display_options |= GTK_CALENDAR_WEEK_START_MONDAY; gtk_calendar_display_options(GTK_CALENDAR (cal), display_options); gtk_box_pack_start(GTK_BOX(vbox), cal, TRUE, TRUE, 0); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); label = gtk_label_new(_("Date:")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); entry = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry), date_string); gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(on_calendar_entry_activated), cal); g_signal_connect_after(G_OBJECT(window), "realize", G_CALLBACK(on_calendar_realized), GINT_TO_POINTER(orientation)); gtk_widget_show_all(window); return window; }
// Function to open a dialog box displaying the message provided void ErrorDialog(const char* message) { gtk_init(pargc, pargv); GtkWidget* dialog = gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", message); gtk_window_set_title(GTK_WINDOW(dialog), "Error launching webapp"); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), false); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); }
static WidgetInfo * new_widget_info (const char *name, GtkWidget *widget, WidgetSize size) { WidgetInfo *info; info = g_new0 (WidgetInfo, 1); info->name = g_strdup (name); info->size = size; info->no_focus = TRUE; if (GTK_IS_WINDOW (widget)) { info->window = widget; gtk_window_set_resizable (GTK_WINDOW (info->window), FALSE); g_signal_connect_swapped (info->window, "realize", G_CALLBACK (realize_callback), info); } else { info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_accept_focus (GTK_WINDOW (info->window), FALSE); gtk_container_set_border_width (GTK_CONTAINER (info->window), 12); gtk_container_add (GTK_CONTAINER (info->window), widget); gtk_widget_show_all (widget); } gtk_window_set_skip_taskbar_hint (GTK_WINDOW (info->window), TRUE); gtk_widget_set_app_paintable (info->window, TRUE); g_signal_connect (info->window, "focus", G_CALLBACK (gtk_true), NULL); switch (size) { case SMALL: gtk_widget_set_size_request (info->window, SMALL_WIDTH, SMALL_HEIGHT); break; case MEDIUM: gtk_widget_set_size_request (info->window, MEDIUM_WIDTH, MEDIUM_HEIGHT); break; case LARGE: gtk_widget_set_size_request (info->window, LARGE_WIDTH, LARGE_HEIGHT); break; default: break; } return info; }