Displaying 9 results from an estimated 9 matches for "on_click".
2004 Jun 11
9
Handling Events that don''t take an ID
Hey Kevin,
Am I correct in assuming that if I want a particular widget to respond to an
event which doesn''t take an ID as an argument (like evt_size or
evt_left_down), that I have to inherit a new widget and define the event
handler within the inherited class? Here''s a little contrived code example
to illustrate what I mean:
class MyCtrl < Wx::TextCtrl
def
2006 May 31
2
Rails AJAX helpers or DIY
...t kind of
thing.
Now I want to do something very similar but in Rails. Basically I have a
list of summaries displayed in a view. I want to have a link that when
pressed shows the detail.
To do this I would normally have each summary in a DIV, the ID of each
DIV would have a number suffix. The on_click event would pass the suffix
to a JS function which would hide/show (using a script.aculo.us effect)
the relevent DIV containing the detail.
How should I go about this in Rails, in other words is there a helper,
better way of doing it, Javascript views maybe...
Best wishes!
--
Posted via h...
2006 Nov 06
4
Event listeners
Hi!
Your plugin is really great! Thanks.
One more little question.
Is it possible to add event listeners to the maps via your plugin?
greetings
/till
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ym4r-user/attachments/20061106/6b1c6f4f/attachment.html
2004 Feb 02
0
the sample
...---
#!/usr/bin/ruby
require ''wxruby''
include Wx
class MyImageFrame < Dialog
def initialize parent, title, bmap
super(parent, -1, title)
@bitmap=bmap
set_client_size_wh(@bitmap.get_width,@bitmap.get_height)
evt_paint {|what| on_paint(what)}
evt_left_down {on_click()}
end
def on_click
close
end
def on_paint what
dc = PaintDC.new(self)
dc.draw_bitmap(@bitmap,0,0,true)
end
end
class MyFrame < Wx::Frame
def initialize(title)
super(nil, -1, title)
b=Button.new(self,-1,''e'')
evt_button(-1) { MyImageFrame.n...
2005 Jul 12
3
comm between gui and app?
To me, the main app (an object) is separate from the app gui (object)...
MVC''ish.
How can I have the gui part communicate to the app that an event has
taken place? Example code somewhere?
Thank you.
--
- Martin J. Brown, Jr. -
- mjbjr@beaudesign.com -
Public PGP Key ID: 0xB09AFEFE keyserver: http://pgpkeys.mit.edu:11371/
Key
2004 Jan 08
3
pictorG
...# -- opens a dialog to show a picture
def initialize parent, title, filename
super(parent, -1, title)
@bitmap=Bitmap.new(filename,BITMAP_TYPE_ANY) # why should I say BITMAP_TYPE_ANY?
set_client_size_wh(@bitmap.get_width,@bitmap.get_height)
evt_paint {on_paint()}
evt_left_down {on_click()}
end
def on_click
@bitmap.destroy()
self.destroy()
end
def on_paint
dc = PaintDC.new(self)
dc.draw_bitmap(@bitmap,0,0,true)
end
end
class Pictures < ListCtrl # -- show the pictures
def initialize parent
super parent,-1,DEFAULT_POSITION,DEFAULT_SIZE,LC_ICON|LC...
2007 Jul 21
0
[1139] trunk/wxruby2/samples/text/textctrl.rb: Place TextCtrl sample in a panel so gets correct bg color on MSW
...et Info'')
</del><ins>+ button = Wx::Button.new(panel, -1, ''Get Info'')
</ins><span class="cx"> sizer.add(button, 0, Wx::ADJUST_MINSIZE|Wx::ALL, 2 )
</span><span class="cx"> evt_button(button.get_id) { | e | on_click(e) }
</span><span class="cx">
</span><del>- @log = LogTextCtrl.new(self)
</del><ins>+ @log = LogTextCtrl.new(panel)
</ins><span class="cx"> sizer.add(@log, 1, Wx::GROW|Wx::ALL, 2)
</span><span class="cx&quo...
2006 Oct 19
0
[690] trunk/wxruby2/samples/text/unicode.rb: Placed controls within a panel so they appear on the correct themed background
...9;)
</del><ins>+ button = Wx::Button.new(panel, -1, ''Describe text selection'')
</ins><span class="cx"> sizer.add(button, 0, Wx::ADJUST_MINSIZE|Wx::ALL, 2 )
</span><span class="cx"> evt_button(button.get_id) { | e | on_click(e) }
</span><span class="cx">
</span><del>- @log = LogTextCtrl.new(self)
</del><ins>+ @log = LogTextCtrl.new(panel)
</ins><span class="cx"> sizer.add(@log, 1, Wx::GROW|Wx::ALL, 2)
</span><del>- sizer.add(...
2006 Apr 27
5
Major Breakthrough?
Attached are patches to make the textctrl.rb sample work fully. Note
the new %directorargout typemap I added to fix wxWindows calling into
SWIG. I don''t know if this can fix all such problems or not. Let me
know what you think.
I also rubified the sample a little bit more. Also, note that I fix the
<< operator so the function can be called. I hope I did this right.
Roy