/[antiright]/antiright/lib/window.c
ViewVC logotype

Diff of /antiright/lib/window.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jefbed, Mon Aug 16 17:27:05 2004 UTC revision 1.5 by jefbed, Mon Aug 23 01:15:56 2004 UTC
# Line 75  antiright_setup_pixmap_attributes_for_wi Line 75  antiright_setup_pixmap_attributes_for_wi
75  {  {
76    Pixel background;    Pixel background;
77    XpmAttributes attributes;    XpmAttributes attributes;
78    XpmColorSymbol symbol;    XpmColorSymbol *symbol=xmalloc(sizeof(XpmColorSymbol));
79    
80    XtVaGetValues(widget, XmNbackground, &background, NULL);    XtVaGetValues(widget, XmNbackground, &background, NULL);
81    symbol.name=NULL;    symbol->name=NULL;
82    symbol.value="none";    symbol->value="none";
83    symbol.pixel=background;    symbol->pixel=background;
84    attributes.colorsymbols=&symbol;    attributes.colorsymbols=symbol;
85    attributes.numsymbols=1;    attributes.numsymbols=1;
86    attributes.valuemask=XpmColorSymbols;    attributes.valuemask=XpmColorSymbols;
87    return(attributes);    return(attributes);
88  }  }
89    void
90    antiright_free_pixmap_attributes(XpmAttributes *attributes)
91    {
92      free(attributes->colorsymbols);
93    }
94    
95  void  void
96  antiright_set_widget_pixmaps(Widget label, Pixmap bitmap)  antiright_set_widget_pixmaps(Widget label, Pixmap bitmap)
# Line 106  antiright_set_pixmap_from_data(Widget wi Line 112  antiright_set_pixmap_from_data(Widget wi
112    attributes=antiright_setup_pixmap_attributes_for_widget(widget);    attributes=antiright_setup_pixmap_attributes_for_widget(widget);
113    XpmCreatePixmapFromData(antiright.display, antiright.root_window,    XpmCreatePixmapFromData(antiright.display, antiright.root_window,
114                            data, &bitmap, NULL, &attributes);                            data, &bitmap, NULL, &attributes);
115      antiright_free_pixmap_attributes(&attributes);
116    antiright_set_widget_pixmaps(widget, bitmap);    antiright_set_widget_pixmaps(widget, bitmap);
117  }  }
118    
# Line 121  antiright_set_bitmap_from_file(Widget la Line 128  antiright_set_bitmap_from_file(Widget la
128        attributes=antiright_setup_pixmap_attributes_for_widget(label);        attributes=antiright_setup_pixmap_attributes_for_widget(label);
129        XpmReadFileToPixmap(antiright.display, antiright.root_window,        XpmReadFileToPixmap(antiright.display, antiright.root_window,
130                            filename, &bitmap, NULL, &attributes);                            filename, &bitmap, NULL, &attributes);
131          antiright_free_pixmap_attributes(&attributes);
132      }      }
133    else /* File is a bitmap.  */    else /* File is a bitmap.  */
134      {      {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26