search for: on_size

Displaying 5 results from an estimated 5 matches for "on_size".

Did you mean: in_size
2007 Sep 10
2
syntax II
...ps, I think the most normal way to set up event handlers is for the event to be dealt with by a corresponding method. At the moment this has to be done using a block: evt_button(AN_ID) { on_button_click } evt_button(my_button.get_id) do | event | on_button_click(event) end evt_size { | event | on_size(event) } This is a sensible way to organise classes but it seems to have redundancy in it. The bigger one is having to create a block, with param, just to call a method; the smaller one is having to call a method to get a window id. So I''d like to suggest as alternatives: evt_button(A...
2004 Jun 11
9
Handling Events that don''t take an ID
...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 initialize() evt_size {|event| on_size(event)} end def on_size(event) # Do whatever end end Or is there a simpler, more direct way to get a particular instance of a widget to respond to such events? Robert Carlin _________________________________________________________________ Watch the online reality show Mixed Messag...
2007 Sep 17
7
Re : syntax II
...y to set up event handlers >is for the event to be dealt with by a corresponding method. At the >moment this has to be done using a block: > >evt_button(AN_ID) { on_button_click } >evt_button(my_button.get_id) do | event | > on_button_click(event) >end >evt_size { | event | on_size(event) } > >So I''d like to suggest as alternatives: > >evt_button(AN_ID, :on_button_click) >evt_button my_button, :on_button_click >evt_size :on_size These are very useful additions especially the second one which removes the need for getting the id of the button, throug...
2004 Apr 21
2
Resizing a ListCtrl
Hi Guys, I''m having serious troubles resizing a dialog with a ListCtrl. The ctrl will not resize horizontally no matter what I''m doing. I''ve attached a sample code below. Any help will be greatly appreciated, as I really like wxRuby :) I''ve also tried to copy from the example from listtest.rbw, but that also doesn''t seem to work. Another thing
2007 Mar 22
0
[916] branches/wxruby2/wxwidgets_282: More Wx::AUI classes, event hooks and sample
...end + +# A resizable control that displays its current size, and, if an AUI +# arrangement, its position and layer +class SizeReportCtrl < Wx::Control + def initialize(parent, id, pos, size, mgr = nil) + super(parent, id, pos, size) + @mgr = mgr + evt_paint { on_paint } + evt_size { on_size } + end + + def on_paint + paint do | dc | + size = get_client_size + + dc.set_font Wx::NORMAL_FONT + dc.set_brush Wx::WHITE_BRUSH + dc.set_pen Wx::WHITE_PEN + dc.draw_rectangle(0, 0, size.x, size.y) + dc.set_pen Wx::LIGHT_GREY_PEN + dc.set_pen Wx::LIGHT_G...