Displaying 20 results from an estimated 1200 matches similar to: "object-oriented GUI design and event handling"
2007 Apr 03
2
CalendarCtrl.date not working?
I finally got my CheckListBoxes under control (thanks Alex& Phil) and
have moved on to tackling the CalendatCtrl. This one seemed pretty easy
when I was reading through the documentation but I cannot retrieve the
selected date. I have the following code:
def initialize...
...
@calendar = panel.add(Wx::CalendarCtrl[])
panel.add(Wx::Button[:label => ''test'']) do
2007 Jul 10
5
Seg Fault caused by StatusBar. Am I doing something wrong?
Some odd bug cropped up when I made a bunch of code changes to my app
recently. I started getting the following everytime I closed the app:
----------------------------------
[BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i386-mswin32]
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application''s support team for more information.
2007 Sep 20
7
Troubles with ListBox and CheckListBox events
Hi all,
Here is an excerpt of code (with the new syntax from upcoming wxRuby 1.9.2) :
evt_checklistbox(my_checklist, :on_checklistbox)
evt_listbox(my_checklist, :on_listbox)
evt_listbox(my_list, :on_listbox)
def on_checklistbox(event)
checklist = event.event_object
# puts "listbox - event : item[#{event.int}] checked : #{event.checked?}"
puts "listbox -
2006 Nov 23
2
to_s
I was toying around with adding a to_s function to wxPoint (and probably
to some other classes). I''m wondering if this is a good idea or not and
if so, is it best to use %extend or put it into something like wxSugar
or the ruby parts of wx?
My initial implementation is:
%extend wxPoint {
VALUE to_s()
{
char buffer[40];
sprintf(buffer, "%d,%d", self->x,
2007 Apr 03
1
wxSugar 0.1.15 released
Hi
WxSugar 0.1.15 is now available via gems and download from rubyforge.
This is a minor feature release which adds a couple of new facilities:
* enumerable_controls: treats ListCtrl and ControlWithItems classes,
such as ComboBox, ListBox, CheckListBox as Ruby enumerables
* adds Window#has_style?
The former is meant to give much more rubyish access to the contents of
GUI controls which
2007 Sep 17
7
Re : syntax II
Alex Fenton wrote :
>1) Setting up event handlers
>
>In most real apps, 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 { |
2007 Sep 27
10
Adding more sugar to wxSugar
Hi all,
New wxRuby event handling offers the choice between using blocks or
methods seamlessly and easily. This is great respectively for simple
app and more complex app.
Nevertheless, currently the creation of an application, a frame, or a
dialog is very tedious for simple app :
- you need to create a subclass of Wx::App, Wx::Frame ...
- you need to put the initialization code in the initialize
2007 Sep 20
3
Bug? in wxSugar enumerable_controls.rb
Hi,
I wanted to use wxSugar enumerable features to add a method for
returning checked items'' index to the CheckListBox class :
require ''wx_sugar/version''
require ''wx_sugar/wx_classes/control_with_items''
require ''wx_sugar/wx_classes/listctrl''
class Wx::CheckListBox
def checked_items
# use of find_all method from Enumerable
2007 Oct 09
17
Crash when using item data with a CheckListBox
Hi,
The following code works as expected with a list box.
require "wx"
class HelloWorld < Wx::App
def on_init
helloframe = Wx::Frame.new(nil, "Hello World")
choices = ["one", "two", "three", "four", "five"]
data = ["data1", "data2", "data3", "data4", "data5"]
2007 Oct 09
17
Crash when using item data with a CheckListBox
Hi,
The following code works as expected with a list box.
require "wx"
class HelloWorld < Wx::App
def on_init
helloframe = Wx::Frame.new(nil, "Hello World")
choices = ["one", "two", "three", "four", "five"]
data = ["data1", "data2", "data3", "data4", "data5"]
2007 Oct 23
3
CheckListBox : delete method bug !
Hi,
I''ve practically finished a patch for removing the limitation of
CheckListBox (http://rubyforge.org/pipermail/wxruby-development/2007-October/000973.html)
but I just discovered a new bug related with this control !!
I need to redefine the delete method to take into account the deletion
of the associated data. The problem is that if I just redefine this
method and simply call super,
2008 Jan 04
2
checklistbox
Salut Alex.
En fait je me suis rendu compte de mon erreur à propos de "HSCROLL", ça marche correctement. La scrollbarre apparaît et fonctionne bien. La dernière fois j''ai eu l''impression qu''elle ne marchait pas, car cela peut arriver que la dernière lettre de la ligne de charactères qui s''affiche soit un peu coupée par la "VSCROLL".
2007 Sep 26
7
development status, 1.9.2
Hi all
Just a quick update on recent SVN activity:
* added Sound and CollapsiblePane classes
* added the XRC tool to wxSugar
* fixed some XRC bugs in Window
* added syntax sugar for event handlers and list-like controls
* added some missing methods in Sizer
Sean - I''m away for about 10 days from this weekend, and I''m thinking of
doing a 1.9.2 release in the next day or two.
2006 Nov 29
5
wxSugar control problem
I''m using wx_sugar 0.1.2 with wxruby2-preview 0.0.37 on OSX and am
coming up with an error when trying to create a SpinCtrl (and quite a
few others have exactly the same prob.):
#file date_picker.rb
class DatePicker < Wx::Dialog
def initialize
super(nil, :title => "Pick a date...")
@cal = Wx::CalendarCtrl.new(self)
add(@cal)
#works fine up to
2006 Oct 21
3
wxsugar question
I''ve only had the briefest play with wxSugar and already I like it a lot.
One small question - have you considered some more ''convention over
configuration'' like they do in rails, in particular for event connectors?
So instead of
listen(:button, my_button, my_button_pressed)
you can leave it out entirely and rely on the convention that a button has
a _pressed
2007 Nov 07
1
3 wxSugar questions
A bit new to wxRuby and have 2 questions regarding wxSugar:
1. I only find one sample application for wxSugar, but as I understand
from the docs, wsSugar is the preferred approach. Are there any more
wxSugar samples available somewhere?
2. When I run sugar-sample.rb, I get a couple of warnings: "listen is
deprecated, use evt_xxx directly". Just wanted to check: Is this sample
2007 Mar 21
4
Bug in TextCtrl constructor
Howdy,
I''ve uncovered a bug in the constructor for TextCtrl (originally
uncovered while using WxSugar but it appears to apply to WxRuby itself
as well). Here''s the output from irb:
# ------
irb(main):001:0> require ''wx'';
irb(main):002:0* ctl =
2007 Apr 14
1
how to simulate key_down event(when event.get_key_code()==Wx::K_DOWN) in ListCtrl or TreeCtrl?
I want to simulate vi(vim) like operations in ListCtrl or TreeCtrl,
that is, for example, when user pressed a ''j'' on keyboard,the selected
item change into the next one item, just like user press a
Wx::K_DOWN(arrow key down on keyboard) .
but not jump to some item started with a "J" charater.
evt_tree_key_down(TreeTest_Ctrl) { | e | on_tree_key_down(e) }
...
def
2007 Apr 09
2
GridTableBase problem
Trying to setup a GridTableBase to hold some floating point numbers for
a Grid. Getting an error with the following:
table = Wx::GridTableBase.new
Error:
C:/ruby/work/wxtest/test.rb:151:in `on_find'': uninitialized constant
Wxruby2::Gr
idTableBase (NameError)
from
c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/event_c
onnector.rb:123:in `call''
2007 Nov 03
9
wxThread
Hey guys,
I''m working on the start of incorperating wxSocket into a library that
can be included with the Core, and a part of this, is to create a
wxThread class, which will basically just be a barebone copy over of
Ruby''s own Thread class. (This should also help when we get Ruby 2.0,
which hopefully will have Native Threads, as we should still be able to
get the base