Hi everybody !
I am working with Gimp. I need Ruby-Gimp extension, I ran
ruby setup.rb setup and I have this error:
···
-DRUBY_GIMP_COMPILATION -c -o rbgimpintl.o rbgimpintl.c
rbgimpintl.c: In function init_locale': rbgimpintl.c:41:LOCALEDIR’ undeclared (first use in this function)
rbgimpintl.c:41: (Each undeclared identifier is reported only once
rbgimpintl.c:41: for each function it appears in.)
rbgimpintl.c: In function Init_gimpintl': rbgimpintl.c:124:LOCALEDIR’ undeclared (first use in this function)
make: *** [rbgimpintl.o] Error 1
setup failed
This line is rbgimpintl.c:124
rb_define_const(mGimp, “LOCALEDIR”, rb_str_new2(LOCALEDIR))
I think is a localization error but I don’t know how fix it.
Thanks for the help.
Enrique Meza
//
Hi,
A couple of questions:
- When the user clicks on an entry in a TreeView widget, how can I find
out which entry was clicked?
def callback(widget, event)
# Use ‘event’ to find which line was clicked?
end
tree_view.signal_connect(“button_press_event”) {|w, e| callback(w, e)}
-
Use Gtk::TreeView’s “cursor-changed” signal.
tree_view.signal_connect(“cursor-changed”) do … end
-
Use Gtk::TreeSelection’s “changed” signal.
tree_view.selection.signal_connect(“changed”) do … end
- How come TreeView does not have a “clicked” signal like buttons?
I couldn’t understand this sentence because of my poor english.
What’s different from your 1st question?
BTW, I wrote small sample script.
Hope this helps.
···
On Sat, 22 Feb 2003 09:48:05 +0900 Daniel Carrera dcarrera@math.umd.edu wrote:
require ‘gtk2’
Gtk.init
model = Gtk::TreeStore.new(String)
view = Gtk::TreeView.new(model)
view.append_column(Gtk::TreeViewColumn.new(“Test”,
Gtk::CellRendererText.new(), :text => 0))
parent = nil
(0…10).each do |i|
parent = model.append(parent).set_value(0, “Message#{i}”)
end
Gtk::TreeView.signals.each do |signal|
view.signal_connect(signal) do |e|
p “#{signal} ----”
p e
end
end
Gtk::Window.new.add(view).set_default_size(100,100).show_all
Gtk.main
–
.:% Masao Mutohmutoh@highway.ne.jp
- The first question was not asking which signal I could use. I already
know that “button_press_event” works. I want to know which entry was
clicked. Here is an example:
Suppose that I make a tree with the entries “Jeffrey”, “Melissa” and
“Sandy”. I want to know whether the user clicked on “Jeffrey” or whether
he clicked on “Melissa” or “Sandy”.
1.b) What does Gtk::TreeSelection’s “changed” signal do?
- In the second question, I point out that:
my_button.singal_connect(“clicked”) { … } # Works
tree_view.signal_connect(“clicked”) { … } # Does not work.
I was just wondering why.
Thanks for your help. I appreciate it very much.
···
On Sun, Feb 23, 2003 at 01:51:32AM +0900, Masao Mutoh wrote:
A couple of questions:
- When the user clicks on an entry in a TreeView widget, how can I find
out which entry was clicked?
def callback(widget, event)
# Use ‘event’ to find which line was clicked?
end
tree_view.signal_connect(“button_press_event”) {|w, e| callback(w, e)}
-
Use Gtk::TreeView’s “cursor-changed” signal.
tree_view.signal_connect(“cursor-changed”) do … end
-
Use Gtk::TreeSelection’s “changed” signal.
tree_view.selection.signal_connect(“changed”) do … end
- How come TreeView does not have a “clicked” signal like buttons?
I couldn’t understand this sentence because of my poor english.
What’s different from your 1st question?
–
Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137
Hi,
- The first question was not asking which signal I could use. I already
know that “button_press_event” works. I want to know which entry was
clicked. Here is an example:
Suppose that I make a tree with the entries “Jeffrey”, “Melissa” and
“Sandy”. I want to know whether the user clicked on “Jeffrey” or whether
he clicked on “Melissa” or “Sandy”.
Gtk::TreeSelection#selected ?
tree_view.signal_connect('cursor-changed') do |e|
iter = tree_view.selection.selected
end
1.b) What does Gtk::TreeSelection’s “changed” signal do?
According to GTK+ API reference,
“Emitted whenever the selection has (possibly) changed.”
Anyway, try it yourself;->.
- In the second question, I point out that:
my_button.singal_connect(“clicked”) { … } # Works
tree_view.signal_connect(“clicked”) { … } # Does not work.
I was just wondering why.
Hmm, I don’t know:->. It’s a specification of GtkTreeView.
···
On Sun, 23 Feb 2003 06:18:23 +0900 Daniel Carrera dcarrera@math.umd.edu wrote:
–
.:% Masao Mutohmutoh@highway.ne.jp
I’ve been trying to Gtk::TreeSelection this all weekend. I doesn’t work.
Try it!
···
On Sun, Feb 23, 2003 at 06:59:32PM +0900, Masao Mutoh wrote:
- The first question was not asking which signal I could use. I already
know that “button_press_event” works. I want to know which entry was
clicked. Here is an example:
Suppose that I make a tree with the entries “Jeffrey”, “Melissa” and
“Sandy”. I want to know whether the user clicked on “Jeffrey” or whether
he clicked on “Melissa” or “Sandy”.
Gtk::TreeSelection#selected ?
tree_view.signal_connect('cursor-changed') do |e|
iter = tree_view.selection.selected
end
–
Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137