Class: HinnerDialog
- Inherits:
-
TkFrame
- Object
- TkFrame
- HinnerDialog
- Defined in:
- lib/a-tkcommons.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(side = 'top', args = nil) ⇒ HinnerDialog
constructor
A new instance of HinnerDialog.
- #is_modal? ⇒ Boolean
- #release ⇒ Object
- #show_modal(_destroy = true) ⇒ Object
Constructor Details
#initialize(side = 'top', args = nil) ⇒ HinnerDialog
Returns a new instance of HinnerDialog.
2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 |
# File 'lib/a-tkcommons.rb', line 2814 def initialize(side='top',args=nil) newargs = Arcadia.style('panel').update({ "highlightbackground" => Arcadia.conf('hightlight.link.foreground'), "highlightthickness" => 1 }) if !args.nil? newargs.update(args) end super(Arcadia.layout.parent_frame, newargs) case side when 'top' # self.pack('side' =>side,'before'=>Arcadia.layout.root, 'anchor'=>'nw','fill'=>'both', 'padx'=>0, 'pady'=>0, 'expand'=>'yes') self.pack('side' =>side,'before'=>Arcadia.layout.root, 'anchor'=>'nw','fill'=>'x', 'padx'=>0, 'pady'=>0) when 'bottom' self.pack('side' =>side,'after'=>Arcadia.layout.root, 'anchor'=>'nw','fill'=>'x', 'padx'=>0, 'pady'=>0) end @modal = false end |
Instance Method Details
#is_modal? ⇒ Boolean
2833 2834 2835 |
# File 'lib/a-tkcommons.rb', line 2833 def is_modal? @modal end |
#release ⇒ Object
2837 2838 2839 |
# File 'lib/a-tkcommons.rb', line 2837 def release @modal=false end |
#show_modal(_destroy = true) ⇒ Object
2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 |
# File 'lib/a-tkcommons.rb', line 2841 def show_modal(_destroy=true) @modal=true Tk.update self.grab("set") begin while is_modal? do Tk.update sleep(0.1) end ensure self.grab("release") end Tk.update self.destroy if _destroy end |