how i can change the default icon in the left of the window in Mac OS? - python-3.x

Now I want to design a simple game by using python, the step I want to do is to add an icon on the left of the window.
However, when I type
game_window.iconbitmap('favicon.ico')
game_window.mainloop()
the system just tell me Document Drag Error.
I am sure I save favicon and the both in the desktop and both of the path is correct.
I search this question in the internet but all of them are using window os.

If your icon is in the same folder as your file, the script will surely work...
I think that you're getting the error because you didn't save the file you're working on for the first time.
Try the following:
Save your file in the same folder another time (if you've already done it).
If it doesn't work, then write the full path of the icon

Related

How to set icon(or .ico file) on executable file in linux system?

I've been trying to set icon on executable file(.exe) in linux and macOS.
what I learn is there are 3 places icon sets: on taskbar, window bar, and executable file thumbnail.
I have set on taskbar and window bar, but not on exe file.
(By the way, I've already done on 3 of them in windows using visual studio.)
and I might not know exact term of it, so I will show the example below:
enter image description here
I guess .rc file should be in makefile.
If so, I could solve it also in macOS.
If not, I want to know how to set in linux and macOS too.
Please let me know how to use it and set it. Thanks in advance.
p.s. I set icons on window bar and taskbar using GLFWimage and working on openGL3 & c++.
glfwSetWindowIcon(window, 1, &icon);
I guess .rc file should be in makefile.
While there is a "standardized" way for storing icons in Windows .exe files, there is no such method for "ELF" files (the most common executable file format under Linux).
on taskbar and window bar
The icon used by the window manager (e.g. for the task bar) is typically stored as "X11 window property". A "X11 window property" is some data assigned to a window by a program.
The program must provide the icon image as array and call the function XChangeProperty() (this is what the function glfwSetWindowIcon() indirectly does).
It is not necessary that the icon is stored in a special way (comparable to the .rc file in Windows); the program can simply store the icon in some const array or even calculate the icon image data before calling XChangeProperty().
... but not on exe file.
As I already have written, there is no "standardized" way to store icons in executable files for Linux.
Some file managers "know" certain programs and display the corresponding icons: They know that "xterm" is a terminal program, so they display the terminal icon. However, this icon is not stored inside the executable file but in the file manager: If you rename any executable file to "xterm", the terminal icon will be displayed.
There is an extension named "elfres" (it was named "elficon" some years ago) that allows adding icons to ELF executable files. The web site of that extension is found here. On the linked web site you also find a screen shot with an example - so you can check if I understood you correctly and this is what you are talking about.
Unfortunately, this is a non-standard extension. For this reason a "standard" Linux installation will not check if an executable file contains an icon and therefore not show the icon.
If you use the "elfres" method, you must install a special plug-in; otherwise the icons of executable files are not shown.

Close a file when multiple files open in OMEdit

I've just started to take a look at OpenModelica and I've been trying to get to grips with OMEdit. I currently have 2 files open (.mo files). Normally in an editor in this situation I can close a file by pressing the cross in the top right hand corner of the file, leaving only the other file in the perspective, but there isn't a cross in this case, so I don't know how to get round this. I've tried looking at the user guide and googling 'OpenModelica close file', but haven't found anything relevant.
Just found answer: just right-click on file name and click Close.

Sublime Text "Unable to save"

I didnt change any file paths and everything was working fine. I made one quick change saved it ok, did another change and I went to save it and got the following error. How can I solve this. It will save other files ok
Unable to save
D:\xampp\htdocs\websites\dev.liverpool\style\main.scss
Error:
MoveFileEx(D:\xampp\htdocs\websites\dev.liverpool\style\.sublae1.tmp, D:\xampp\htdocs\websites\dev.liverpoolzstylezmain.scss) failed,
Access is denied.
seems it's because Windows or another program is blocking the file. Sublime text uses a temporal file instead of editing the file directly, and when you save the file uses a API command to move this edited file to the original, so this command has restrictions when one file is locked and Sublime shows this alert.
Maybe this setting {"atomic_save": false} will work for you.
Go to the path where you installed sublime text 2 and...
Right click on the sublime_text 2.exe file.
Go to its properties.
Go to compatibility section under this.
Set its privilege level to "Run this program as an administrator".
Now change settings for all users and there also check the field "Run this program as an administrator".
Apply the changes.
I just solved the same issue on Sublime Text 3 beta, Stable Channel Build 3065 by doing the following under Windows 7:
Navigate to the Sublime Text 3 executable file, wherever you have it installed.
Right-click it and select properties.
Click on the tab marked "Security"
About half way down the tab, on the right hand side, under the list of group and user names is this little button:
Click it.
If your machine is setup the way I suspect it is (otherwise you probably would not be having this issue), you should be prompted for your administrator account credentials. Enter them.
Now, select the Users group in the list, then take a look in the box at the bottom labeled 'Permissions for Users'. Put a check mark in the 'Allow' column for the 'Write' item.
Click 'Apply'
Click 'OK'
You should be set. What this does is it essentially gives Sublime the ability to write files while running with regular user privileges, no administrator level access required. Upon taking a better look at your error, what is happening is Sublime Text is creating a temp file for editing, rather than editing to file itself, then attempting to overwrite the original file with the temp on save. The problem is that the program is not being run by a user with sufficient privileges to perform the overwrite, hence the failure with an 'Access denied' message.
A simple and effective solution: Right-click on the file you want to save, in my case it is index.html, go to the properties and uncheck read-only.
The Sublime text will start working fine.
I have come across this error quite many times and by un-checking read-only file attribute of index.html, I am able to get rid of it
I found out more ways to fix this:
Close and reopen the Sublime Text windows or
Open the file with Np++, add a space, save, quit, then you're prompted by ST to reload the file, click yes, and it works again... or
Open the FTP console to see if there's a transaction in progress - then cancel it
In my case the SFTP plugin seems to be causing this problem, as when the FTP connection is timed out, the file which is waiting to be uploaded is being used, and you try to overwrite it.
This happens because you're using ScoutApp or Compass, they block your SCSS files because they are checking for changes as you specified for a directory for those files.
I suggest you reading this:
http://aspirecode.com/how-to-add-sass-support-in-sublime-text/
Good luck!
On mac using a remote volume sometimes I experience this. The solution is to remove the temp file then save again and all fixed.
IE: if you are working on test.html then the temp file would be ._test.html
Remove ._test.html then save again.
For Mac-
Try changing the destination from 'Macintosh HD' to 'Documents' or any other folder.
Worked for me.
The plugin of Superlime solved this problem. It tries to save the file as root in SublimeText.
Reference Link: https://github.com/azubr/Superlime
Try switching your SublimeText process priority to higher level in process manager (it has to have higher priority than your scss compiling app, if you're using one).
It seems to have worked for me.
if it's not working after doing all suggestions, reinstall the program
On Mac I saved the file in Home directory and it gave me this alert, later when I re saved the file again this time in Document directory the file is working now. Using SublimeText 3.
I found this occurred when the folders are read-only. Right-click on the folders where your site is contained and see if read-only is selected in the properties.
Just open it as an administrator.
Because I want to edit anything and write as admin all the time, I set this program to always open as an administrator using "Configure Applications to Always Run as an Administrator".
Just got your file folder properties which you want to save and deselect to read only attribute.

SDL in Visual C++ - where to properly put images used in the program?

I'm just learning SDL and I would like to know where is the correct place to put images and other file stuff in?
I use Visual C++ 2010 Express and the problem is that when I compile a program and start it straightly from IDE, it instantly stops because it can't load images. But when I start it by clicking on it in Release/Debug folder, where these images are placed, it is, of course, OK.
It seems that the IDE starts the program from another path than Release/Debug folder.
My question is - how shall I deal with it? Is there a way of setting the location of images directly in Visual C++? I'm asking this question because when I'm unable to start the program from IDE -> I can't use that IDE's debugger.
I hope I explained my situation well enough and thanks for the answers.
If you click on your project with the right mouse button, select properties, on the window that opens, click on "Debugging", notice the entry "Working directory", put there the directory where you want your program to run.
I am used to create a folder called work and put images, sounds, etc, there and configure the working directory to use this folder.
Also, any dlls not in system path must go there for your program to find it or in the same folder where visual is creating your exe.
Also on the same window, you will see the "Environment" entry, you can use it to configure path to dlls if neeeded setting the PATH environment variable, like for example:
PATH=c:\mylibs\dlls\

Can't save php.ini

I have PHP for FastCGI installed on Windows 7 through the Web Platform Installer. I need to edit php.ini to enable logging, but I'm not able to overwrite the existing file, apparently because something has it open and/or locked.
Stopping the server in IIS Manager doesn't help; stopping the Windows Process Activation Service and the World Wide Web Publishing Service doesn't help. phpinfo() confirms that I'm working with the correct file (C:\Program Files (x86)\PHP\php.ini). It's not marked as read only and I do have permissions for it. I'm out of ideas.
I had this problem and managed to work around it. You need to be running the editor (notepad or whatever) as an admin.
In Window Vista / Window 7, right click and choose "Run as Administrator".
Then open php.ini and edit it...
Another option is to copy the text of the file into a new file in a different location, make your changes, save the file as 'php.ini'. Then copy the new file across overwriting the old one. Explorer may handle the permissions differently.
I've had a similar problem, and I was working in windows 10 which doesn't use "run as administrator"
So this is what I did:
right click the problem file and go to properties
go to tab security
click edit, which should have a shield
select in names of groups: Users(computer specifics\Users)
in the square under it you can allow editing of the file
This causes it to allow you to edit the file for users and not run into the problem anymore. This also removes the problem in the future for this file so you can always edit it again by just opening the file in text editor.
Please note I am Dutch and that certain names are translated incorrectly.
You could use the Find Handle feature of Process Explorer (direct EXE download link), from Sysinternals (a part of Microsoft now), to find out what exactly is locking the file.
I'm sorry I can't help with your exact question, but hope that helps!
In Windows 7, right click Notepad and choose "Run as Administrator". Make sure you do not use Notepad++ as your editor. It accesses this file and therefore tells you there's is an error.
The default notepad will work fine with these instructions.
Depending on what are you trying to write to the file, you can write to an '.htaccess' file on the root of the site instead. I can provide a more specific example if you would like.
You can also use Unlocker to figure this out. A pain, but the utility is really handy anyway so it won't hurt to have it around.
1) Open CMD with administrator mostly like this.
2) Then go to "C:\Program Files\php-8.1.7" like this.
3) then paste "cd C:\Program Files\php-8.1.7" and press Enter and type
php.ini like this.
4) It will automatically open the file in a text editor or suggest to
open any editor like notepad , notepad++,vs code etc.
5) edit as you wish and save it like (ctrl + s) .Here I adding MongoDB
extension like this .And that's it.
By the way the question was asked 12 years ago but we still facing the problem
Try this:
Stop the webserver
Change the file
Start the webserver
If that doesn't work, then you are probably changing the wrong file. It's possible that the original file is elsewhere and when the server starts it copies it to C:\Program Files (x86)\PHP\php.ini. phpinfo() might be pointing to the file that is overwritten every time...

Resources