Class: ButtonGroup

Inherits:
Gtk::Button
  • Object
show all
Includes:
Conf
Defined in:
lib/ListHolder/ListButtonHolder/ButtonGroup.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Instance Method Summary collapse

Methods included from Conf

#get_conf, #load_conf, #save_conf, #set_conf

Constructor Details

#initialize(holder, group) ⇒ ButtonGroup

Returns a new instance of ButtonGroup.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ListHolder/ListButtonHolder/ButtonGroup.rb', line 7

def initialize(holder,group)
  @holder=holder
  @group=group
  super(@group)
  set_image(Gtk::Image.new(Gtk::Stock::DIRECTORY,Gtk::IconSize.from_name(get_conf(0,0,"button-size"))))
  set_relief(Gtk::ReliefStyle::NONE)
#   set_shadow_type(Gtk::SHADOW_NONE)
  @popup=Gtk::Window.new(Gtk::Window::POPUP).add(@widget=Gtk::VBox.new).set_modal(true).set_has_frame(false).
    set_transient_for(@holder.list_holder.get_ancestor(Gtk::Window))

  @popup.signal_connect('leave-notify-event'){|me,e| me.hide if e.window == me.window}

  signal_connect('clicked'){|me|
    x,y=get_ancestor(Gtk::Window).position
    xd,yd=translate_coordinates(get_ancestor(Gtk::Window),x,y+allocation.height)
    @popup.move(xd,yd).show_all
    }
end

Instance Method Details

#pack_start(*args) ⇒ Object



25
26
27
# File 'lib/ListHolder/ListButtonHolder/ButtonGroup.rb', line 25

def pack_start(*args)
  @widget.pack_start(*args)
end

#update(notifier) ⇒ Object



28
29
30
# File 'lib/ListHolder/ListButtonHolder/ButtonGroup.rb', line 28

def update(notifier)
  @widget.each{|button| button.update(notifier)}
end