Sign up

Frame ShadowType Question...

Just wondering if Frame's setShadowType() function is working properly. I tried passing it all options from the enum (IN, OUT, ETCHED_IN, ETCHED_OUT) but they all look exactly the same... except NONE. That looks like what I expected: no frame.

class FrameOut : Frame
{
	private:
	string titleLabel = "Coordinates";
	FrameChildGrid frameChildGrid;
	
	public:
	this()
	{
		super(titleLabel);
		setShadowType(ShadowType.NONE);
		frameChildGrid = new FrameChildGrid();
		add(frameChildGrid);
		
	} // this()
	
} // class FrameOut

What am I missing?

Re: Frame ShadowType Question...

On 09-08-2019 21:43, Ron Tarrant wrote:

Just wondering if Frame's setShadowType() function is working properly. I tried passing it all options from the enum (IN, OUT, ETCHED_IN, ETCHED_OUT) but they all look exactly the same... except NONE. That looks like what I expected: no frame.

.....

What am I missing?

Gtk treats any value other NONE as the same value, so it's like a
boolean but with more than one value meaning true.

Re: Frame ShadowType Question...

On Fri, 9 Aug 2019 22:57:05 +0200, Mike Wey wrote:

On 09-08-2019 21:43, Ron Tarrant wrote:

Just wondering if Frame's setShadowType() function is working properly. I tried passing it all options from the enum (IN, OUT, ETCHED_IN, ETCHED_OUT) but they all look exactly the same... except NONE. That looks like what I expected: no frame.

.....

What am I missing?

Gtk treats any value other NONE as the same value, so it's like a
boolean but with more than one value meaning true.

Okay, so the frame is either on or off. Frankly, I was wondering just how much etched-ness could be squeezed into a one-pixel-wide area anyway. :)

Thanks, Mike.

Re: Frame ShadowType Question...

On Fri, 9 Aug 2019 22:57:05 +0200, Mike Wey wrote:

Gtk treats any value other NONE as the same value, so it's like a
boolean but with more than one value meaning true.

You're probably answering these other questions with this reply, but just to clarify...

Is this behaviour specific to GtkD or is it all implementations of GTK?

Will it these style values have the intended effect in 4.0? In other words, will they work?

Re: Frame ShadowType Question...

On 10-08-2019 13:39, Ron Tarrant wrote:

On Fri, 9 Aug 2019 22:57:05 +0200, Mike Wey wrote:

Gtk treats any value other NONE as the same value, so it's like a
boolean but with more than one value meaning true.

You're probably answering these other questions with this reply, but just to clarify...

Is this behaviour specific to GtkD or is it all implementations of GTK?

Will it these style values have the intended effect in 4.0? In other words, will they work?

It appears that the other values are there for legacy reasons, and with
the move to CSS for styling the different options were removed.

So they will most likely not work in 4.0, and you will need to add some
CSS to change the border of the frame.

Re: Frame ShadowType Question...

On Sat, 10 Aug 2019 13:45:12 +0200, Mike Wey wrote:

So they will most likely not work in 4.0, and you will need to add some
CSS to change the border of the frame.

Okay, thanks. At least it's still doable.