Skip to content

Commit 36ab85b

Browse files
authored
Update digestR.R
1 parent 83938f1 commit 36ab85b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

R/digestR.R

+8-5
Original file line numberDiff line numberDiff line change
@@ -19054,7 +19054,6 @@ onDisplayProteome <- function()
1905419054
}
1905519055
displayGenomeButton <- ttkbutton(genePlotTypeFrame, text='Display Full Proteome', width=21, command=onDisplayProteome)
1905619056

19057-
1905819057
onDisplayGene <- function() {
1905919058
# Generate a temporary dialog window
1906019059
geneDialog <- tktoplevel()
@@ -19064,21 +19063,25 @@ onDisplayGene <- function() {
1906419063
geneLabel <- ttklabel(geneDialog, text = 'Enter the name of the gene you wish to view in detail:')
1906519064
tkgrid(geneLabel, padx = 10, pady = 5)
1906619065

19066+
# Create Tcl variables to hold the gene name values
19067+
geneEntryVar <- tclVar("")
19068+
geneDropdownVar <- tclVar("")
19069+
1906719070
# Entry box for manual gene name input
19068-
geneEntry <- tkentry(geneDialog, width = 30)
19071+
geneEntry <- tkentry(geneDialog, width = 30, textvariable = geneEntryVar)
1906919072
tkgrid(geneEntry, padx = 10, pady = 5)
1907019073

1907119074
# Dropdown (combobox) populated with available gene names from species$genes$name
1907219075
geneNamesList <- species$genes$name # Assuming this is a list of available gene names
19073-
geneDropdown <- ttkcombobox(geneDialog, values = geneNamesList, width = 27)
19076+
geneDropdown <- ttkcombobox(geneDialog, values = geneNamesList, width = 27, textvariable = geneDropdownVar)
1907419077
tkgrid(geneDropdown, padx = 10, pady = 5)
1907519078

1907619079
# Function to handle the 'OK' button click
1907719080
onOK <- function() {
1907819081
# Get the gene name from either the entry box or dropdown
19079-
geneName <- tclvalue(geneEntry)
19082+
geneName <- tclvalue(geneEntryVar)
1908019083
if (nchar(geneName) == 0) {
19081-
geneName <- tclvalue(geneDropdown) # Fall back to dropdown selection
19084+
geneName <- tclvalue(geneDropdownVar) # Fall back to dropdown selection
1908219085
}
1908319086

1908419087
if (nchar(geneName) == 0) {

0 commit comments

Comments
 (0)