fxruby-users Mailing List for FXRuby (Page 18)
Status: Inactive
Brought to you by:
lyle
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(75) |
Jul
(90) |
Aug
(61) |
Sep
(56) |
Oct
(56) |
Nov
(39) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(56) |
Feb
(45) |
Mar
(61) |
Apr
(40) |
May
(95) |
Jun
(79) |
Jul
(63) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: Lyle J. <jl...@cf...> - 2004-01-09 16:27:17
|
Rich wrote: > I'm trying to insert my own FXTextField right after the directory drop > down in the first FXHorizontalFrame... but I've only found the > 'children()' method as the way to navigate through the existing > structure... and that returns an FXWindow... reparent and linkAfter > require an FXComposite type as the parameter... <snip code examples> > What are my options? Is there an easy/easier way to 'insert' something > into an existing widget like the FXFileSelector? The approaches that you're trying are correct, but there is a problem with the return values for FXWindow#children. The first child widget for the FXFileSelector is supposed to be an FXHorizontalFrame but it's being returned to you as an FXWindow instance instead. I know what's wrong, but I don't think there's a workaround for FXRuby-1.0.27. I have added this to the bug list and it should be fixed in the next release. |
From: Lyle J. <jl...@cf...> - 2004-01-09 16:24:09
|
Carsten Eckelmann wrote: > thanks this helps a bit (it gets my app going), but it's VERY SLOW. I'm > writing an ImageView Widget that doesn't scroll, but scales the image > according to the window size. This means, that with every SEL_PAINT > message I need to copy a back_image to the front_image, you can imagine > how slow the drawing is, when copying via files. [Sorry for the delayed response.] I've fixed some things for FXMemoryStream for the next release, so hopefully you'll be able to use that instead in the near future. |
From: Lyle J. <jl...@cf...> - 2004-01-08 16:10:56
|
Rich wrote: > puts FXTextField.new(mainwin,20).getClassName() It's returning the name of the underlying C++ class. There's no reason for this function to even be exposed to the Ruby interface, just an oversight on my part. If you need to know the Class of the Ruby object you've got, just use the standard Object#class instead. |
From: Joel V. <vj...@PA...> - 2004-01-08 07:20:49
|
Rich wrote: > Here's the code: > > require 'fox' > include Fox > theApp=FXApp.new > mainwin=FXMainWindow.new(theApp,"Test") > puts FXTextField.new(mainwin,20).getClassName() > theApp.create > mainwin.show(PLACEMENT_SCREEN) > theApp.run I dunno (maybe it has something to do with the way C++ classes are wrapped), but puts FXTextField.new(mainwin,20).class.name behaves in an unsurprising way. Hope that helps... |
From: Rich <ri...@li...> - 2004-01-08 07:10:00
|
Here's the code: require 'fox' include Fox theApp=3DFXApp.new mainwin=3DFXMainWindow.new(theApp,"Test") puts FXTextField.new(mainwin,20).getClassName() theApp.create mainwin.show(PLACEMENT_SCREEN) theApp.run -Rich |
From: Rich <ri...@li...> - 2004-01-08 06:46:09
|
I'm trying to insert my own FXTextField right after the directory drop = down in the first FXHorizontalFrame... but I've only found the = 'children()' method as the way to navigate through the existing = structure... and that returns an FXWindow... reparent and linkAfter = require an FXComposite type as the parameter... Here's the two different NON-working code attempts: localVF=3DFXVerticalFrame.new(contentHF,LAYOUT_FILL_X|LAYOUT_FILL_Y) lfs=3DFXFileSelector.new(localVF,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y) ldTF=3DFXTextField.new(localVF,20,nil,0,LAYOUT_FILL_X) ldTF.reparent(lfs.children()[0]) ...and a different approach... localVF=3DFXVerticalFrame.new(contentHF,LAYOUT_FILL_X|LAYOUT_FILL_Y) lfs=3DFXFileSelector.new(localVF,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y) ldTF=3DFXTextField.new(lfs.children()[0],20,nil,0,LAYOUT_FILL_X) ldTF.linkAfter(lfs.children()[0].children()[3]) What are my options? Is there an easy/easier way to 'insert' something = into an existing widget like the FXFileSelector? -Rich |
From: Rich <ri...@li...> - 2004-01-08 06:38:01
|
I think I answered my own question - I was asking for the width before = the window had been 'drawn' (is that the right term?)... so I got '1'. If I asked for the width after it was drawn, then I got the more = sensible answer... -Rich |
From: Rich <ri...@li...> - 2004-01-08 03:04:56
|
When I output the 'width' of a widget I get '1'... I'm assuming that's = because it's autosized - but then how can I tell how big it is at any = time during runtime? I looked through the archives at SourceForge, but none of the subject = lines seemed to match. Thanks for any help with such a simple question! -Rich |
From: Joel V. <vj...@PA...> - 2004-01-06 06:59:57
|
chris mueffling wrote: > Hi! > > Using ruby 1.8.{0,1}, fox-1.0.{43,48}, FXRuby-1.0.{25,27} on > Linux/Intel and Solaris/Intel and WindowsXP: > > I have a FOX application, everything works fine. But as soon as > I call 'exit' from within (or send a FXApp::ID_QUIT to getApp()) > I get something like: > > ------------------------------------------------ > ./rootwindow.rb:133: [BUG] Segmentation fault > ruby 1.8.1 (2003-12-25) [i686-linux-gnu] > > Aborted > ------------------------------------------------ > > Since this is not a very expressive error message: > > Is this behaviour known to anyone? Any hints in which direction > I should go finding this error? What I always try first in these situations is: turn off garbage collection with GC.disable. If that stops the segfault, then it's a good bet there's a bug somewhere in the mark/free funcs within FXRuby. Other than that, I would try paring down the app to the minimal code that will reliably cause the problem, and then post it here. Of course, that can be hard work.... |
From: chris m. <ze...@gm...> - 2004-01-06 06:49:20
|
Hi! Using ruby 1.8.{0,1}, fox-1.0.{43,48}, FXRuby-1.0.{25,27} on Linux/Intel and Solaris/Intel and WindowsXP: I have a FOX application, everything works fine. But as soon as I call 'exit' from within (or send a FXApp::ID_QUIT to getApp()) I get something like: ------------------------------------------------ ./rootwindow.rb:133: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i686-linux-gnu] Aborted ------------------------------------------------ Since this is not a very expressive error message: Is this behaviour known to anyone? Any hints in which direction I should go finding this error? Thanks, -- chris |
From: Carsten E. <ca...@ci...> - 2004-01-04 11:59:14
|
Lyle Johnson wrote: > Based on the error message, there's probably a bug with the wrapping > of FXMemoryStream, and I will need to take a look. In the meantime, if > it's acceptable to use a temporary file you can just save the image > out to disk and re-load it for the copy, i.e. > > # Save orig_img to a file on disk (tmpfile.jpg) > FXFileStream.open("tmpfile.jpg", FXStreamSave) do |stream| > fxsaveJPG(stream, orig_img.data.to_s, 0, > orig_img.width, orig_img.height, orig_img.quality) > end > > # Reload it and make a new FXJPGImage > dest_img = nil > File.open("tmpfile.jpg", "rb") do |file| > dest_img = FXJPGImage.new(app, file.read, > IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP) > end Lyle, thanks this helps a bit (it gets my app going), but it's VERY SLOW. I'm writing an ImageView Widget that doesn't scroll, but scales the image according to the window size. This means, that with every SEL_PAINT message I need to copy a back_image to the front_image, you can imagine how slow the drawing is, when copying via files. BTW: you can download the source code for the FXScaleImageView from http://carsten.circle42.com/source/ScaleImage/FXScaleImageView and a test program from http://careck.circle42.com/source/ScaleImage/TestFXScaleImageView |
From: Lyle J. <jl...@cf...> - 2004-01-02 21:03:08
|
Carsten Eckelmann wrote: > I just can't figure out how this FXMemoryStream works. I just want to > (deep) copy an image in memory: <snip> > What am I doing wrong? Based on the error message, there's probably a bug with the wrapping of FXMemoryStream, and I will need to take a look. In the meantime, if it's acceptable to use a temporary file you can just save the image out to disk and re-load it for the copy, i.e. # Save orig_img to a file on disk (tmpfile.jpg) FXFileStream.open("tmpfile.jpg", FXStreamSave) do |stream| fxsaveJPG(stream, orig_img.data.to_s, 0, orig_img.width, orig_img.height, orig_img.quality) end # Reload it and make a new FXJPGImage dest_img = nil File.open("tmpfile.jpg", "rb") do |file| dest_img = FXJPGImage.new(app, file.read, IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP) end Hope this helps, Lyle |
From: <ly...@kn...> - 2004-01-02 17:11:41
|
On Fri, 2 Jan 2004 08:56:41 -0500, Tristan O'Tierney <tr...@ot...> wrote : > Hi there, > > When i try and run ruby install.rb config > --with-fox-include=/opt/local/include > > i get this error: > config: unknown option --with-fox-include=/opt/local/include > Try 'ruby install.rb --help' for detailed usage. You are missing an additional "--" between the word "config" and the option "--with-fox-include=/opt/local/include". Try this instead: ruby install.rb config -- --with-fox-include=/opt/local/include and it should work. Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2004-01-02 15:30:41
|
Rich wrote: > I have an EXE written in a different programming language... and I'd > love to use it in an FXRuby application, but I don't want to rewrite it. > > I'm thinking of something along the lines of a ScrollArea, > HorizontalFrame, or VerticalFrame where I can set the child to be this > external EXE... > > Can this be done? I really doubt it, unless that application (the EXE) is an ActiveX control. And even then, I personally don't know how one goes about embedding ActiveX controls into a FOX application, although I'm pretty sure people have done that in the past. |
From: Carsten E. <ca...@ci...> - 2004-01-02 00:58:56
|
Hi, I just can't figure out how this FXMemoryStream works. I just want to (deep) copy an image in memory: def copy_img(orig_img) dest_img = FXJPGImage.new(getApp(), nil, IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP) data = "" FXMemoryStream.new { |stream| stream.open(data,FXStreamSave) orig_img.savePixels(stream) } FXMemoryStream.new { |stream| stream.open(data,FXStreamLoad) dest_img.loadPixels(stream) } dest_img.create dest_img end But with this code I get this error: test.rb:25:in `open': No matching function for overloaded 'FXMemoryStream_open' (ArgumentError) from /home/careck/work/test/ruby/ScaleImageView/test.rb:25:in `copy_img' What am I doing wrong? Cheers, Carsten. |
From: Rich <ri...@li...> - 2004-01-01 18:56:10
|
I have an EXE written in a different programming language... and I'd = love to use it in an FXRuby application, but I don't want to rewrite it. I'm thinking of something along the lines of a ScrollArea, = HorizontalFrame, or VerticalFrame where I can set the child to be this = external EXE... Can this be done? -Rich |
From: Tom <tku...@so...> - 2003-12-30 19:42:59
|
DOH! Sorry... Got it. I'll use the stippling to highlight it instead. Tom Lyle Johnson wrote: > Tom wrote: > >> Thanks a ton. These solutions worked great. BTW, Is there a way to >> set font color for a particular cell? > > > Ummm, answered that question on this mailing list just yesterday, Tom ;) > > |
From: Lyle J. <jl...@cf...> - 2003-12-30 19:39:07
|
Tom wrote: > Thanks a ton. These solutions worked great. BTW, Is there a way to set > font color for a particular cell? Ummm, answered that question on this mailing list just yesterday, Tom ;) |
From: Tom <tku...@so...> - 2003-12-30 18:59:56
|
Lyle, Thanks a ton. These solutions worked great. BTW, Is there a way to set font color for a particular cell? Thanks, Tom Lyle Johnson wrote: > Tom wrote: > >> I'm a newbie to fox and FXRuby. I have 3 table problems I can't solve: >> >> 1.) I'd like to turn off the ability to select particular cells, ie >> the equivalent of FXTableItem.disable(). I attempt to use "disable" >> but keep getting the error that it's an unknown method. > > > There's no direct way to disable table items, but you can intercept > the SEL_LEFTBUTTONPRESS and SEL_LEFTBUTTONRELEASE messages that the > FXTable sends to its target in order to ignore mouse clicks on certain > cells, e.g. > > # Catch left-button press from table > @table.connect(SEL_LEFTBUTTONPRESS) do |sender, sel, event| > # Get row and column for clicked cell > row = @table.rowAtY(event.win_y) > col = @table.colAtX(event.win_x) > > # If this cell is enabled, return zero (i.e. have the > # block evaluate to zero) so that the table's normal > # processing of the left-button press event will kick in. > # If this cell is disabled, return non-zero to indicate > # that we've completely handled the event; in this case, > # the cell shouldn't get "selected". > # > result = tableItemEnabled(row, col) ? 0 : 1 > end > > # Catch left-button release from table > @table.connect(SEL_LEFTBUTTONRELEASE) do |sender, sel, event| > # Get row and column for clicked cell > row = @table.rowAtY(event.win_y) > col = @table.colAtX(event.win_x) > > # If this cell is enabled, return zero (i.e. have the > # block evaluate to zero) so that the table's normal > # processing of the left-button press event will kick in. > # If this cell is disabled, return non-zero to indicate > # that we've completely handled the event; in this case, > # the cell shouldn't get "selected". > # > result = tableItemEnabled(row, col) ? 0 : 1 > end > >> 2.)I'd also to make it so that a click on any cell in a row selects >> that entire row. > > > Something like this should work: > > @table.connect(SEL_COMMAND) do |sender, sel, tablePos| > @table.setAnchorItem(tablePos.row, 0) > @table.extendSelection(tablePos.row, @table.numCols-1, true) > end > >> 3.) I can't seem to figure out how to tell a particular FXTableItem >> how to respond to events. What I have is a table, and several >> buttons outside of the table. When the user dbl-clicks a cell, I >> want it to be the same thing as selecting a particular cell and >> hitting my "edit" button. > > > Something like this should work: > > @table.connect(SEL_DOUBLECLICKED) do |sender, sel, tablePos| > editThisCell(tablePos.row, tablePos.col) > end > > Hope this helps, > > Lyle |
From: Lyle J. <ly...@us...> - 2003-12-29 22:30:36
|
Daniel Sperl wrote: > Is there a way to change the color of a _single_ cell? > Or does anyone know a workaround? There isn't a straightforward way to do this in FOX 1.0. You could conceivably do it by subclassing FXTableItem and overriding its drawContent() method, but that is much more problematic than it should be. Hopefully, Jeroen will address some of these limitations in FOX 1.2. |
From: Lyle J. <jl...@cf...> - 2003-12-29 22:27:44
|
Tom wrote: > I'm a newbie to fox and FXRuby. I have 3 table problems I can't solve: > > 1.) I'd like to turn off the ability to select particular cells, ie the > equivalent of FXTableItem.disable(). I attempt to use "disable" but keep > getting the error that it's an unknown method. There's no direct way to disable table items, but you can intercept the SEL_LEFTBUTTONPRESS and SEL_LEFTBUTTONRELEASE messages that the FXTable sends to its target in order to ignore mouse clicks on certain cells, e.g. # Catch left-button press from table @table.connect(SEL_LEFTBUTTONPRESS) do |sender, sel, event| # Get row and column for clicked cell row = @table.rowAtY(event.win_y) col = @table.colAtX(event.win_x) # If this cell is enabled, return zero (i.e. have the # block evaluate to zero) so that the table's normal # processing of the left-button press event will kick in. # If this cell is disabled, return non-zero to indicate # that we've completely handled the event; in this case, # the cell shouldn't get "selected". # result = tableItemEnabled(row, col) ? 0 : 1 end # Catch left-button release from table @table.connect(SEL_LEFTBUTTONRELEASE) do |sender, sel, event| # Get row and column for clicked cell row = @table.rowAtY(event.win_y) col = @table.colAtX(event.win_x) # If this cell is enabled, return zero (i.e. have the # block evaluate to zero) so that the table's normal # processing of the left-button press event will kick in. # If this cell is disabled, return non-zero to indicate # that we've completely handled the event; in this case, # the cell shouldn't get "selected". # result = tableItemEnabled(row, col) ? 0 : 1 end > 2.)I'd also to make it so that a click on any cell in a row selects that > entire row. Something like this should work: @table.connect(SEL_COMMAND) do |sender, sel, tablePos| @table.setAnchorItem(tablePos.row, 0) @table.extendSelection(tablePos.row, @table.numCols-1, true) end > 3.) I can't seem to figure out how to tell a particular FXTableItem how > to respond to events. What I have is a table, and several buttons > outside of the table. When the user dbl-clicks a cell, I want it to be > the same thing as selecting a particular cell and hitting my "edit" button. Something like this should work: @table.connect(SEL_DOUBLECLICKED) do |sender, sel, tablePos| editThisCell(tablePos.row, tablePos.col) end Hope this helps, Lyle |
From: Tom <tku...@so...> - 2003-12-29 20:19:02
|
Hi, I'm a newbie to fox and FXRuby. I have 3 table problems I can't solve: 1.) I'd like to turn off the ability to select particular cells, ie the equivalent of FXTableItem.disable(). I attempt to use "disable" but keep getting the error that it's an unknown method. 2.)I'd also to make it so that a click on any cell in a row selects that entire row. 3.) I can't seem to figure out how to tell a particular FXTableItem how to respond to events. What I have is a table, and several buttons outside of the table. When the user dbl-clicks a cell, I want it to be the same thing as selecting a particular cell and hitting my "edit" button. I've grepped my way through the fox docs, hoping to find a way to do what I need to do, but to no avail. Any help or pointers to help will be greatly appreciated, Tom |
From: Joel V. <vj...@PA...> - 2003-12-24 05:05:32
|
Joel VanderWerf wrote: > > I'm updating a FXList from a thread, and I'd like to > always scroll to the last item. This is what I tried: > > require 'fox' > include Fox > > app = FXApp.new("List", "TEST") > win = FXMainWindow.new(app, "list") > list = FXList.new(win, 10) > Thread.new do > 20.times do |i| > list << i.to_s > # sleep 0.1 > list.makeItemVisible(list.numItems-1) # no effect > sleep 0.1 > end > end > win.show > app.create > app.run > > As it is, the makeItemVisible has no effect, immediate or delayed. > However, if I uncomment the first sleep, it has an immediate effect, as > desired. > > Does that make sense? I guess a better question is, what is happening during that first sleep that I could do manually (without sleeping) to ensure that the makeItemVisible call has an effect? I've tried recalc, update, flush, forceRefresh. Overkill, I know, but all in the name of science... Actually, I've found that Thread.pass has the same effect as sleeping, so I guess I'll just use that. |
From: Lyle J. <ly...@kn...> - 2003-12-22 20:32:36
|
On Dec 22, 2003, at 12:40 PM, Christoph Gentsch wrote: > I recently have downloaded a FOX Class Reference, but > yours seems to be a lot better, because it mentions all > EVENTS and LAYOUTS and so on for the widgets, you know. > My problem is, I have no Internet at home, so is there a way > to use your reference offline? Yes. A tarball of the FXRuby API documentation can be downloaded from the SourceForge project Files list, found here: http://sourceforge.net/project/showfiles.php?group_id=20243 Hope this helps, Lyle |
From: <ly...@kn...> - 2003-12-22 17:32:30
|
On Mon, 22 Dec 2003 10:48:49 -0500, "Cribbs, Jamey" <Jam...@oa...> wrote : > I know this has been discussed some on the mailing list, but do you > forsee the ability to justify IconList columns coming anytime soon? The FOX 1.0 API is frozen (since early 2002) and since adding the capability to right-justify icon list columns would require API changes, you will not see this happen in FOX 1.0. This has not been added to FOX 1.2 either, but since that version is still under development this might be a good time for you to suggest it (on the foxgui-users mailing list). If you can make your case for why this would be useful, and if enough people seem to be in support of it, Jeroen might add that capability. |