Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to run pico_project.py from other directories #8

Merged
merged 1 commit into from
Jan 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def init_window(self, args):
mainFrame = tk.Frame(self, bg=GetBackground()).grid(row=0, column=0, columnspan=6, rowspan=12)

# Need to keep a reference to the image or it will not appear.
self.logo = tk.PhotoImage(file="logo_alpha.gif")
self.logo = tk.PhotoImage(file=self._get_filepath("logo_alpha.gif"))
logowidget = ttk.Label(mainFrame, image=self.logo, borderwidth=0, relief="solid").grid(row=0,column=0, columnspan=5, pady=10)

namelbl = ttk.Label(mainFrame, text='Project Name :').grid(row=2, column=0, sticky=tk.E)
Expand Down Expand Up @@ -727,6 +727,9 @@ def config(self):
# Run the configuration window
self.configs = ConfigurationWindow(self, self.configs).get()

def _get_filepath(self, filename):
return os.path.join(os.path.dirname(__file__), filename)

def CheckPrerequisites():
global isMac, isWindows
isMac = (platform.system() == 'Darwin')
Expand Down