LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you manually set a "dirty dot" (file changed indicator) in an executable window title?

Solved!
Go to solution

I'm probably using the wrong terminology here, which is why I can't find it in Google, so apologies if this is dumb.

 

I have an application where a user can load in a test file, do some stuff, then save it if they want to.

 

I'd like to add "asterisk appears in the window title when the file is unsaved" functionality to my program.

 

Obviously, I can just read the current window title and append an asterisk, but I wondered if this might be an OS-level thing where I can tell the OS that this window should have the "dirty dot".

 

For example, I don't use Macs or Linux much, but I could imagine they may have a different style to indicate a changed document than Windows. I could also imagine other languages might have a different dirty dot scheme.

 

So, I wouldn't be surprised to learn that there's a "set dirty dot" function that calls OS stuff to set this, and I'd rather use that if it already exists.

0 Kudos
Message 1 of 5
(271 Views)
Solution
Accepted by topic author BertMcMahan

Just go ahead and set the Windows Title property.  There won't be an easier way and, the property node will give you a great place to attach the BD comment explaining what you did.

 

That "Wheel" is round enough, no need to reinvent a new one. 

 

You might consider also setting a file unsaved flag to throw a user prompt for save in the "application Close?" Event.


"Should be" isn't "Is" -Jay
Message 2 of 5
(260 Views)

Fair enough. I already have the user save warning popup, I just wanted to spruce up the UI a bit. I figured if the OS could handle appending the dot and removing it, it would save me the bit of time to make a function to do it. Plus if Windows comes up with some kind of "stick a red dot on the window icon to indicate file changed" in the future, then this would be forward-compatible 🙂

 

I'm using MGI's Panel Actor library so I'll probably just make a message to set or clear the dot.

0 Kudos
Message 3 of 5
(251 Views)

@BertMcMahan wrote:

Fair enough. I already have the user save warning popup, I just wanted to spruce up the UI a bit. I figured if the OS could handle appending the dot and removing it, it would save me the bit of time to make a function to do it. Plus if Windows comes up with some kind of "stick a red dot on the window icon to indicate file changed" in the future, then this would be forward-compatible 🙂


There is no such thing as a Windows dirty dot window naming flag! It may be implemented by some specific UI widget libraries but generally, applications all handle that individually by modifying the window title as needed. I sometimes enhance that by also showing the currently used configuration file or data file, with or without full path, to the window title too.

Rolf Kalbermatter
My Blog
Message 4 of 5
(188 Views)

@rolfk wrote:

There is no such thing as a Windows dirty dot window naming flag!

Thanks for confirming! I'd tried Googling it but didn't get much relevant info. I assumed this was the case, but wanted to ask around to be sure.

0 Kudos
Message 5 of 5
(144 Views)