-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a94cad
commit c8fa426
Showing
15 changed files
with
371 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Python program to illustrate the usage of | ||
# autohiding scrollbars using tkinter | ||
|
||
# Importing tkinter | ||
from tkinter import * | ||
from tkinter import ttk | ||
|
||
# Creating class AutoScrollbar | ||
class AutoScrollbar(ttk.Scrollbar): | ||
|
||
# Defining set method with all | ||
# its parameter | ||
def set(self, low, high): | ||
|
||
if float(low) <= 0.0 and float(high) >= 1.0: | ||
|
||
# Using grid_remove | ||
self.tk.call("grid", "remove", self) | ||
else: | ||
self.grid() | ||
Scrollbar.set(self, low, high) | ||
|
||
# Defining pack method | ||
def pack(self, **kw): | ||
|
||
# If pack is used it throws an error | ||
raise (TclError,"pack cannot be used with \ | ||
this widget") | ||
|
||
# Defining place method | ||
def place(self, **kw): | ||
|
||
# If place is used it throws an error | ||
raise (TclError, "place cannot be used with \ | ||
this widget") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import copy | ||
import json | ||
import os | ||
|
||
def write_config_file(mainapp): | ||
save_dict = {} | ||
|
||
# Get the Quick Access Links | ||
save_dict['links'] = copy.deepcopy(mainapp.quick_access_tree.links) | ||
save_dict['node_iids'] = copy.deepcopy(mainapp.quick_access_tree.node_iids) | ||
save_dict['nodes'] = copy.deepcopy(mainapp.quick_access_tree.nodes) | ||
|
||
with open('tk_path_finder_config.json', 'w') as outfile: | ||
json.dump(save_dict, outfile, indent=4) | ||
|
||
def load_config_file(mainapp): | ||
if not os.path.isfile('tk_path_finder_config.json'): | ||
generate_default_config_file() | ||
|
||
with open('tk_path_finder_config.json') as f: | ||
data = json.load(f) | ||
return data | ||
|
||
def generate_default_config_file(): | ||
|
||
save_dict = {} | ||
save_dict['links'] = {"I001": {}} | ||
save_dict["node_iids"] = {"I001": 'Default'} | ||
save_dict["nodes"] = {"Default": 'I001'} | ||
|
||
with open('tk_path_finder_config.json', 'w') as outfile: | ||
json.dump(save_dict, outfile, indent=4) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.