Drawing Custom Widget

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Drawing Custom Widget

Submitted by Anonymous (not verified) on

Fri, 06/15/2012 - 12:07

Is it possible with Motif or XLib to draw a custom widget? Currently, I am trying to copy the functionality of the Windows GroupBox. I don't think XmFrame will work, as you must add Widgets to it instead of just placing them arbitrarily on the Form. I've also tried drawing my own GroupBox using XmSeparator, but I'm unable to get rid of a 1 pixel border on both sides of each line, even after setting XmborderWidth, Xmmargin, and XmhighlightThickness, and XmshadowThickness to 0.
Does anyone have any suggestions? Is there some low-level way to draw lines so I can just draw it on my own?
Thanks in advance!
‹ New revision of Xplore? BxPro Examples ›

 

Sat, 12/09/2006 - 16:35#1

Sat, 12/09/2006 - 16:35#1

Submitted by yahubat on

Mon, 07/16/2012 - 13:41

Sat, 12/09/2006 - 16:35#1

swilderd

RE: Drawing Custom Widget

An XmFrame should work for you. You probably want to put an XmBulletinBoard in the XmFrame and then put your widgets (including a group label) on the BulletinBoard.

This solution does not, however, produce the group-label that the Windows GroupBox has. You will have to create a custom widget, if you want something that looks exactly like a Windows GroupBox. This can be done by sub-classing the XmDrawingArea and drawing the boarder and label; your widgets can be placed within the DrawingArea (and the drawn boarder) like you do with a BulletinBoard. This seems like a lot of work just to get the group-label, though.

 

Thu, 12/14/2006 - 21:46#2

Thu, 12/14/2006 - 21:46#2

Submitted by yahubat on

Mon, 07/16/2012 - 13:41

Thu, 12/14/2006 - 21:46#2

delmierda

Drawing Custom Widget

I don't believe that using Frame will work. As I said in my original post, I can't guarantee the order in which widgets are going to be drawn. If the Frame gets drawn first, everything works fine. However, if I draw a Frame and then draw some other widget, say, a Label, the Frame will "cover up" the Label.

I can't use the Frame as a container class. In other words, you might say that I need a Frame with the outline but that is "clear" so you can see widgets that might be "under" it.

Thanks for the help.