Re: [gtk-list] Largest pixmap?



As the well known David J. Topper said...
->Hey folks,
->
->I have a little app. that I'm going to call "pfield slider."  As a pun,
->I'd like to have a nice image of a baseball player sliding into home
->plate.  I've got the image, have converted it into .xpm format with xv. 
->And I'm doing the following to load it:
->
->  style = gtk_widget_get_style( window );
->  pixmap = gdk_pixmap_create_from_xpm(window,
					^^^^^^
    Perhaps this should be window->window, since gdk_create_pixmap_xxx
    wants a GdkWindow (not a GtkWindow, a GdkWindow :)

->&mask,&style->bg[GTK_STATE_NORMAL],"./image.xpm");
->  image = gtk_pixmap_new( pixmap, mask );
->  gtk_widget_show( image );
->  gtk_container_add( GTK_CONTAINER(window), image );
->
->But my app segfaults.  I have some other boxes and stuff in the window,
->but I've commented them out and still get a segfault.
->
->Some questions:
->
->	- is there an easier way to display an image?
    Perhaps by including the xpm file as a classic header and use
    gtk_pixmap_create_from_xpm_d().

->	- is there a limit to how large an image we can display?
    Since GTK+ uses the xpm lib, the only limit in processing xpm images
    should be the ones of libxpm. By having a look to the gtk source, I
    have not found any 

->	- can an image be displayed w/i a box?
    I believe it is possible, but I may be wrong (by "box", you
    think an [hv]box, true ?. If you do so, the response is certainly
    yes - remember the examples/button program, which stores an xpm and
    a label in a box and then in a button).

->
->Thanks,
->
->DT
->--
->Technical Director, Virginia Center for Computer Music
->Programmer / Analyst, Dean's Office (School of A&S)
->http://www.people.virginia.edu/~djt7p
->(804) 924-6887

	Hope this helps, Yours,

-- 
__________________________________________________________________________
   Emmanuel DELOGET [pixel] pixel@{dotcom.fr,epita.fr}  ----  DotCom SA
         http://www.epita.fr/~pixel | http://www.dotcom.fr/~pixel
"On the last day, God created Linux. And Microsoft won its antitrust case"
--------------------------------------------------------------------------



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