Axis Modifications
- phillc54
-
- Offline
- Platinum Member
-
Less
More
- Posts: 5716
- Thank you received: 2091
12 Jan 2025 00:18 #318719
by phillc54
Replied by phillc54 on topic Axis Modifications
Ahh, yes I see that now. There are a couple of procedures in tkfbox.tcl that overwrite the button text.
The only correct way I see to do it would be to roll your own dialog box.
There is an ugly workaround by running the below code in the user_live_update method of the user command file. You would restore bigfileopen.tcl back to the original.
It is really ugly...
The only correct way I see to do it would be to roll your own dialog box.
There is an ugly workaround by running the below code in the user_live_update method of the user command file. You would restore bigfileopen.tcl back to the original.
def user_live_update():
if root_window.tk.eval('winfo exists .__tk_filedialog') == '1':
open = '\n Open \n'
cancel = '\nCancel\n'
root_window.tk.eval(f'.__tk_filedialog.contents.f2.ok configure -text {{{open}}}')
root_window.tk.eval(f'.__tk_filedialog.contents.f2.cancel configure -text {{{cancel}}}')
It is really ugly...
The following user(s) said Thank You: nawaf
Please Log in or Create an account to join the conversation.
- phillc54
-
- Offline
- Platinum Member
-
Less
More
- Posts: 5716
- Thank you received: 2091
14 Jan 2025 00:42 #318910
by phillc54
Replied by phillc54 on topic Axis Modifications
I really didn't like the last one so I tried something different and this is the result.
You don't need user_live_update, just use the below in bigfileopen.tcl.
You don't need user_live_update, just use the below in bigfileopen.tcl.
# bigfileopen.tcl
if {[info proc tkgof] == ""} {rename tk_getOpenFile tkgof}
proc tk_getOpenFile {args} {
# get width and height for max screen size:
variable width [lindex [wm maxsize .] 0]
variable height [lindex [wm maxsize .] 1]
# alternately, just set width and height explicitly:
variable width 800
variable height 600
# location on screen:
variable xoffset 0
variable yoffset 0
# padding to enlarge buttons:
variable padx 10
variable pady 20
# set the window size and the button sizes
after 0 {wm geometry .__tk_filedialog ${width}x${height}+${xoffset}+${yoffset};
.__tk_filedialog.contents.f2.ok configure -padding [list $padx $pady $padx $pady];
.__tk_filedialog.contents.f2.cancel configure -padding [list $padx $pady $padx $pady]}
return [eval ::tkgof $args]
}
The following user(s) said Thank You: tommylight, nawaf
Please Log in or Create an account to join the conversation.
- nawaf
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
14 Jan 2025 04:21 - 14 Jan 2025 04:29 #318923
by nawaf
Replied by nawaf on topic Axis Modifications
Thank you, Phill, that was very helpful.How can I make the file list display with larger sizes? I want to increase the size of the text and icons.
if {[info proc tkgof] == ""} {rename tk_getOpenFile tkgof}
proc tk_getOpenFile {args} {
# location and size on screen:
variable xoff 50
variable yoff 10
variable width 900
variable height 500
variable padx 10
variable pady 20
after 0 {
wm geometry .__tk_filedialog ${width}x${height}+${xoff}+${yoff};
.__tk_filedialog.contents.f1.lab configure -padding [list $padx $pady $padx $pady];
.__tk_filedialog.contents.f1.menu configure -direction below;
.__tk_filedialog.contents.f1.menu.menu configure -font {Sans 20};
.__tk_filedialog.contents.f1.up configure -padding [list $pady $pady $pady $pady];
.__tk_filedialog.contents.f2.lab configure -padding [list $padx $pady $padx $pady];
.__tk_filedialog.contents.f2.ent configure -font {Sans 18};
.__tk_filedialog.contents.f2.lab2 configure -padding [list $padx $pady $padx $pady];
.__tk_filedialog.contents.f2.menu configure -padding [list 5 10 5 10];
.__tk_filedialog.contents.f2.ok configure -padding [list $padx $pady $padx $pady];
.__tk_filedialog.contents.f2.cancel configure -padding [list $padx $pady $padx $pady];
.__tk_filedialog.contents.f2.hidden configure -padding [list 10 10 10 10]
}
return [eval tkgof $args]
}
Last edit: 14 Jan 2025 04:29 by nawaf.
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
-
Less
More
- Posts: 822
- Thank you received: 237
15 Jan 2025 02:47 - 15 Jan 2025 02:51 #318994
by cakeslob
Replied by cakeslob on topic Axis Modifications
holy shit I am not sure why they made this so hard. they are using a different font class
for changing the font size in the file menu -
for posteriority heres how I got there. fbox takes the files and makes them into an Iconlist, which then uses the font family TkIconFont to configure this megawidget "Iconlist"
I thought it was odd that some of the widgets configured to our textsize and font but some did not. Its the same case for the entry widget that loads the file name. The colours dont change for most widgets unless you change the colour after you open, and even then only some widgets configure. The options in the listbox configure colour but none of the other text changes colour.
nawaf are you using regularmac800? that will make this easier. you can just add those 2 lines, or get the update from the github.
unfortunately this doesnt make it a better file browser. there are some alternative ones i want to try out when i figure out how
for changing the font size in the file menu -
rC('font','configure','TkIconFont','-family', fontName, '-size', fontSize)
rC('font','configure','TkTextFont','-family', fontName, '-size', fontSize)
for posteriority heres how I got there. fbox takes the files and makes them into an Iconlist, which then uses the font family TkIconFont to configure this megawidget "Iconlist"
I thought it was odd that some of the widgets configured to our textsize and font but some did not. Its the same case for the entry widget that loads the file name. The colours dont change for most widgets unless you change the colour after you open, and even then only some widgets configure. The options in the listbox configure colour but none of the other text changes colour.
nawaf are you using regularmac800? that will make this easier. you can just add those 2 lines, or get the update from the github.
unfortunately this doesnt make it a better file browser. there are some alternative ones i want to try out when i figure out how
Last edit: 15 Jan 2025 02:51 by cakeslob.
The following user(s) said Thank You: nawaf
Please Log in or Create an account to join the conversation.
- phillc54
-
- Offline
- Platinum Member
-
Less
More
- Posts: 5716
- Thank you received: 2091
15 Jan 2025 03:44 #318998
by phillc54
Replied by phillc54 on topic Axis Modifications
Yeah, these are mostly themed widgets so some options require setting via styles. It can be a PITA.holy shit I am not sure why they made this so hard
It seems to need an update for the first run, the below bigfileopen.tcl touches every widget in the dialog and includes the update.I want to increase the size of the text and icons
Warning: Spoiler!
if {[info proc tkgof] == ""} {rename tk_getOpenFile tkgof}
proc tk_getOpenFile {args} {
# location and size on screen:
variable xoff 50
variable yoff 10
variable width 900
variable height 500
variable padx 0
variable pady 20
variable font {Sans 18}
variable f1 .__tk_filedialog.contents.f1
variable f2 .__tk_filedialog.contents.f2
variable padding [list $padx $pady $padx $pady]
after 0 {wm geometry .__tk_filedialog ${width}x${height}+${xoff}+${yoff}; # set window size
#set some styles
ttk::style configure My.TButton {*}[ttk::style configure TButton] -font $font -padding $padding; # button
ttk::style configure My.TCheckbutton {*}[ttk::style configure TCheckbutton] -font $font -padding $padding; # menu button
ttk::style configure My.TMenubutton {*}[ttk::style configure TMenubutton] -font $font -padding $padding; # check button
ttk::style configure My.Horizontal.TScrollbar {*}[ttk::style configure Horizontal.TScrollbar] -arrowsize 32; # scrollbar
#top panel
$f1.lab configure -font $font; # -padding $padding; # directory label
$f1.menu configure -style My.TMenubutton; # directory button
$f1.menu.menu configure -font $font; # directory drop down
$f1.up configure -padding [list $pady $pady]; # up arrow
# middle panel
.__tk_filedialog.contents.icons configure -font $font; # directory list
::tk::dialog::file::Update .__tk_filedialog; # update required or first view uses original font
.__tk_filedialog.contents.icons.cHull.sbar configure -style My.Horizontal.TScrollbar; # scrollbar
# bottom panel
$f2.lab configure -font $font; # filename label
$f2.ent configure -font $font; # filename entry
$f2.lab2 configure -font $font; # filetype label
$f2.menu configure -style My.TMenubutton; # filetype button
$f2.menu.m configure -font $font; # filetype drop down
$f2.ok configure -style My.TButton; # open/save button
$f2.cancel configure -style My.TButton; # cancel button
$f2.hidden configure -style My.TCheckbutton; # hidden file check button
}
return [eval tkgof $args]
}
The following user(s) said Thank You: nawaf
Please Log in or Create an account to join the conversation.
- nawaf
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
16 Jan 2025 03:47 #319084
by nawaf
I am using a 10-inch touchscreen with a resolution of 1024x600 and I want to use the Axis GUI with buttons that are large enough, and I saw your mod and tried it. It's great because the buttons are big enough.
But for the open file dialog, the buttons are not big enough for my fingers, making it a bit difficult to touch them on my screen
Replied by nawaf on topic Axis Modifications
Yeah, thanks, cakeslob, for the GUI mod.nawaf are you using regularmac800?
I am using a 10-inch touchscreen with a resolution of 1024x600 and I want to use the Axis GUI with buttons that are large enough, and I saw your mod and tried it. It's great because the buttons are big enough.
But for the open file dialog, the buttons are not big enough for my fingers, making it a bit difficult to touch them on my screen
Please Log in or Create an account to join the conversation.
- nawaf
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
16 Jan 2025 03:51 - 16 Jan 2025 09:34 #319085
by nawaf
Replied by nawaf on topic Axis Modifications
Thank you, Pill, this works great for me
Warning: Spoiler!
if {[info proc tkgof] == ""} {rename tk_getOpenFile tkgof}
proc tk_getOpenFile {args} {
# location and size on screen:
variable xoff 50
variable yoff 10
variable width 900
variable height 500
variable padx 0
variable pady 20
variable font {Sans 18}
variable f1 .__tk_filedialog.contents.f1
variable f2 .__tk_filedialog.contents.f2
variable padding [list $padx $pady $padx $pady]
after 0 {wm geometry .__tk_filedialog ${width}x${height}+${xoff}+${yoff}; # set window size
#set some styles
ttk::style configure My.TButton {*}[ttk::style configure TButton] -font $font -padding $padding; # button
ttk::style configure My.TCheckbutton {*}[ttk::style configure TCheckbutton] -font $font -padding $padding; # menu button
ttk::style configure My.TMenubutton {*}[ttk::style configure TMenubutton] -font $font -padding $padding; # check button
ttk::style configure My.Horizontal.TScrollbar {*}[ttk::style configure Horizontal.TScrollbar] -arrowsize 32; # scrollbar
#top panel
$f1.lab configure -font $font; # -padding $padding; # directory label
$f1.menu configure -style My.TMenubutton; # directory button
$f1.menu.menu configure -font $font; # directory drop down
$f1.up configure -padding [list $pady $pady]; # up arrow
# middle panel
.__tk_filedialog.contents.icons configure -font $font; # directory list
::tk::dialog::file::Update .__tk_filedialog; # update required or first view uses original font
.__tk_filedialog.contents.icons.cHull.sbar configure -style My.Horizontal.TScrollbar; # scrollbar
# bottom panel
$f2.lab configure -font $font; # filename label
$f2.ent configure -font $font; # filename entry
$f2.lab2 configure -font $font; # filetype label
$f2.menu configure -style My.TMenubutton; # filetype button
$f2.menu.m configure -font $font; # filetype drop down
$f2.ok configure -style My.TButton; # open/save button
$f2.cancel configure -style My.TButton; # cancel button
$f2.hidden configure -style My.TCheckbutton; # hidden file check button
}
return [eval tkgof $args]
}
Last edit: 16 Jan 2025 09:34 by nawaf.
Please Log in or Create an account to join the conversation.
Time to create page: 0.173 seconds