GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Dec 21, 2014 12:26 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: VTE Terminal
PostPosted: Wed Sep 26, 2012 8:44 pm 
Offline
Familiar Face

Joined: Sat Mar 03, 2012 2:45 am
Posts: 18
Hello Everyone.

According to http://developer.gnome.org/vte/0.34/VteTerminal.html#vte-terminal-fork-command the Function vte-terminal-fork-command is deprecated. The new Function is vte_terminal_fork_command_full(). But the New function
Code:
gboolean            vte_terminal_fork_command_full      (VteTerminal *terminal,
                                                         VtePtyFlags pty_flags,
                                                         const char *working_directory,
                                                         char **argv,
                                                         char **envv,
                                                         GSpawnFlags spawn_flags,
                                                         GSpawnChildSetupFunc child_setup,
                                                         gpointer child_setup_data,
                                                         GPid *child_pid,
                                                         GError **error);

has no command argument. In this New Function how can i set the command argument. I am using GTK3 With VTE 2.90 on Ubuntu 12.04

Thank You


Top
 Profile  
 
 Post subject: Re: VTE Terminal
PostPosted: Wed Sep 26, 2012 11:25 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
you don't really need the command argument. it all pretty much goes into argv. E.g. I think the following should work:
Code:
char** argv=NULL;
GError* Err=NULL;
GtkWidget* term;

term=vte_terminal_new();
g_shell_parse_argv("/bin/sh", NULL, &argv, NULL);
vte_terminal_fork_command_full(VTE_TERMINAL(term), NULL, NULL, argv, NULL, NULL, NULL, NULL, NULL, &Err);


Top
 Profile  
 
 Post subject: Re: VTE Terminal
PostPosted: Thu Sep 27, 2012 4:37 pm 
Offline
Familiar Face

Joined: Sat Mar 03, 2012 2:45 am
Posts: 18
Paul,

Thank You for this code. It is giving me errors "error: incompatible type for argument 2 of ‘vte_terminal_fork_command_full’" and "error: incompatible type for argument 6 of ‘vte_terminal_fork_command_full’" - I Tried to add the Flags from http://developer.gnome.org/vte/unstable/VteTerminal.html#vte-terminal-fork-command-full but still I get errors that the flags don't exist.

Thank You,


Top
 Profile  
 
 Post subject: Re: VTE Terminal
PostPosted: Thu Sep 27, 2012 5:44 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hi.

Try setting 2nd and 6th parameter to 0 instead of NULL and see what happens.

BTW, what compiler are you using to compile your code: C or C++? C++ compilers are stricter than C when it comes to enum types. If compiling your code as C++, then you need to cast 2nd and 6th parameter to VteTtyFlags and GSpawnFlags respectively.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: VTE Terminal
PostPosted: Thu Sep 27, 2012 8:58 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
That was my fault for not checking all the types properly. You can often get away with using 0 for NULL but not so much the other way round.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group