Hi all,

Like said in an earlier post on the mailinglist we have started a new
project creating a thunar plugin. The wiki about the project is
planned but not started yet. But information regarding this is found
at:
http://www.powercraft.nl/temp/thunar-actions-plugin-project-description-v0.1.1j.zip

At the moment we are trying to get to know more about the plugin
functions. Like the rightclick menu and how to insert things in it.
We've already managed to insert actions in it, but we're stuck right
now at inserting menu's.

We have been examining the GTK tutorials and we've found a way to make
menu's(attachement included), and tried to compile several GTK windows
with different options in it, with succes. GTK looks easy mode. But
when we try to combine GTK and a thunar plugin it isn't working the
easy way anymore.

The problem we're stuck on right now, is how to insert an GTK menu in
the richtclick menu?
Where does the created menu must be added to? We already tried several
ways in the " *.*_get_file_actions "-function, but all with no
results. We also haven't found any documentation online what's
mentioning the GTK widgets that are made and can be used in a Thunar
plugin.

We have already examined the SVN and UCA plugin but without any result.

I have included the plugin "framework" we use to create a menu.


-- 
Kees

Attachment: menuplugin.tar
Description: Unix tar archive

#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
{ 
	//declarations
	GtkWidget *window;
	GtkWidget *file_menu;
	GtkWidget *open_item, *save_item, *quit_item;
	GtkWidget *menu_bar, *file_item;
	
	//normal GTK init function
	gtk_init (&argc, &argv);
   
   	//creating the window
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	
	//creating a menu
    file_menu = gtk_menu_new (); 

    //create the menu items
    open_item = gtk_menu_item_new_with_label ("Open");
    save_item = gtk_menu_item_new_with_label ("Save");
    quit_item = gtk_menu_item_new_with_label ("Quit");

    //Add the menuitems to the menu
    gtk_menu_shell_append (GTK_MENU_SHELL (file_menu), open_item);
    gtk_menu_shell_append (GTK_MENU_SHELL (file_menu), save_item);
    gtk_menu_shell_append (GTK_MENU_SHELL (file_menu), quit_item);

    // schow the items
    gtk_widget_show (open_item);
    gtk_widget_show (save_item);
    gtk_widget_show (quit_item);
 
 	//create a menu bar
 	menu_bar = gtk_menu_bar_new ();
 	//add the bar to the window
    gtk_container_add (GTK_CONTAINER (window), menu_bar);
    //show menubar
    gtk_widget_show (menu_bar);
	//create label
    file_item = gtk_menu_item_new_with_label ("File");
    //show label
    gtk_widget_show (file_item);
    //connect menu to label    
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_item), file_menu);
	gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), file_item);
	//default
	gtk_widget_show (window);
	//running loop
	gtk_main ();
	
	return 0;
}
_______________________________________________
Thunar-dev mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/thunar-dev

Reply via email to