-
Notifications
You must be signed in to change notification settings - Fork 9
Pronob's GUI work #261
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
base: master
Are you sure you want to change the base?
Pronob's GUI work #261
Conversation
adampbeardsley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good crack at it. I've made a bunch of suggestions - mostly taking out commented code. Look over and see if you agree with things. I'll need to get into the lab to try it out and see how it looks.
daq/chart-observe.py
Outdated
| # directory = user+"_"+location+"_"+date_y_m_d+"_"+trial+"_"+time.replace(":", ".")+"_"+tDay | ||
| # New format without location and with latitude and longitude | ||
| # I used f strings here for clarity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # directory = user+"_"+location+"_"+date_y_m_d+"_"+trial+"_"+time.replace(":", ".")+"_"+tDay | |
| # New format without location and with latitude and longitude | |
| # I used f strings here for clarity |
Glad you're using f strings, but don't need to include the explanation in the code.
And don't need to say that it's a new format - it will be in the changelog, and having the comment might confuse future devs
daq/chart-observe.py
Outdated
| # It will only shows for active entry | ||
| active_hint_label = None # global tracker | ||
|
|
||
| def add_hint_label(entry_widget, hint_text, position="below"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this function up to the top where other functions are defined.
daq/chart-observe.py
Outdated
| active_hint_label = None # global tracker | ||
|
|
||
| def add_hint_label(entry_widget, hint_text, position="below"): | ||
| # Adds a small gray hint label that appears only while typing in this entry.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Adds a small gray hint label that appears only while typing in this entry.""" | |
| """ Adds a small gray hint label that appears only while typing in this entry. | |
| The goal is to have the hints under the entry or to the side so that the user knows what format to use.""" |
daq/chart-observe.py
Outdated
| # This function is to add hint labels to entry widgets when the user starts typing | ||
| # the goal is to have the hints under the entry or to the side so that the user knows what format to use | ||
|
|
||
| # def add_hint_label(entry_widget, hint_text, position="below"): | ||
| # #Adds a small gray hint label that appears when the user starts typing. | ||
| # hint_label = customtkinter.CTkLabel(master=app, | ||
| # text=hint_text, | ||
| # text_color="gray50", | ||
| # font=("Arial", 10)) | ||
| # hint_label.place_forget() # Hidden until user types | ||
|
|
||
| # def on_type(event): | ||
| # content = entry_widget.get() | ||
| # if content.strip(): | ||
| # x, y = entry_widget.winfo_x(), entry_widget.winfo_y() | ||
| # if position == "below": | ||
| # hint_label.place(x=x, y=y + entry_widget.winfo_height() + 2) | ||
| # else: # show beside | ||
| # hint_label.place(x=x + entry_widget.winfo_width() + 5, y=y) | ||
| # else: | ||
| # hint_label.place_forget() | ||
|
|
||
| # # Bind typing events | ||
| # entry_widget.bind("<KeyRelease>", on_type) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # This function is to add hint labels to entry widgets when the user starts typing | |
| # the goal is to have the hints under the entry or to the side so that the user knows what format to use | |
| # def add_hint_label(entry_widget, hint_text, position="below"): | |
| # #Adds a small gray hint label that appears when the user starts typing. | |
| # hint_label = customtkinter.CTkLabel(master=app, | |
| # text=hint_text, | |
| # text_color="gray50", | |
| # font=("Arial", 10)) | |
| # hint_label.place_forget() # Hidden until user types | |
| # def on_type(event): | |
| # content = entry_widget.get() | |
| # if content.strip(): | |
| # x, y = entry_widget.winfo_x(), entry_widget.winfo_y() | |
| # if position == "below": | |
| # hint_label.place(x=x, y=y + entry_widget.winfo_height() + 2) | |
| # else: # show beside | |
| # hint_label.place(x=x + entry_widget.winfo_width() + 5, y=y) | |
| # else: | |
| # hint_label.place_forget() | |
| # # Bind typing events | |
| # entry_widget.bind("<KeyRelease>", on_type) |
daq/chart-observe.py
Outdated
| active_hint_label.place_forget() | ||
|
|
||
| # Show this hint | ||
| content = entry_widget.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is content used for?
daq/chart-observe.py
Outdated
|
|
||
| # Add hint labels for all entries with appropriate positions | ||
| # Position can be "below" or "beside" as needed | ||
| add_hint_label(freq_i_in, "Start frequency in MHz", position="below") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are some of these redundant with the labels that are already there?
Co-authored-by: Adam Beardsley <adam.p.beardsley@gmail.com>
Co-authored-by: Adam Beardsley <adam.p.beardsley@gmail.com>
Co-authored-by: Adam Beardsley <adam.p.beardsley@gmail.com>
Co-authored-by: Adam Beardsley <adam.p.beardsley@gmail.com>
|
A couple notes from testing out the latest changes:
|



@Maxman0001 I'm creating a (draft) pull request from your branch to make it easier to discuss changes.