Re: Can I Disable or Alter GtkEntry and GtkTextView Clipboard Menus?



Am Montag, den 17.12.2007, 19:29 -0500 schrieb Vallone, Anthony:
> I am developing applications that run in a very user controlled
> environment (think big brother).  When a GtkEntry or GtkTextView widget
> is clicked with button 3, a clipboard menu opens with basic clipboard
> options, an "Input Methods" sub menu, and an "Insert Unicode ..." sub
> menu.  How can I disable or alter that menu?  
>  
> I also tried connecting to the "popup-menu" from the GtkWidget level,
> but that signal never seems to propagate.

I don't know what went wrong, but connecting to the "popup-menu" signal
definitly works, as the attached program demonstrates.

Ciao,
Mathias
-- 
Mathias Hasselmann <mathias hasselmann gmx de>
Openismus GmbH: http://www.openismus.com/
Personal Site: http://taschenorakel.de/
#include <gtk/gtk.h>

int
main (int   argc,
      char *argv[])
{
  GtkWidget *window, *vbox, *entry, *text_view;

  gtk_init (&argc, &argv);

  entry = gtk_entry_new ();

  g_signal_connect (entry, "popup-menu",
                    G_CALLBACK (gtk_true),
                    NULL);

  text_view = gtk_text_view_new ();

  g_signal_connect (text_view, "popup-menu",
                    G_CALLBACK (gtk_true),
                    NULL);

  vbox = gtk_vbox_new (FALSE, 6);
  gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, TRUE, 0);
  gtk_box_pack_start (GTK_BOX (vbox), text_view, TRUE, TRUE, 0);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_add (GTK_CONTAINER (window), vbox);
  gtk_widget_show_all (window);

  g_signal_connect (window, "destroy",
                    G_CALLBACK (gtk_main_quit),
                    NULL);

  gtk_main ();

  return 0;
}

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]