Re: [gtk-list] pixmaps and retreiving data from another process




I'll answer the first question since I've already come across it.  I
create the buttons on my toolbar using:

    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
                           NULL, "New window", NULL,
                           CreateWidgetFromXpm (vbox_main, (gchar **)
xpm_new),
                           (GtkSignalFunc) ButtonClicked,
                           NULL);


Where xpm_new is defined as:
static const gchar *xpm_new[] = {
"16 16 3 1",
"  c None",
"B c #000000000000",
"W c #FFFFFFFFFFFF",
"                ",
"  BBBBBBBBB     ",
"  BWWWWWWWBB    ",
"  BWWWWWWWBWB   ",
"  BWWWWWWWBBBB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BWWWWWWWWWWB  ",
"  BBBBBBBBBBBB  ",
"                ",
};




and where the CreateWidgetFromXpm function is defined as:

GtkWidget *CreateWidgetFromXpm (GtkWidget *window, gchar **xpm_data)
{
    GdkBitmap *mask;
    GdkPixmap *pixmap_data;
    GtkWidget *pixmap_widget;

    pixmap_data = gdk_pixmap_create_from_xpm_d (
                                 win_main->window,
                                 &mask,
                                 NULL,
                                 (gchar **) xpm_data);

    pixmap_widget = gtk_pixmap_new (pixmap_data, mask);
    gtk_widget_show (pixmap_widget);

    return (pixmap_widget);
}


---Erik Greenwald <br0ke@shells.clipboard.com> wrote:
>
> Hi, I got two quick questions
> 
> I can't seem to get pixmaps to work using
gdk_pixmap_create_from_xpm_d for my toolbar. I've found that the
documentation and header files for gtk_toolbar_append differ, the docs
sayins GtkPixmap and the header saying GtkWidget (gtk+ 1.0.4) an dthe
gdk documentation is just the names of some of the function w/o anyt
hing in it! *strusfration*
> 
> My second question; I have to call another program (gcc) and get the
output (STDOUT and STDERR) into data for my program. What would be the
best way to approach this? is there a better way than to call the
program redirecting to a /tmp file, then read that? I also need my
program to stay functional while that runs, but know when the program
terminates, is there a signal handler?
> 
> Thanks
> 	-Erik
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
/dev/null
> 
> 

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com



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