Quantcast

Why does CwOverrideShell always have a border even after sending #borderWidth: 0?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Why does CwOverrideShell always have a border even after sending #borderWidth: 0?

Louis LaBrunda
Hi,

As you may know from my other post CwOverrideShell always has a border even after sending #borderWidth: 0.  CwOverrideShell>initializeResources:

initializeResources
"Private - Initialize the default resource values for the receiver."
super initializeResources.
xmNborderWidth := 1

sets xmNborderWidth (which is where borderWidth: goes) to 1.  I think this method can be removed as changing the last line to set xmNborderWidth to 0 doesn't stop CwOverrideShell from having a border.  The must be some other place that ignores the value of xmNborderWidth and tells the osWidget to have a border.  So far I haven't found that spot.  I think that since #borderWidth: exists, when the osWidget is created, xmNborderWidth should be checked for > 0 and only then should the WsBorder bit be set.  If we want to default xmNborderWidth to 1 when it is nil, I'm fine with that but if I set the border width to 0, there shouldn't be a border.  Even the comment of #borderWidth: says so:

"Set the value of the XmNborderWidth resource to resourceValue.
 Resource type: Integer
 Default setting: 1
 Resource access: CSG
 Description:
Specifies the width of the border that surrounds the
widget's window on all four sides.  The width is
specified in pixels.  A width of zero means that no
border will show."

Now before someone points out that #borderWidth: is a private method and therefor I shouldn't be calling it, this is still wrong.  If some unsuspecting Instantiations employee is working in CwOverrideShell, calling #borderWidth: 0 from within CwOverrideShell, it won't work the way they expect.

If I get a little time I will see if I can find where the osWidget is being sent the WsBorder flag bit.


Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Why does CwOverrideShell always have a border even after sending #borderWidth: 0?

Louis LaBrunda
Hi Again,

Okay, I take back wanting to get rid of CwOverrideShell>initializeResources because CwBasicWidget>initializeResources sets xmNborderWidth to 0 and it seems consistent for CwOverrideShell>initializeResources to set it to 1 if you want the default to be a border.  The problem lies elsewhere in that using #borderWidth: to change xmNborderWidth and eliminate the border doesn't work.  I still don't know why because it is hard to track down when there are other bit flags that are used to set the OSWidget to have a border.  Since I have a way around the problem, I'm going to leave it at that.

Lou

 
On Monday, October 10, 2016 at 2:21:20 PM UTC-4, Louis LaBrunda wrote:
Hi,

As you may know from my other post CwOverrideShell always has a border even after sending #borderWidth: 0.  CwOverrideShell>initializeResources:

initializeResources
"Private - Initialize the default resource values for the receiver."
super initializeResources.
xmNborderWidth := 1

sets xmNborderWidth (which is where borderWidth: goes) to 1.  I think this method can be removed as changing the last line to set xmNborderWidth to 0 doesn't stop CwOverrideShell from having a border.  The must be some other place that ignores the value of xmNborderWidth and tells the osWidget to have a border.  So far I haven't found that spot.  I think that since #borderWidth: exists, when the osWidget is created, xmNborderWidth should be checked for > 0 and only then should the WsBorder bit be set.  If we want to default xmNborderWidth to 1 when it is nil, I'm fine with that but if I set the border width to 0, there shouldn't be a border.  Even the comment of #borderWidth: says so:

"Set the value of the XmNborderWidth resource to resourceValue.
 Resource type: Integer
 Default setting: 1
 Resource access: CSG
 Description:
Specifies the width of the border that surrounds the
widget's window on all four sides.  The width is
specified in pixels.  A width of zero means that no
border will show."

Now before someone points out that #borderWidth: is a private method and therefor I shouldn't be calling it, this is still wrong.  If some unsuspecting Instantiations employee is working in CwOverrideShell, calling #borderWidth: 0 from within CwOverrideShell, it won't work the way they expect.

If I get a little time I will see if I can find where the osWidget is being sent the WsBorder flag bit.


Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Loading...