What Xresources reference will control tk_chooseDirectory background? Non-responsive to specifications - tcltk

I have tried many different .Xresources definitions to control the background colour for the box which displays directories and files in the tk_chooseDirectory widget, without success.
I was hoping to locate the source code for tk_chooseDirectory, hoping that would reveal the name of the controlling resource, but I have not been able to locate that.
The context of the widget call is as follows:
proc tkecl:getDirectory {initdir title} {
return [tkecl:get_path_popup $initdir directory \
[list tk_chooseDirectory -initialdir $initdir -title $title]]
}
tk_chooseDirectory itself does not allow specifying such colour control at time of call, so how can I override?
Based on suggestions, I confirmed the foreground colour is controlled by:
*Canvas.foreground: #008F00
That should imply background is controlled by
*Canvas.background: #1F1F1F
However, tk_chooseDirectory ignores that resource definition. On a lark, I tried
*Canvas.fill: #1F1F1F
but that did not have any impact either.
How do we get around that ?
I even tried variations involving
!Xt*.background: #000000
!Xt*.foreground: #FFFF00
!Xaw*.background: #000000
!Xaw*.foreground: #FFFF00
!Xm*.background: #000000
!Xm*.foreground: #FFFF00
!Xraw*.background: #000000
!Xraw*.foreground: #FFFF00
Is there a central file that controls the look and feel for the class of widgets to which tk_chooseDirectory belongs? If so, where is that?
The developer of the application has been unable to identify the resource that controls the background for tk_chooseDirectory.
tk_chooseDirectory even ignores statements of the following form coded immediately before the call:
option add *Canvas.background "#1F1F1F" userDefault
or
option add *Canvas.background "#1F1F1F" interactive
What gives???

Related

Is it possible to change colour palette on a per window / user control basis?

I am wondering if with the Telerik WPF library it is possible to change colour palette on a per window / usercontrol basis.
For clarity, I am not refering to basic Foreground or Background colours, I am interested in changing colours for certain visual states such mouse over or focused which is not possible to simple change on a control.
In the docs there is a sample for changing a colour palette such as FluentPalette.Palette.BasicColor = (Color)ColorConverter.ConvertFromString("#33000000");.
But this will have an effect on the whole app UI, whereas I am aiming to change the palette on a per window basis.
The way it looks to me, the only option would be to copy the specific theme for each variant (if that's possible at all) each with its colour palette tweaks for each window, which is of course overkill.
Any ideas?

Why is the Designer in Codename one not reporting the attributes I set?

I started a Codename One project with the "Hello World bare bones". I used to define the styles in the Theme tab from the Designer but now it is becoming tedious.
Actually for some selectors, even if I override (unchecking the Derive box) some properties the style is not changed in the Designer (see below) or in the app itself.
However, in the list of selectors, the color is not the one I selected but the alignment seems to be it.
It seems that the theme is locked somewhere. Do I make a mistake, or should I set a constant to "unlock" the theme, or even should I clear some directories?
Please note that I am using NetBeans with designer V 1.1
.
Edit March 1st 2017
Following #Diamond's great tips, I was able to change the foreground color by setting the Border to empty (instead of NULL). However now the alignment is still not what I expect (see below). How can I do for this property ?
Any help appreciated,
In the Designer, Border is superior to background color and background image. Which means if the border image is set, a background color will have no effect unless the border is just a stroke or line.
Always solve this with these few steps:
Go to the Border tab and uncheck the override.
Click the ... button next to Border Help and a new Dialog will show.
Change the Type (First line) to Empty and click Ok.
Your background color will now have an effect.

Caling upon the smooth all attribute in maya using python or MEL

I am trying to script a setup where the map borders is set to something specific after smoothing the geo in the viewport. I don't know how to call upon that attribute or change it.
It's under smooth mesh - extra controls in the GEOShape of the mesh.
Any ideas?
Mel or Python... I dont care, I just need to know how to reach these? :-)
Open up the Script Editor, and turn on History > Echo All Commands
Also open the Window > General Editors > Attribute Spreadsheet.
From the All tab, find Keep Map Borders.
As you change the radio button between Do not smooth, Smooth internal, and Smooth all, you'll see the value in the Attribute Spreadsheet change between All, Internal, and None.
Type All in the Attribute Spreadsheet, and look over at the Script Editor. You should see this line:
setAttr "pCubeShape1.keepMapBorders" 2;
That is the MEL command that sets Map Borders to Do not smooth

Shell Integration Library WindowChrome with Drop Shadow

Ive been googling this alot but can't find any working solution. Im using Shell Integration Library to cerate custom Window Chrome and I also need drop shadows for this window. Some say setting GlassFrameThickness to -1 do the trick but its not working for me. And Jeremiah Morrill suggested using DwmExtendFrameIntoClientArea. Ive tried that and it works, sort of. The shadows looks ok but when the window is shown it is first shown as a glass-frame and then a second later the real content is superimposed. This causes to much flickering for me. Is there any way to get rid of this flickering or is there any better way using only Shell Integration Library?
I had a similar problem where it wouldn't display any shadow when using a custom chrome. It worked fine when using the glass.
I got a shadow by setting GlassFrameThickness="0,0,0,1". The glass didn't show and I got the shadow.
Be warned, the shadow is a simple RECT to Windows, so if you have a funky chrome with transparencies it may look funny.
Also if you support the maximized state be aware the you'll need to set a margin on your top-level panel element of "8,8,8,8" when in maximized mode. All other modes should be "0,0,0,0".
To alimbada, the WindowStyle defaults to None on custom chrome.
The Shell Integration Library uses DwmExtendFrameIntoClientArea, plus handling of several Window messages to get the effects. If you're using the full window rect (i.e. no rounded corners) then setting it to (0,0,0,1) as suggested will give you the drop shadows as you want. If you want to simulate the rounded corners of Aero, then setting it to (8,8,8,8) will extend the glass frame enough that the corners also stay rounded, and then you're responsible for not drawing over the corners of the rectangle. The shape of the drop shadow doesn't change regardless of the glass frame thickness.
The flashing you're seeing when setting the thickness to -1 still exists even when not fully extending the glass frame. What's happening is the window is getting shown while the content is still compositing. What you can do is simplify the default UI so it displays quicker (or you can stage it, bringing in a simnple background first and then replacing it with something usable), or you can create and show the window off-screen, and then move it to the desired start location once the content has been rendered. The easy way to detect when it's probably ready is to invoke a DispatchTimer with Priority=Loaded. That should only get invoked once the basic first layout has been completed.

FlowDocument loses ClearType in child elements when placed in window with custom glass

So the new WPF 4 text rendering looks great, but enabling the aero glass effect on a window requires that you change the background to transparent, which of course disables ClearType rendering.
Using the provided RenderOptions.ClearTypeHint=Enabled allows you to designate child elements to reenable ClearType rendering from that point in the tree. I've found a few other topics that talk about doing this for the ScrollViewer used internally inside RichTextBox and FlowDocumentScrollViewer, and creating a custom style does indeed fix it so that my FlowDocument gets ClearType rendering again.
However, this only applies to top level paragraphs in the FlowDocument. If I add floaters or figures, or a table, any text inside them is inexplicably grayscale again. I know that the glass effect is to blame, since disabling it reenables the ClearType rendering.
I looked through the visual tree with Snoop, but both the main content (which renders properly) and the sub-content (which is grayscale) have similar element hierarchies without anything to which I can attach RenderOptions.ClearTypeHint.
Has anyone run into this problem? Is there a workaround or a solution? I checked Connect but there isn't any bug filed about this. It's quite an annoying problem.
After doing a lot more research, and comparing the way different controls work on and off of aero glass, I've found a few answers. The TextBox control doesn't work properly either, but portions of FlowDocument and things like TextBlock do, which prompted me to explore why.
After digging around in reflector for a while, I found that when using the advanced text formatting APIs to get text and render it onto a drawing context, the RenderOption flags essentially go ignored, since the drawing system knows from the root visual (the window) that transparency was enabled. Once that happens, all the RenderOptions flags in the world aren't going to get ClearType back.
I did happen to stumble on a work-around though. If you have access to the DrawingContext and are doing the low-level text rendering yourself, you can do a DrawRectangle behind the text with a fill, and ClearType gets reenabled. I assume that this is the only way for the renderer to be sure that it has a proper background to draw on.
So in summary, you need to do your own text drawing, and additionally you need to explicitly draw a background using the same DrawingContext behind your text in order for ClearType to get rendered properly.
I know this could get tedious, but have you tried setting general styles like so:
<Style TargetType="Paragraph">
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>

Resources