Re: GtkTreeView popup-menu



Am Sun, 1 Aug 2004 12:19:18 +0100 schrieb Tim Müller:

On Sunday 01 August 2004 11:38, Andreas Volz wrote:

which is the correct signal to grap a right click on a GtkTreeView
(GtkTreeModel) to open a popup-menu and do some stuff with it? It
seems
there's no "click" signal.

Here's an example:

   http://scentric.net/tutorial/sec-selections-context-menus.html

Thanks. This works now, but I've another problem. My TreeView is a
GtkTreeView with drag-and-drop. So If I press ESC in the popup menu to
unmap it the drag row action is started. I tried to deactivate drag&drop
when running the popup menu and restarting drag&drop after unmapping the
popup menu, but it doesn't work. After the first popup the drag&drop is
not longer working. I did this:

...
  if (event->button == 3)
  {
    gtk_tree_view_unset_rows_drag_source (treeview_menu);
    gtk_tree_view_unset_rows_drag_dest (treeview_menu);

...

gboolean
on_pop_menu1_unmap_event             (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{
  ...

  gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (treeview_menu),
                                          GDK_BUTTON1_MASK,
                                          row_targets,
                                          G_N_ELEMENTS (row_targets),
                                          GDK_ACTION_MOVE |
                                          GDK_ACTION_COPY);

  gtk_tree_view_enable_model_drag_dest (GTK_TREE_VIEW (treeview_menu),
                                        row_targets,
                                        G_N_ELEMENTS (row_targets),
                                        GDK_ACTION_MOVE |
                                        GDK_ACTION_COPY);


Why does it not reenable drag&drop? Perhaps there's an better way to
handle drag&drop and popup menus?

regards
Andreas



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