Irlweg, Franz (ZNT | 7 Oct 08:43

wxruby example with more than one window

Hello together,

can somebody send me a example with more than one window (frame) ?
I'm using wxruby 1.9.5

I have the following problem:
  - from the first window i open the second window (which contains a grid, with TableBase, the data comes from a ActiveRecord)

  - after finishing work in the second window, i execute a close().
  - opening and closing the second window several times (3 - 6), the following error appears:


controllers/home_ctrl.rb:260: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [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.


Thanks in advance,
Franz Irlweg

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info <at> siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Rudolf Staudigl

_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Fabio Petrucci | 6 Oct 14:18

StdDialogButtonSizer default button

Hi all,

How do i set the default button for a Wx::StdDialogButtonSizer?

Any hints would be appreciated.

regards.

bio.
_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
sebastien | 6 Oct 07:24

wxSugar

Bonjour.
A propos de "wxSugar", quel est son efficacité ?
Pouvez-vous me donnez un bout de code sans et avec "wxSugar", que je puisse voir la différence ?
Y a t'il des tutoriels assez explicatif ?
merci
_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Fabio Petrucci | 3 Oct 12:03

number input type

Hi all,
is there any option to limit input type (wxTextCtrl) to accept only number?

thanks,

regards.

bio.
_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Glen Holcomb | 2 Oct 21:24

WX::Dialog won't close

I have an interesting problem.  I have a dialog which refuses to go away once it has finished it's associated code.

Here is the code:

class DBPopulateDialog < Wx::Dialog
    def initialize(parent, id, title, pos, size, style, name)
      super(parent, id, title, pos, size, style, name)
     
      sizer = Wx::BoxSizer.new(Wx::VERTICAL)
     
      <at> server = Wx::TextCtrl.new(self, -1, "Server", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE)
      <at> username = Wx::TextCtrl.new(self, -1, "Username", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE)
      <at> password = Wx::TextCtrl.new(self, -1, "Password", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::TE_PASSWORD)
      <at> tree_base = Wx::TextCtrl.new(self, -1, "LDAP Tree Base", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE)
     
      sizer.add( <at> server, 1, Wx::EXPAND|Wx::ALL, 5)
      sizer.add( <at> username, 1, Wx::EXPAND|Wx::ALL, 5)
      sizer.add( <at> password, 1, Wx::EXPAND|Wx::ALL, 5)
      sizer.add( <at> tree_base, 1, Wx::EXPAND|Wx::ALL, 5)
     
      button_sizer = create_button_sizer(Wx::OK|Wx::CANCEL)
     
      sizer.add(button_sizer, 0, Wx::EXPAND|Wx::ALL, 5)
     
      # Okay Button Event!!!!
     
      evt_button(self.get_affirmative_id()) { |event| on_okay() }
     
      set_sizer(sizer)
      show()
    end # initialize
   
    # Collect computer records from Directory and add to database
   
    def on_okay()
      ldap = Net::LDAP.new :host => <at> server.get_value, :port => 389, :auth => { :method => :simple, :username => <at> username.get_value, :password => <at> password.get_value }
     
      filter = Net::LDAP::Filter.eq("objectcategory", "CN=Computer,CN=Schema,CN=Configuration,#{ <at> tree_base.get_value}")
     
      # We don't want to return a result set as it could be pretty huge and we don't need it.
      #   We are treating the container name as the group name here.
     
      ldap.search(:base => <at> tree_base.get_value, :filter => filter, :return_result => false) do |record|
        computer_name = record.cn.to_s
        begin
          os = record.operatingsystem
        rescue
          os = ''
        end
        lab = record.dn.split(',')[1].split('=')[1]
       
        # Check db for lab and add it if it isn't already there
       
        unless Lab.find :name => lab
          lab = Lab.new(:name => lab)
          lab.save
          lab = lab.name
        end
       
        # Save machine record
       
        machine = Computer.new(:name => computer_name, :os => os, :location => lab)
        machine.save
      end
      log_file = File.open("log.txt", "a"); log_file.puts "\n\nFinished populate next instruction is close\n\n"; log_file.close
      self.close()
    end # on_okay
end # DBPopulateDialog class

After filling out the proper information and clicking on okay the data is populated however when it finishes the dialog hangs around.  Furthermore it won't close when you click on Cancel or the Window close widget (the X in my case).  The log line executes just fine, the dialog just refuses to close.

-Glen

--
"Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)
_______________________________________________
wxruby-users mailing list
wxruby-users <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Ross Goodell | 1 Oct 16:06

How can I find out the state of capslock?

Although I can use KeyEvent#shift_down to find out if the shift key was
held down when a key is pressed, I don't know how to find out if the
capslock key is in effect (the capslock key was pressed the capslock LED
is on, and other programs are treating an 'a' keypress as an 'A').  I
could catch capslock keypresses by checking evt.get_key_code for 311,
but don't know what the starting capslock state is since it might have
been set when the user was in another program.  Can someone tell me how
to find out what what the capslock state is?

Thanks, Ross
--

-- 
Posted via http://www.ruby-forum.com/.
Joseph Edelstein | 1 Oct 09:47

brain freeze on how to program

I have come to a complete brick wall in my mind.  I am trying to write a
game where the user has to hit the space bar as close to a sound that
plays every second.  If the user hits the space bar and releases it
before the sound, one set of boxes will light up.

If the user hits and releases the space bar after the sound, another set
of boxes will light up.

I have some code but am blanking on how to move forward.

Need some guidance from better programmers then I.

Thanks in advance.

Joe

Code sample:

def ag_start

  total = 5
  c = 0
  sound_timer = Timer.every(1000)
{Sound.play("c:\\windows\\media\\chimes.wav")}
  while c < total
 ####listen for half a second for if user presses the space bar before
the sound
 #
 #
 evt_key_up() { | event | if event.get_key_code == 32 then  #get the
time difference from the key up to the sound

      }
 #
 #
 #play sound ########################
 #
 #

  evt_key_up() { | event | if event.get_key_code == 32 then  #get the
time difference from the sound to the key up

      }
 #
 #
 #listen for half a second for if the user presses the space bar after
the sound
 #
 #repeat for time required
 c = c + 1
 end

  #sound_timer.stop
end
--

-- 
Posted via http://www.ruby-forum.com/.
Zhimin Zhan | 1 Oct 06:48

undefined method 'end_edit_label' in Wx::TreeCtrl

Hi,

Maybe a documentation update.

 #<NoMethodError: undefined method 'end_edit_label' for
#<Wx::TreeCtrl:0xb381da4>>

I raised the following issue (similar) before, sometimes a Wx::Rect
object sometimes passed as an event. I found more occurrences, still
quite rare though.

Env: wxRuby 1.9.8 mswin32 on XP.

Cheers,
Zhimin
--

-- 
Posted via http://www.ruby-forum.com/.
Omar Hernandez | 27 Sep 02:02

Problems with ToolBar Sintaxis

First of all, it's my first week learnig ruby and so is for wxruby,also
this is my first time working with a GUI so please, please, be patient.

I'm having problems with the code for a toolbar, i want to add an item,
but a don't know how. this is my code for now:

 @toolBarPrincipal=ToolBar.new(@panel)
 @toolBarPrincipal.add_tool(-1, '&Bonzai', Bitmap.new("/home/.......
icon.ico"))

I've already red the http://wxruby.rubyforge.org/doc/toolbar.html page
(mi code is basically what comes there.

I want to put it into a panel, named panel. At this point, a litle dot
is drawn on the top-left corner (under a menu bar) but no icon.

I'd appreciate if you help me. A correction, some code examples or some
links would be perfect.

Thanks!!

Sorry if i'm making a thread that already exists (i searched first)
--

-- 
Posted via http://www.ruby-forum.com/.
Nathan Macinnes | 24 Sep 04:54

sample desktop app

Hi all,
I'm trying to develop a desktop application, and since I've done a fair
bit of work with RoR before, I figured ruby is a good way to go about
it. My application will be largely database driven.
I'm looking for a sample desktop application which I can learn a few
things from. Obviously the less restrictive the license the better, and
it'd also be good if I can find one which is database driven. Google
seems to provide very little.. or at least, the results are cluttered by
RoR things. I was wondering if anyone in the group knows of any.
Nathan
--

-- 
Posted via http://www.ruby-forum.com/.
Doug Glidden | 18 Sep 14:39

TAB_TRAVERSAL within a dialog box

Hi,

Is there any known issue with using a Panel with TAB_TRAVERSAL within a
Dialog?  I'm having an issue my app freezing up when I enable the
TAB_TRAVERSAL style on a panel within a dialog box, and before I go
through the trouble of making a simpler demo that will show what's
happening, I wanted to make sure that there's not a known issue here.
If so, is there a workaround?

The problem doesn't show up until I click on one of several radio
buttons that are outside of the Panel with the TAB_TRAVERSAL flag set.
Then the app immediately freezes, without even calling the event handler
for the radio button.

Doug
--

-- 
Posted via http://www.ruby-forum.com/.

Gmane