Can anybody help me to find wOOdy's numerical keyboard source files shown in below link ?
https://social.msdn.microsoft.com/Forums/en-US/711db9ac-b785-45eb-b6ad-6aface9724b7/virtual-keyboard-by-woodys-visual-foxpro-code-snippets?forum=visualfoxprogeneral
I searched in google but could not locate the files, may be i am not fluent in German :-D
The woody's links are broken and i cannot locate anywhere the post of virtual keyboard.
i have worked on this there is many years ago.
i send you below the flat code i adapted form the woody's virtual keyboard in only one prg-hope this helps you (my blog: http://yousfi.over-blog.com/)
*Begin code
set safe off
set defa to addbs(justpath(sys(16,1)))
publi m.myvar1,m.myvar2,m.myvar3
text to m.myvar1 noshow
/9j/4QFFRXhpZgAASUkqAAgAAAAIABIBAwABAAAAAQAAABoBBQABAAAAbgAAABsBBQABAAAAdgAAACgBAwABAAAAAgAAADEBAgAdAAAAfgAAADIBAgAVAAAAmwAAABMCAwABAAAAAgAAAGmHBAABAAAAsAAAAAAAAAAsAQAAAQAAACwBAAABAAAAQWRvYmUgUGhvdG9zaG9wIENTIE1hY2ludG9zaAAyMDA1OjEyOjE1IDEyOjU5OjI1AAAHAACQBwAEAAAAMDIyMAGRBwAEAAAAAQIDAACgBwAEAAAAMDEwMAGgAwABAAAAAQAAAAKgBAABAAAARgAAAAOgBAABAAAARgAAAAWgBAABAAAACgEAAAAAAAACAAEAAgAFAAAAKAEAAAIABwAEAAAAAwAAAAAAAAABAQEBAAAAAAAAAAAAAAAAAAAAAAD/wAARCABGAEYDASIAAhEBAxEB/9sAhAAFAwMEAwMFBAQEBQUFBgcNCAcHBwcQCwwJDRMQFBMSEBISFRceGRUWHBYSEhojGhwfICEiIRQZJSckICceISEgAQUFBQcGBw8ICA8gFRIVFSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICD/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJ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+nQs9mmtzXsxmLup3cWYzF3U7uZV7hXuK5h/iXEfhjZjMXdTu4sxmLup3cyr3CvcGYPEuI/DGzGYu6ndzUlUhhs+7qd3N2vca0peruJFyVSjvGPwzmKfUmqO6TyuI5ZG9u9D3l3lY9FT0Sn6LSDmZ/WiA1U47/wDigdHQz68YxqNJHRzTdoORuheL8iE03aDkboXi/ISzRht0jAAFRgAAACMfgWIx+AEnO7QXdudNFA2gu7c6aKDohoZWK9r6Okmm7QcjdC8X5EJpu0HI3QvF+QlmhDbpGAAKjAAAAEY/AsRj8AJOd2gu7c6aKBtBd2500UHRDQysV7X0dJNN2g5G6F4vyNGbI+7JoX8MRF5Gw+UIqiWaMF+LpGYJVyCuQqMKglXIK5AAqRj8D7XISixEVAA8HaC7tzpooE+Uvgta1KV3qfwDohoZWJ9j6PXnrdmicYsn4wonvQqP2teq/pX+lpNG1WYO85gFGlcfTnLIv0WozB3nMWozB3nMAixfPLkWozB3nMWozB3nMALBnlyLUZg7zmYrObF+jvOYAWDPLk97ZCQwJxiRpbKG78KH7MOGv3ejnOX8UAAatDgqNuTP/9k=
endtext
strtofile(strconv(m.myvar3,14),'img3.jpg')
publi yform
yform=newObject("asup")
yform.show
read events
retu
*
DEFINE CLASS asup AS form
Height = 222
Width = 252
AutoCenter = .T.
Caption = "Sampleform for Virtual Keyboard"
*-- Reference for the Keyboard
okeyboard = .NULL.
Name = "Form1"
ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Enter Value:", ;
Height = 17, ;
Left = 24, ;
Top = 36, ;
Width = 68, ;
Style = 3, ;
Name = "Label1"
ADD OBJECT text1 AS textbox WITH ;
FontName = "Courier New", ;
Alignment = 3, ;
Value = 0, ;
Height = 23, ;
InputMask = "999,999.999", ;
Left = 100, ;
SelectOnEntry = .T., ;
Top = 33, ;
Width = 128, ;
Name = "Text1"
ADD OBJECT label2 AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Enter Value:", ;
Height = 17, ;
Left = 25, ;
Top = 68, ;
Width = 68, ;
Style = 3, ;
Name = "Label2"
ADD OBJECT text2 AS textbox WITH ;
FontName = "Courier New", ;
Alignment = 3, ;
Value = 0, ;
Height = 23, ;
InputMask = "999,999.999", ;
Left = 101, ;
SelectOnEntry = .T., ;
Top = 65, ;
Width = 128, ;
Name = "Text2"
ADD OBJECT label3 AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Enter Value:", ;
Height = 17, ;
Left = 25, ;
Top = 99, ;
Width = 68, ;
Style = 3, ;
Name = "Label3"
ADD OBJECT text3 AS textbox WITH ;
FontName = "Courier New", ;
Alignment = 3, ;
Value = 0, ;
Height = 23, ;
InputMask = "999,999.999", ;
Left = 101, ;
SelectOnEntry = .T., ;
Top = 96, ;
Width = 128, ;
Name = "Text3"
ADD OBJECT label4 AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Enter Value:", ;
Height = 17, ;
Left = 26, ;
Top = 131, ;
Width = 68, ;
Style = 3, ;
Name = "Label4"
ADD OBJECT text4 AS textbox WITH ;
FontName = "Courier New", ;
Alignment = 3, ;
Value = 0, ;
Height = 23, ;
InputMask = "999,999.999", ;
Left = 102, ;
SelectOnEntry = .T., ;
Top = 128, ;
Width = 128, ;
Name = "Text4"
ADD OBJECT label5 AS label WITH ;
AutoSize = .T., ;
WordWrap = .T., ;
Caption = "Here the additional OK Button closes the entry form", ;
Height = 32, ;
Left = 12, ;
Top = 168, ;
Width = 204, ;
Name = "Label5"
PROCEDURE Destroy
** Kill the Keyboard
Thisform.okeyboard = .NULL.
ENDPROC
PROCEDURE Init
*
* THISFORM.oKeyboard = NEWOBJECT("tlbNumKeyboard1") &&uncomment to see another keybord....
** choose the one you like best
THISFORM.oKeyboard = NEWOBJECT("tlbNumKeyboard2")
** see also Form.Destroy for killig it
WITH THISFORM.oKeyboard
.LEFT = THISFORM.LEFT + THISFORM.WIDTH && position to the right of form
.TOP = (_SCREEN.HEIGHT - .HEIGHT) /2
.VISIBLE = .T.
ENDWITH
ENDPROC
PROCEDURE text1.LostFocus
This.BackColor = RGB(255,255,255)
ENDPROC
PROCEDURE text1.GotFocus
This.BackColor = RGB(255,128,255)
ENDPROC
PROCEDURE text2.GotFocus
This.BackColor = RGB(255,128,255)
ENDPROC
PROCEDURE text2.LostFocus
This.BackColor = RGB(255,255,255)
ENDPROC
PROCEDURE text3.GotFocus
This.BackColor = RGB(255,128,255)
ENDPROC
PROCEDURE text3.LostFocus
This.BackColor = RGB(255,255,255)
ENDPROC
PROCEDURE text4.GotFocus
This.BackColor = RGB(255,128,255)
ENDPROC
PROCEDURE text4.LostFocus
This.BackColor = RGB(255,255,255)
ENDPROC
Procedure destroy
clea events
endproc
ENDDEFINE
*
*-- EndDefine: asup
**************************************************
*
DEFINE CLASS cmdkeyboard AS commandbutton
Height = 70
Width = 70
FontBold = .T.
FontName = "Verdana"
FontSize = 22
Picture = "img1.jpg" &&"images\rot02_70x70.jpg"
Caption = "1"
PicturePosition = 12
Alignment = 2
Name = "cmdkeyboard"
PROCEDURE Click
DO CASE
CASE This.Caption ="C"
KEYBOARD "{BACKSPACE}"
CASE This.Caption ="Space"
KEYBOARD " "
CASE This.Caption ="<"
KEYBOARD "{LEFTARROW}"
CASE This.Caption =">"
KEYBOARD "{RIGHTARROW}"
CASE This.Caption = CHR(0xFC) && this is the Ansicode of that WingDings symbols, See \Windows\CharMap.exe for those codes
KEYBOARD "{ENTER}"
** Want to close the form?
_screen.ActiveForm.release()
CASE This.Caption = CHR(0xD9)
KEYBOARD "{UPARROW}"
CASE This.Caption = CHR(0xDA)
KEYBOARD "{DNARROW}"
CASE This.Caption = "."
KEYBOARD SET("POINT") && for international settings
OTHERWISE
KEYBOARD This.Caption
ENDCASE
ENDPROC
ENDDEFINE
*
*-- EndDefine: cmdkeyboard
*
DEFINE CLASS cntnumkeyboard1 AS container
Width = 209
Height = 278
BackStyle = 0
BorderWidth = 0
Name = "cntnumkeyboard1"
ADD OBJECT cmdkeyboard1 AS cmdkeyboard WITH ;
Top = 0, ;
Left = 0, ;
Name = "Cmdkeyboard1"
ADD OBJECT cmdkeyboard2 AS cmdkeyboard WITH ;
Top = 0, ;
Left = 69, ;
Caption = "2", ;
Name = "Cmdkeyboard2"
ADD OBJECT cmdkeyboard3 AS cmdkeyboard WITH ;
Top = 0, ;
Left = 138, ;
Caption = "3", ;
Name = "Cmdkeyboard3"
ADD OBJECT cmdkeyboard4 AS cmdkeyboard WITH ;
Top = 69, ;
Left = 0, ;
Caption = "4", ;
Name = "Cmdkeyboard4"
ADD OBJECT cmdkeyboard5 AS cmdkeyboard WITH ;
Top = 69, ;
Left = 69, ;
Caption = "5", ;
Name = "Cmdkeyboard5"
ADD OBJECT cmdkeyboard6 AS cmdkeyboard WITH ;
Top = 69, ;
Left = 138, ;
Caption = "6", ;
Name = "Cmdkeyboard6"
ADD OBJECT cmdkeyboard7 AS cmdkeyboard WITH ;
Top = 138, ;
Left = 0, ;
Caption = "7", ;
Name = "Cmdkeyboard7"
ADD OBJECT cmdkeyboard8 AS cmdkeyboard WITH ;
Top = 138, ;
Left = 69, ;
Caption = "8", ;
Name = "Cmdkeyboard8"
ADD OBJECT cmdkeyboard9 AS cmdkeyboard WITH ;
Top = 138, ;
Left = 138, ;
Caption = "9", ;
Name = "Cmdkeyboard9"
ADD OBJECT cmdkeyboard10 AS cmdkeyboard WITH ;
Top = 207, ;
Left = 0, ;
Caption = ".", ;
Name = "Cmdkeyboard10"
ADD OBJECT cmdkeyboard11 AS cmdkeyboard WITH ;
Top = 207, ;
Left = 69, ;
Caption = "0", ;
Name = "Cmdkeyboard11"
ADD OBJECT cmdkeyboard12 AS cmdkeyboard WITH ;
Top = 207, ;
Left = 138, ;
Caption = "C", ;
Name = "Cmdkeyboard12"
ENDDEFINE
*
*-- EndDefine: cntnumkeyboard1
*
DEFINE CLASS cntnumkeyboard2 AS cntnumkeyboard1
Width = 284
Height = 279
Name = "cntnumkeyboard2"
Cmdkeyboard1.Name = "Cmdkeyboard1"
Cmdkeyboard2.Name = "Cmdkeyboard2"
Cmdkeyboard3.Name = "Cmdkeyboard3"
Cmdkeyboard4.Name = "Cmdkeyboard4"
Cmdkeyboard5.Name = "Cmdkeyboard5"
Cmdkeyboard6.Name = "Cmdkeyboard6"
Cmdkeyboard7.Name = "Cmdkeyboard7"
Cmdkeyboard8.Name = "Cmdkeyboard8"
Cmdkeyboard9.Name = "Cmdkeyboard9"
Cmdkeyboard10.Name = "Cmdkeyboard10"
Cmdkeyboard11.Name = "Cmdkeyboard11"
Cmdkeyboard12.Name = "Cmdkeyboard12"
ADD OBJECT cmdkeyboard13 AS cmdkeyboard WITH ;
Top = 1, ;
Left = 212, ;
Height = 70, ;
Width = 70, ;
FontName = "Wingdings", ;
Picture ="img2.jpg", ;
Caption = "Ù", ;
Name = "Cmdkeyboard13"
ADD OBJECT cmdkeyboard14 AS cmdkeyboard WITH ;
Top = 70, ;
Left = 212, ;
Height = 70, ;
Width = 70, ;
FontName = "Wingdings", ;
Picture = "img2.jpg", ;
Caption = "Ú", ;
Name = "Cmdkeyboard14"
ADD OBJECT cmdkeyboard15 AS cmdkeyboard WITH ;
Top = 139, ;
Left = 212, ;
Height = 139, ;
Width = 70, ;
FontName = "Wingdings", ;
FontSize = 34, ;
Picture = "img2.jpg" , ;
Caption = "ü", ;
Name = "Cmdkeyboard15"
ENDDEFINE
*
*-- EndDefine: cntnumkeyboard2
**************************************************
*
DEFINE CLASS tlbnumkeyboard1 AS toolbar
Caption = "Numeric Input"
Height = 284
Left = 0
Top = 0
Width = 219
ControlBox = .F.
Name = "tlbnumkeyboard1"
ADD OBJECT cntnumkeyboard1 AS cntnumkeyboard1 WITH ;
Top = 3, ;
Left = 5, ;
Name = "Cntnumkeyboard1", ;
Cmdkeyboard1.Name = "Cmdkeyboard1", ;
Cmdkeyboard2.Name = "Cmdkeyboard2", ;
Cmdkeyboard3.Name = "Cmdkeyboard3", ;
Cmdkeyboard4.Name = "Cmdkeyboard4", ;
Cmdkeyboard5.Name = "Cmdkeyboard5", ;
Cmdkeyboard6.Name = "Cmdkeyboard6", ;
Cmdkeyboard7.Name = "Cmdkeyboard7", ;
Cmdkeyboard8.Name = "Cmdkeyboard8", ;
Cmdkeyboard9.Name = "Cmdkeyboard9", ;
Cmdkeyboard10.Name = "Cmdkeyboard10", ;
Cmdkeyboard11.Name = "Cmdkeyboard11", ;
Cmdkeyboard12.Name = "Cmdkeyboard12"
ENDDEFINE
*
*-- EndDefine: tlbnumkeyboard1
*
DEFINE CLASS tlbnumkeyboard2 AS toolbar
Caption = "Numeric Input"
Height = 285
Left = 0
Top = 0
Width = 294
ControlBox = .F.
Name = "tlbnumkeyboard2"
ADD OBJECT cntnumkeyboard21 AS cntnumkeyboard2 WITH ;
Top = 3, ;
Left = 5, ;
Name = "Cntnumkeyboard21", ;
Cmdkeyboard1.Name = "Cmdkeyboard1", ;
Cmdkeyboard2.Name = "Cmdkeyboard2", ;
Cmdkeyboard3.Name = "Cmdkeyboard3", ;
Cmdkeyboard4.Name = "Cmdkeyboard4", ;
Cmdkeyboard5.Name = "Cmdkeyboard5", ;
Cmdkeyboard6.Name = "Cmdkeyboard6", ;
Cmdkeyboard7.Name = "Cmdkeyboard7", ;
Cmdkeyboard8.Name = "Cmdkeyboard8", ;
Cmdkeyboard9.Name = "Cmdkeyboard9", ;
Cmdkeyboard10.Name = "Cmdkeyboard10", ;
Cmdkeyboard11.Name = "Cmdkeyboard11", ;
Cmdkeyboard12.Name = "Cmdkeyboard12", ;
Cmdkeyboard13.Name = "Cmdkeyboard13", ;
Cmdkeyboard14.Name = "Cmdkeyboard14", ;
Cmdkeyboard15.Name = "Cmdkeyboard15"
ENDDEFINE
*
*-- EndDefine: tlbnumkeyboard2
*endcode
Related
I want to create interactive line- and topoplot depending on menu. I figured out how to make red the line chosen in menu, but it doesn't work for topoplot marks (black circles inside topoplot). I can change it manually (cmap[][4] = RGB{N0f8}(1.0,0.0,0.0)), but how to do that interactively?
f = Figure(backgroundcolor = RGBf(0.98, 0.98, 0.98), resolution = (1500, 700))
ax = Axis(f[1:3, 1], xlabel = "Time [s]", ylabel = "Voltage amplitude [µV]")
N = 1:length(pos) #1:4
hidespines!(ax, :t, :r)
GLMakie.xlims!(-0.3, 1.2)
hlines!(0, color = :gray, linewidth = 1)
vlines!(0, color = :gray, linewidth = 1)
times = range(-0.3, length=size(dat_e,2), step=1 ./ 128)
lines = Dict()
for i in N
mean_trial = mean(dat_e[i,:,:],dims=2)[:,1]
line = lines!(times, mean_trial, color = "black")
lines[i] = line
end
hidedecorations!(ax, label = false, ticks = false, ticklabels = false)
topo_axis = Axis(f[2, 2], width = 178, height = 178, aspect = DataAspect())
Makie.xlims!(low = -0.2, high = 1.2)
Makie.ylims!(low = -0.2, high = 1.2)
topoMatrix = eegHeadMatrix(pos[N], (0.5, 0.5), 0.5)
cmap = Observable(collect(ColorScheme(range(colorant"black", colorant"black", length=30))))
#cmap[][4] = RGB{N0f8}(1.0,0.0,0.0)
topo = eeg_topoplot!(topo_axis, N, # averaging all trial of 30 participants on Xth msec
raw.ch_names[1:30];
positions=pos, # produced automatically from ch_names
interpolation=NullInterpolator(),
enlarge=1,
#colorrange = (0, 1), # add the 0 for the white-first color
colormap = cmap[],
label_text=false)
hidedecorations!(current_axis())
hidespines!(current_axis())
num_prev = 0
menu = Menu(f[3, 2], options = raw.ch_names[1:30], default = nothing)#, default = "second")
on(menu.selection) do selected
if selected != nothing
num = findall(x->x==menu.selection[], raw.ch_names[1:30])[]
if num_prev != 0
lines[num_prev].color = "black"
cmap[][num] = RGB{N0f8}(1.0,0.0,0.0)
end
lines[num].color = "red"
cmap[][num] = RGB{N0f8}(1.0,0.0,0.0)
num_prev = num
end
end
notify(menu.selection)
#print(cmap[])
f
We solved this by putting this string at the end of the menu.selection section:
notify(lines)
It works, because lines() automatically creates Observable.
In this simple calculator GUI, I'm creating a frame template using classes. The frame has 2 labels, 2 entry boxes, and a button. I'd like the button to run a specific command depending on the function_call variable passed when initializing - but this doesn't work. The two_points function should be called for the first object, and one_point should be called for the second. How do I dynamically change which command is called based on which object I'm using? Thank you for taking the time to read this.
from tkinter import *
root = Tk()
root.title("Simple Slope Calculator")
class Slope_Calc:
# Variable info that changes within the frame
def __init__(self, master, num_1, num_2, frame_name, label_1_name, label_2_name, function_call):
self.num_1 = int(num_1)
self.num_2 = int(num_2)
self.frame_name = frame_name
self.label_1_name = label_1_name
self.label_2_name = label_2_name
self.function_call = function_call
# Frame template
self.frame_1 = LabelFrame(master, text = self.frame_name, padx = 5, pady = 5)
self.frame_1.grid(row = self.num_1, column = self.num_2, padx = 10, pady = 10)
self.label_1 = Label(self.frame_1, text = self.label_1_name)
self.label_1.grid(row = 0, column = 0)
self.entry_1 = Entry(self.frame_1)
self.entry_1.grid(row = 0, column = 1)
self.label_2 = Label(self.frame_1, text = self.label_2_name)
self.label_2.grid(row = 1, column = 0)
self.entry_2 = Entry(self.frame_1)
self.entry_2.grid(row = 1, column = 1)
self.calc_button = Button(self.frame_1, text = "Calculate", command = self.function_call) # This is what doesn't work
self.calc_button.grid(row = 1, column = 2, padx = 5)
# Strips string of spaces and parentheses
# Returns a list of relevant ordered pair
def strip_string(self, entry_num):
ordered_pair = entry_num.get().split(", ")
ordered_pair[0] = ordered_pair[0].replace("(", "")
ordered_pair[1] = ordered_pair[1].replace(")", "")
return(ordered_pair)
# Calculates slope based on one point and y-intercept
def one_point(self):
pair_1 = self.strip_string(self.entry_1)
b = int(self.entry_2.get())
m = (int(pair_1[1]) - b)/(float(pair_1[1]))
label_3 = Label(self.frame_1, text = "SLOPE-INTERCEPT EQUATION: y = " + str(m) + "x + " + str(b))
label_3.grid(row = 2, column = 0, columnspan = 2)
# Calculates slope based on two points given
def two_points(self):
pair_1 = self.strip_string(self.entry_1)
pair_2 = self.strip_string(self.entry_2)
m = (int(pair_2[1]) - int(pair_1[1]))/float(int(pair_2[0]) - int(pair_1[0]))
b = (int(pair_1[1])) - (m*int(pair_1[0]))
label_3 = Label(self.frame_1, text = "SLOPE-INTERCEPT EQUATION: y = " + str(m) + "x + " + str(b))
label_3.grid(row = 2, column = 0, columnspan = 2)
# Calling each object
two_p = Slope_Calc(root, 0, 0, "Two Points", "First Ordered Pair", "Second Ordered Pair", "two_points")
one_p = Slope_Calc(root, 0, 1, "One Point and Y-Intercept", "Ordered Pair", "Y-intercept", "one_point")
root.mainloop()
The command keyword argument of the Button constructor is supposed to be a function.
Here you give it instead a string which is the name of the method of self that should be called. So you must first get this method using setattr to be able to call it. This should do it:
def call():
method = getattr(self, self.function_call)
method()
self.calc_button = Button(
self.frame_1,
text = "Calculate",
command = call)
You then have an error in strip_string but that's another story.
I'm having trouble separating these 2 sliders. They seem to be tracking together, but the variables seem to no be unique, and I can't figure out why. Can anyone help?
import tkinter as tk
sBoard = tk.Tk()
sBoard.geometry("800x400")
ch1_Frame = tk.LabelFrame(sBoard, text = "CH 1", bd = 5)
ch1_val = 0
ch1 = tk.Scale(ch1_Frame, variable = ch1_val, from_ =100, to = 0, showvalue = 0, width = 25, length = 200)
ch1.pack()
button1 = tk.Button(ch1_Frame, text = "Power")
button1.pack()
ch1_Frame.place(x=25, y=50)
ch2_Frame = tk.LabelFrame(sBoard, text = "CH 2", bd = 5)
ch2_val = 0
ch2 = tk.Scale(ch2_Frame, variable = ch2_val, from_ =100, to = 0, showvalue = 0, width = 25, length = 200)
ch2.pack()
button2 = tk.Button(ch2_Frame, text = "Power")
button2.pack()
ch2_Frame.place(x=150, y=50)
sBoard.mainloop()
The variable must be one of the tkinter variable types, for example an IntVar:
ch1_val = tk.IntVar()
ch1 = tk.Scale(ch1_Frame, variable = ch1_val, from_ =100, to = 0, showvalue = 0, width = 25, length = 200)
ch1.pack()
I know that there have been some other questions about this, but was hoping to get some help with my current frame configuration as seen below in the code snippet. I have also attached some images, first is with no scrollbar set up. Second is when I uncommented out my scrollbar code.
Frame setup:
# -- Top Frame -- #
self.top = Frame(master, height = 71, bg = self.topColor)
self.top.pack(fill = X)
self.bottom = Frame(master, height = 650, bg = self.bottomColor)
self.bottom.pack(fill = X)
Listbox setup:
# myscroll = Scrollbar(self.bottom, orient = VERTICAL)
Label(self.bottom, text = 'Files Chosen:', bg = self.bottomColor).place(x = 4, y = 110)
self.qListBox = Listbox(self.bottom, width = 30, selectmode = SINGLE) # I did have yscrollcommand = myscroll
# myscroll.config(command = self.qListBox.yview)
# myscroll.pack(side = RIGHT, fill = Y)
self.qListBox.place(x = 4, y = 130)
Label(self.bottom, text = 'Deployment Queue:', bg = self.bottomColor).place(x = 360, y = 110)
self.dListBox = Listbox(self.bottom, width = 30, selectmode = MULTIPLE)
self.dListBox.place(x = 360, y = 130)
Figured out how to resolve this. Created three frames that are inside of my master frame as seen below:
my_frame = Frame(self.master)
my_secondF = Frame(self.master)
my_thirdF = Frame(self.master)
Once I did this I simply put my Lisboxes inside of those frames and placed them accordingly and configured my scrollbars
self.qListBox = Listbox(my_frame, yscrollcommand=myscroll_bar, width = 32, selectmode = SINGLE)
I still, however, appreciate all the replies :)
I am designing a front end using Tkinter but the .grid() option doesn't work as expected. I want to divide my screen to two section, LEFT and Right. All the buttons and labels on the left and the rest on the right.
# Initialise frames
self.frame_left = tk.Frame(root, bg = "pink", width = 100, height = 100).grid(row = 0, column = 0, sticky = 'E')
self.frame_right = tk.Frame(root, bg = "red", width = 100, height = 100).grid(row = 0, column = 1, sticky = 'W')
root.grid_columnconfigure(0, weight=0)
root.grid_columnconfigure(1, weight=0)
#labels
self.Name_Label = tk.Label(self.frame_left, text = "Name", font = 12, fg = 'green').grid(row = 1, column = 1)
self.Phone_Label = tk.Label(self.frame_left, text = "Phone Number", font = 12, fg= 'green').grid(row = 1, column =2)
self.University_label = tk.Label(self.frame_left, text = "University", font = 12, fg = 'green').grid(row = 1, column = 3)
#Search boxex
self.Name_box = tk.Entry(self.frame_left, width = 12, borderwidth = 2).grid(row = 2, column = 1)
self.Phone_box = tk.Entry(self.frame_left, width = 12, borderwidth = 2).grid(row = 2, column = 2)
self.Phone_box = tk.Entry(self.frame_left, width = 12, borderwidth = 2).grid(row = 2, column = 3)
# Buttons
self.Search_button = tk.Button(self.frame_left, text='Search', padx = 10, pady = 10, font = 12, fg = 'black').grid(row = 5, column = 1)
#Screen
#self.Screen = tk.Listbox(self.frame_right, width = 20, height = 20, font = 1).grid(row = 0, column = 0)
It seems the labels and buttons are being placed on the root window not the frames that has been defined.
Appreciate your help.
Regards
Khisrow
To divide your screen into 2 parts, you need to use the option columnconfigure:
root.columnconfigure(0, weight=1)
root.columnconfigure(1, weight=1)
This creates a grid on the root window with 2 columns in which your self.frame_left and self.frame_right can be placed.
When you store a .grid() item you are not storing the widget:
self.frame_left = tk.Frame(root, bg = "pink", width = 100, height = 100).grid(row = 0, column = 0, sticky = 'E')
Stores the grid object to the variable, not the Frame.
This can be fixed by doing the creation and grid in two lines.
import tkinter as tk
class Test():
def __init__(self):
root = tk.Tk()
#EXAMPLE OF DIFFERENCE
self.frame_left = tk.Frame(root, bg = "pink", width = 100, height = 100).grid(row = 0, column = 0, sticky = 'E')
print(self.frame_left, "DIDN'T STORE THE FRAME")
self.frame_left = tk.Frame(root, bg = "pink", width = 100, height = 100)
self.frame_left.grid(row = 0, column = 0, sticky = 'E')
print(self.frame_left, "STORED THE FRAME")
#EXAMPLE OF DIFFERENCE
# Initialise frames
self.frame_left = tk.Frame(root, bg = "pink", width = 100, height = 100)
self.frame_left.grid(row = 0, column = 0, sticky = 'E')
self.frame_right = tk.Frame(root, bg = "red", width = 100, height = 100)
self.frame_right.grid(row = 0, column = 1, sticky = 'W')
root.grid_columnconfigure(0, weight=0)
root.grid_columnconfigure(1, weight=0)
#labels
self.Name_Label = tk.Label(self.frame_left, text = "Name", font = 12, fg = 'green').grid(row = 1, column = 1)
self.Phone_Label = tk.Label(self.frame_left, text = "Phone Number", font = 12, fg= 'green').grid(row = 1, column =2)
self.University_label = tk.Label(self.frame_left, text = "University", font = 12, fg = 'green').grid(row = 1, column = 3)
#Search boxex
self.Name_box = tk.Entry(self.frame_left, width = 12, borderwidth = 2)
self.Name_box.grid(row = 2, column = 1)
self.Phone_box = tk.Entry(self.frame_left, width = 12, borderwidth = 2)
self.Phone_box.grid(row = 2, column = 2)
self.Phone_box = tk.Entry(self.frame_left, width = 12, borderwidth = 2)
self.Phone_box.grid(row = 2, column = 3)
# Buttons
self.Search_button = tk.Button(self.frame_left, text='Search', padx = 10, pady = 10, font = 12, fg = 'black').grid(row = 5, column = 1)
#Screen
#self.Screen = tk.Listbox(self.frame_right, width = 20, height = 20, font = 1).grid(row = 0, column = 0)
Test()
EDIT: added a listbox with scrollbar
# Screen
scrollbar = tk.Scrollbar(self.frame_right)
scrollbar.grid(row = 0, column = 1, sticky = 'nsw')
self.Screen = tk.Listbox(self.frame_right, width = 20, height = 5, font = 1)
self.Screen.grid(row = 0, column = 0, sticky = 'e')
self.Screen.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=self.Screen.yview)