[comp.windows.x] bitmaps in widgets

rusty@BOSCO.BERKELEY.EDU (05/03/88)

How can I put a bitmap/pixmap in a Toolkit widget?  I tried using
BackgroundPixmap with a label widget with no success.

Along the same lines (but for a different application) does anybody
have a "graphics" widget which I could use the general Xlib drawing
commands with?

swick@ATHENA.MIT.EDU (Ralph R. Swick) (05/03/88)

>                                                     does anybody
> have a "graphics" widget which I could use the general Xlib drawing
> commands with?

create an instance of the Core widget (class "widgetClass").

rusty@BOSCO.BERKELEY.EDU (05/04/88)

Ok, thanks, I'll give that a try.

haynes@WSL.DEC.COM (05/04/88)

>>                                                     does anybody
>> have a "graphics" widget which I could use the general Xlib drawing
>> commands with?
>
>create an instance of the Core widget (class "widgetClass").

This almost works, the biggest problem is that Core doesn't have a
repaint proc, and even if it did, a per-class repaint proc isn't what
you want for a window widget.

You want to make a simple subclass of core that has a repaint proc in
the instance, and a class repaint method that calls the instance repaint proc.

Alternatively do what Ralph suggested, but register an expose event
handler explicitly.

	-- Charles

spencer@spline.eecs.umich.edu (Spencer W. Thomas) (05/05/88)

I've written a widget I called a "Slate" (cause you can draw on it...)
It provides 
	* a drawing surface,
	* repaint & resize callbacks,
	* mouse event callback,
	* A "label" that you can position anywhere in the window.

It's still probably got bugs, but I'd be happy to post it.

=Spencer (spencer@crim.eecs.umich.edu)