Conversation
adampbeardsley
left a comment
There was a problem hiding this comment.
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.
| # 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.
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.
| # 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.
| # 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.
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.
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.