GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Oct 24, 2014 7:04 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: VTE Not Showing in Scrolled Window
PostPosted: Mon Dec 24, 2012 5:29 pm 
Offline
Familiar Face

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

I am writing a 2.90 VTE Window in GTK 3 Scrolled Window. I have the Draw signal (on the scrolled window) to the following function. Any Help would be appreciated.

Thank You

Code:
void vte_draw_cb (gpointer data)
{
      GtkWidget *vte_window;
   
      char cmd[200];
      
      sprintf(cmd,"/home/myusername/bin/myscript");
   
      char** argv=NULL;   
      GError* Err=NULL;
      GtkWidget* term;

      term=vte_terminal_new();
      g_shell_parse_argv(cmd, NULL, &argv, NULL);
      vte_terminal_fork_command_full(VTE_TERMINAL(term), 0, NULL, argv, NULL, 0, NULL, NULL, NULL, &Err);

      gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (vte_window), GTK_WIDGET (term));
      gtk_widget_show_all (term);
}


Top
 Profile  
 
 Post subject: Re: VTE Not Showing in Scrolled Window
PostPosted: Wed Dec 26, 2012 4:28 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
#1. You don't have the right prototype for the callback and the callback is completely disconnected from the original scrolled window.
The prototype is:
Code:
gboolean user_function(GtkWidget* widget, CairoContext* cr, gpointer user_data)

Widget represents the scrolled window, which should be used instead of declaring a new empty GtkWidget *vte_window;
#2. I really don't think this is the way you want to go about doing things. The draw signal is related to rendering and usually you'd only use cairo calls etc. At the moment you'd be continually adding widgets (that aren't getting destroyed) every time something changes in that region to cause the window to redraw. What is the more general aim of what you want to achieve?


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

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 2 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