fxruby-users Mailing List for FXRuby (Page 19)
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: Joel V. <vj...@PA...> - 2003-12-21 22:07:15
|
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? |
From: Carsten E. <ca...@ci...> - 2003-12-17 22:19:52
|
Sander Jansen wrote: >Lyle, > >I don't think that will work, img is still a FXBMPImage. What you really want >to do is call (the ruby alternatives) > >fxloadBMP(parameters); > >and > >fxsaveJPG(parameters); > >You don't need the image class if you're not going to show it on screen. > > Sander > > > Thanks Sander, I tried this and it works perfectly, just for reference here's the ruby code, to make it work: ----------------------------------- require 'fox' include Fox img = nil FXFileStream.open("image.bmp", FXStreamLoad) do |stream| img = fxloadBMP(stream) end FXFileStream.open("image.jpg", FXStreamSave) do |stream| fxsaveJPG(stream, img[0], img[1], img[2], img[3], 100) end ----------------------------------- Cheers, Carsten. |
From: Lyle J. <jl...@cf...> - 2003-12-17 17:34:38
|
Carl Youngblood wrote: > I tried adding app.flush and app.forcerefresh after I show the progress > dialog but nothing seemed to change. Carl, I think we are spinning our wheels at this point ;) Can you please send me running code that demonstrates the problem, and I promise to take a look at it this afternoon. At this point I think it's best that I see the program instead of a code snippet, just in case there's something else going on that is a problem. Thanks, Lyle |
From: Carl Y. <ca...@yo...> - 2003-12-17 17:29:18
|
I also tried prog.update Thanks for all your help. Carl Carl Youngblood wrote: > I tried adding app.flush and app.forcerefresh after I show the > progress dialog but nothing seemed to change. I see only the pie > chart, since it is being updated, and the rest of the dialog doesn't > show up until the operation is over. I figured that maybe I needed to > call forcerefresh or flush on the FXProgressDialog itself, but it > didn't seem to have these methods. > > Lyle Johnson wrote: > >> Carl Youngblood wrote: >> >>> I spoke too soon. It is plain white because it doesn't have a high >>> refresh priority while my application is chugging away doing it's >>> own work. Is there a way I can give it a higher priority to make >>> sure it gets painted properly before I begin my work? >> >> >> >> You may want to look at this question from this FOX FAQ list: >> >> http://www.fox-toolkit.org/faq.html#CLIENTSERVER >> >> Hope this helps, >> >> Lyle >> >> >> |
From: Carl Y. <ca...@yo...> - 2003-12-17 17:24:58
|
I tried adding app.flush and app.forcerefresh after I show the progress dialog but nothing seemed to change. I see only the pie chart, since it is being updated, and the rest of the dialog doesn't show up until the operation is over. I figured that maybe I needed to call forcerefresh or flush on the FXProgressDialog itself, but it didn't seem to have these methods. Lyle Johnson wrote: > Carl Youngblood wrote: > >> I spoke too soon. It is plain white because it doesn't have a high >> refresh priority while my application is chugging away doing it's own >> work. Is there a way I can give it a higher priority to make sure it >> gets painted properly before I begin my work? > > > You may want to look at this question from this FOX FAQ list: > > http://www.fox-toolkit.org/faq.html#CLIENTSERVER > > Hope this helps, > > Lyle > > > |
From: Lyle J. <jl...@cf...> - 2003-12-17 17:02:38
|
Carl Youngblood wrote: > Thanks. One more question. Is there a quick way to center the dialog > in center of its parent window, or do I need to figure out the geometry > myself? I think that show(PLACEMENT_OWNER) should do that, see: http://www.fxruby.org/doc/api/classes/Fox/FXTopWindow.html Lyle |
From: Lyle J. <jl...@cf...> - 2003-12-17 16:30:29
|
Carl Youngblood wrote: > I spoke too soon. It is plain white because it doesn't have a high > refresh priority while my application is chugging away doing it's own > work. Is there a way I can give it a higher priority to make sure it > gets painted properly before I begin my work? You may want to look at this question from this FOX FAQ list: http://www.fox-toolkit.org/faq.html#CLIENTSERVER Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2003-12-17 16:25:57
|
Carl Youngblood wrote: > It worked! Except it just appears plain white with no normal window > style and a piechart with a percentage. Is there a quick way to get a > more conventional progress dialog? I want a modal dialog box with a > title, some text below it, and a horizontal bar that moves from left to > right. I can't believe this, but no, it appears that in FOX 1.0 you're stuck with the "piechart" format for the progress dialog. Looks like this is fixed for FOX 1.2, but that doesn't help us at the moment. I think your only workaround would be to roll your own custom dialog box with a regular FXProgressBar inside it. As for the window decorations, instead of this: PROGRESSDIALOG_NOCANCEL try passing in this: DECOR_TITLE|DECOR_BORDER|PROGRESSDIALOG_NOCANCEL Hope this helps, Lyle |
From: Carl Y. <ca...@yo...> - 2003-12-17 16:07:08
|
I spoke too soon. It is plain white because it doesn't have a high refresh priority while my application is chugging away doing it's own work. Is there a way I can give it a higher priority to make sure it gets painted properly before I begin my work? And I also want to change the bar to be horizontal instead of pie shaped. Thanks, Carl Carl Youngblood wrote: > It worked! Except it just appears plain white with no normal window > style and a piechart with a percentage. Is there a quick way to get a > more conventional progress dialog? I want a modal dialog box with a > title, some text below it, and a horizontal bar that moves from left > to right. > > Thanks, > Carl > > Lyle Johnson wrote: > >> Carl Youngblood wrote: >> >>> Actually, even though I hadn't shown that in the code I sent to you, >>> I had tried that (calling prog.show after instantiating it) and it >>> still doesn't work. >> >> >> >> Ah, my bad. What I should have said was add these *two* lines at the >> beginning of the block: >> >> prog.create >> prog.show >> >> Let's see if that does it! >> >> >> |
From: Carl Y. <ca...@yo...> - 2003-12-17 16:04:09
|
It worked! Except it just appears plain white with no normal window style and a piechart with a percentage. Is there a quick way to get a more conventional progress dialog? I want a modal dialog box with a title, some text below it, and a horizontal bar that moves from left to right. Thanks, Carl Lyle Johnson wrote: > Carl Youngblood wrote: > >> Actually, even though I hadn't shown that in the code I sent to you, >> I had tried that (calling prog.show after instantiating it) and it >> still doesn't work. > > > Ah, my bad. What I should have said was add these *two* lines at the > beginning of the block: > > prog.create > prog.show > > Let's see if that does it! > > > |
From: Sander J. <sx...@cf...> - 2003-12-17 16:02:30
|
Lyle, I don't think that will work, img is still a FXBMPImage. What you really = want=20 to do is call (the ruby alternatives) fxloadBMP(parameters); and=20 fxsaveJPG(parameters); You don't need the image class if you're not going to show it on screen.=20 =09Sander On Wednesday 17 December 2003 09:56 am, Lyle Johnson wrote: > Carsten Eckelmann wrote: > > is it possible to load a BMPImage and save it as a JPEG, just by usin= g > > the FOX library? I couldn't find this out by looking at the API. > > Good question (and the answer is yes). Load the BMP image from a file > using code like this: > > img =3D FXBMPImage.new(getApp(), nil, > IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP) > FXFileStream.open("image.bmp", FXStreamLoad) do |stream| > img.loadPixels(stream) > end > > and then save it as a JPEG using code like this: > > FXFileStream.open("image.jpg", FXStreamSave) do |stream| > img.savePixels(stream) > end > > Hope this helps, > > Lyle > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM= 's > Free Linux Tutorials. Learn everything from the bash shell to sys admi= n. > Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclick > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users |
From: Lyle J. <jl...@cf...> - 2003-12-17 15:57:23
|
Carsten Eckelmann wrote: > is it possible to load a BMPImage and save it as a JPEG, just by using > the FOX library? I couldn't find this out by looking at the API. Good question (and the answer is yes). Load the BMP image from a file using code like this: img = FXBMPImage.new(getApp(), nil, IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP) FXFileStream.open("image.bmp", FXStreamLoad) do |stream| img.loadPixels(stream) end and then save it as a JPEG using code like this: FXFileStream.open("image.jpg", FXStreamSave) do |stream| img.savePixels(stream) end Hope this helps, Lyle |
From: Lyle J. <jl...@cf...> - 2003-12-17 15:51:44
|
Carl Youngblood wrote: > Actually, even though I hadn't shown that in the code I sent to you, I > had tried that (calling prog.show after instantiating it) and it still > doesn't work. Ah, my bad. What I should have said was add these *two* lines at the beginning of the block: prog.create prog.show Let's see if that does it! |
From: Will M. <wi...@co...> - 2003-12-17 12:07:59
|
Joel VanderWerf wrote: > Ouch, wasn't aware of that. Next time I release FoxTails, I'll see if I > can build a windows binary of rbtree and make that available. I tought that was the case. I don't really feel like I need rbtree at this point. (today at least, tomorrow, who knows ;^) ) > Well, I'll take a look at it, but the tree stuff in FoxTails 0.2 is > sorta pre-alpha, so don't expect much to really work correctly... Yeah, I know its early still, but it looks like it is working mostly right, its just the business of adding nodes at run time that I can't get to work. It is likely because I am not doing it right. I can't say that I really understand how your stuff works yet, not at the intuative level that I want. I am pleased with it, but I really do not have it under my belt yet. ;^) I will keep working on it, I was just hoping for some ideas. --Will |
From: Carsten E. <ca...@ci...> - 2003-12-17 10:36:21
|
Hi all, is it possible to load a BMPImage and save it as a JPEG, just by using the FOX library? I couldn't find this out by looking at the API. Cheers, Carsten. |
From: Joel V. <vj...@PA...> - 2003-12-17 06:14:06
|
Will Merrell wrote: > Joel, (and everyone else) > > I have been trying out the Treelike stuff in your new Foxtails release. The > first problem I noticed is that your fancy tree example requires rbtree > which does not have a windows version. Since I don't feel up to trying to > figure out how to make it work on windows, I can't test it. Ouch, wasn't aware of that. Next time I release FoxTails, I'll see if I can build a windows binary of rbtree and make that available. I can't seem to find a binary in the usual places, like http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/. I notice that no one has voted for it at http://www.rubygarden.org/ruby?WindowsInstallerVote, so maybe we can't expect it in the installer any time soon. > The second problem seems a little more aggravating. Using the tree.rb > example I am creating a tree list on one window. Everything works fine for > the stuff that I add inside the create methods. Well, I'll take a look at it, but the tree stuff in FoxTails 0.2 is sorta pre-alpha, so don't expect much to really work correctly... Joel |
From: Will M. <wi...@co...> - 2003-12-17 04:05:08
|
Joel, (and everyone else) I have been trying out the Treelike stuff in your new Foxtails release. The first problem I noticed is that your fancy tree example requires rbtree which does not have a windows version. Since I don't feel up to trying to figure out how to make it work on windows, I can't test it. The second problem seems a little more aggravating. Using the tree.rb example I am creating a tree list on one window. Everything works fine for the stuff that I add inside the create methods. The problem comes when I try to add a new node after the create process is complete. I get a error message that reads: Please report this bug: This FXTreeItem * already released In Observer when value of variable `child_joins_parent' matched pattern Object In Observer when value of variable `tree' matched pattern Object In Observer when value of variable `targetObject' matched pattern Object (Note that the last two things listed are variable names in my program, but the first is not and I can't make sense of any of it.) I can change various things and get various different variations on that error message, but I can't get it to work. How should this work? PS, I am including some code below. This will look familiar, but it has the FTTree stuff added. -- Will Will Merrell Personal Coach wi...@co... Coaching Life - Helping you live your dreams. http://www.coaching-life.com ==================== begin code ==================== #!/usr/bin/env ruby require 'fox' require 'fox/responder' require 'fox/colors' require 'observable' require 'foxtails' require 'foxtails/icons' require 'foxtails/treelike/array-tree' require 'rasautilities' include Fox include Observable include FoxTails class ObjectInspector include Responder extend Observable observable :current_node, :tree, :item_name def initialize(app, proj) @targetObject = nil createWindow(app, proj) end def createWindow(app, proj) @app = app @project = proj @projectName = proj.projectName @inspectordlg = FXDialogBox.new(app, "Object Inspector", DECOR_BORDER|DECOR_RESIZE|DECOR_TITLE, 0, 0, 150, 300, 0, 0, 0, 0) # Contents contents = FXHorizontalFrame.new(@inspectordlg, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 0, 0, 0, 0) # Switcher @tabbook = FXTabBook.new(contents, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT, 0, 0, 0, 0, 2, 2, 1, 1) @tabObjectList = FXTabItem.new(@tabbook, " &Objects ", nil) outerFrame = FXVerticalFrame.new(@tabbook, LAYOUT_SIDE_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 2, 0) @innerFrame = FXVerticalFrame.new(outerFrame, FRAME_THICK|FRAME_SUNKEN|LAYOUT_SIDE_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 2, 0) FTTreeList.new(@innerFrame, 0, self, :tree, :current_node, (FRAME_SUNKEN|FRAME_THICK| LAYOUT_FILL_X|LAYOUT_FILL_Y|TREELIST_EXTENDEDSELECT| TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES)) self.tree = ArrayTree.new @objectRoot = tree.add_root(tree.make_node(@projectName)) tree.add_node(tree.make_node("child 1"), @objectRoot) @tabProperty = FXTabItem.new(@tabbook, " &Properties ", nil) @propertyFrame = FXVerticalFrame.new(@tabbook, LAYOUT_SIDE_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 2, 1) @propertyMatrix = FXMatrix.new(@propertyFrame, 2, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y|MATRIX_BY_COLUMNS|LAYOU T_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0) FXLabel.new(@propertyMatrix, "Property", nil, FRAME_THICK|LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0, 0, 0, 1, 1) FXLabel.new(@propertyMatrix, "Value", nil, FRAME_THICK|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X, 0, 0, 0, 0, 2, 2, 1, 1) FXLabel.new(@propertyMatrix, "Type", nil, LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0) @tabEvent = FXTabItem.new(@tabbook, " &Events ", nil) @eventFrame = FXVerticalFrame.new(@tabbook, LAYOUT_SIDE_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 2, 1) @eventMatrix = FXMatrix.new(@eventFrame, 2, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y|MATRIX_BY_COLUMNS|LAYOU T_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0) FXLabel.new(@eventMatrix, "Event", nil, FRAME_THICK|LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0, 2, 2, 1, 1) FXLabel.new(@eventMatrix, "Value", nil, FRAME_THICK|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 2, 2, 1, 1) FXLabel.new(@eventMatrix, "Type", nil, LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0) end def clear() @propertyMatrix.each_child {|child| child.retarget(nil) if child.class.name =~ /FoxTails/ } @eventMatrix.each_child {|child| child.retarget(nil) if child.class.name =~ /FoxTails/ } @propertyMatrix.hide @eventMatrix.hide @propertyFrame.removeChild(@propertyMatrix) @eventFrame.removeChild(@eventMatrix) end def addPropertyElement(title, obj, var) FXLabel.new(@propertyMatrix, title, nil, (LAYOUT_FIX_WIDTH|LAYOUT_LEFT|LAYOUT_SIDE_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FIL L_ROW), 0, 0, 75, 0) FTTextField.new(@propertyMatrix, 17, obj, var, (LAYOUT_FILL_X|FRAME_SUNKEN|LAYOUT_FILL_COLUMN)) end def addEventElement(title, obj, var) FXLabel.new(@eventMatrix, title, nil, LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0) FTTextField.new(@eventMatrix, 17, obj, var, (LAYOUT_FILL_X|FRAME_SUNKEN|LAYOUT_FILL_COLUMN)) end def set(newobj) @targetObject = newobj @propertyMatrix = FXMatrix.new(@propertyFrame, 2, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y|MATRIX_BY_COLUMNS|LAYOU T_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0) FXLabel.new(@propertyMatrix, "Property", nil, FRAME_THICK|LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0, 0, 0, 1, 1) FXLabel.new(@propertyMatrix, "Value", nil, FRAME_THICK|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X, 0, 0, 0, 0, 2, 2, 1, 1) FXLabel.new(@propertyMatrix, "Type", nil, LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0) unless(@targetObject.nil?) FXLabel.new(@propertyMatrix, @targetObject.objName, nil, LAYOUT_FILL_COLUMN) @targetObject.properties.sort.each {|a| addPropertyElement(a[0], @targetObject, a[1]) } end @eventMatrix = FXMatrix.new(@eventFrame, 2, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y|MATRIX_BY_COLUMNS|LAYOU T_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0) FXLabel.new(@eventMatrix, "Event", nil, FRAME_THICK|LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0, 2, 2, 1, 1) FXLabel.new(@eventMatrix, "Value", nil, FRAME_THICK|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 2, 2, 1, 1) FXLabel.new(@eventMatrix, "Type", nil, LAYOUT_FIX_WIDTH|LAYOUT_LEFT, 0, 0, 75, 0) unless(@targetObject.nil?) FXLabel.new(@eventMatrix, @targetObject.objName, nil, LAYOUT_FILL_COLUMN) @targetObject.events.sort.each {|a| addEventElement(a[0], @targetObject, a[1]) } end @inspectordlg.create @inspectordlg.show @inspectordlg.recalc end def addObject(o) p o.objName # @tree.add_node(@tree.make_node("child 1"), @objectRoot) end # Close the Inspector Windows def close @app.reg().writeIntEntry("#{@projectName}_Inspector", "x", @inspectordlg.getX-4) @app.reg().writeIntEntry("#{@projectName}_Inspector", "y", @inspectordlg.getY-30) @app.reg().writeIntEntry("#{@projectName}_Inspector", "width", @inspectordlg.width) @app.reg().writeIntEntry("#{@projectName}_Inspector", "height", @inspectordlg.height) @inspectordlg.hide end # Create and show the main window def create # Get size, etc. from registry xx = @app.reg().readIntEntry("#{@projectName}_Inspector", "x", 20) yy = @app.reg().readIntEntry("#{@projectName}_Inspector", "y", 30) ww = @app.reg().readIntEntry("#{@projectName}_Inspector", "width", 100) hh = @app.reg().readIntEntry("#{@projectName}_Inspector", "height", 400) # Reposition window to specified x, y, w and h @inspectordlg.position(xx, yy, ww, hh) # Create the windows @inspectordlg.create @inspectordlg.show(PLACEMENT_DEFAULT) end end ===================== end code ===================== |
From: Lyle J. <ly...@kn...> - 2003-12-17 03:16:45
|
On Dec 16, 2003, at 7:52 PM, Joel VanderWerf wrote: > I just realized how easy this is to do, so here is for posterity > (i.e., so I can google it when I forget how to do it :) The trick is > to avoid app.run (which would never terminate by itself because > win.show never happened, so there's nothing to close). Apologies if > this is common knowledge... > > require 'fox' > include Fox > > app = FXApp.new > win = FXMainWindow.new(app, "") > > app.create > > FXMessageBox.error(win, MBOX_OK, "caption", "message") Thanks for sharing this, Joel. It's also perhaps worth pointing out that this approach works for the more general case of just popping up any kind of dialog box. For example, to show a file dialog: require 'fox' include Fox FXApp.new do |anApp| FXMainWindow.new(anApp, "") do |theMainWindow| anApp.create puts FXFileDialog.getOpenFilename(theMainWindow, "Pick a file, any file", Dir.getwd) end end Lyle |
From: Joel V. <vj...@PA...> - 2003-12-17 01:53:10
|
I just realized how easy this is to do, so here is for posterity (i.e., so I can google it when I forget how to do it :) The trick is to avoid app.run (which would never terminate by itself because win.show never happened, so there's nothing to close). Apologies if this is common knowledge... require 'fox' include Fox app = FXApp.new win = FXMainWindow.new(app, "") app.create FXMessageBox.error(win, MBOX_OK, "caption", "message") |
From: Carl Y. <ca...@yo...> - 2003-12-17 00:20:51
|
Actually, even though I hadn't shown that in the code I sent to you, I had tried that (calling prog.show after instantiating it) and it still doesn't work. Thanks, Carl Lyle Johnson wrote: > Well, never calling show() on the dialog box is a problem ;) > > See what happens if you add the line: > > prog.show > > as the first line of the block. Also I guess a call to prog.hide at > the end. |
From: Lyle J. <jl...@cf...> - 2003-12-16 20:06:07
|
Carl Youngblood wrote: > I'm trying to display a progress dialog after the user clicks a button. > In my onClick method for my application, I have the following code: > > FXProgressDialog.new(self, > "Bayesian Inference Progress", > "Learning Bayesian network", > PROGRESSDIALOG_NOCANCEL) do |prog| > prog.total = @transactions.size - total_categorized + 120 > prog.progress = 0 > # stuff ... > prog.progress += 10 > # more stuff ... > prog.progress += 10 > # etc. etc. > end > > When I click on the button, the code gets executed but I never see the > progress dialog. What am I doing wrong? Well, never calling show() on the dialog box is a problem ;) See what happens if you add the line: prog.show as the first line of the block. Also I guess a call to prog.hide at the end. |
From: Carl Y. <ca...@yo...> - 2003-12-16 18:28:18
|
I'm trying to display a progress dialog after the user clicks a button. In my onClick method for my application, I have the following code: FXProgressDialog.new(self, "Bayesian Inference Progress", "Learning Bayesian network", PROGRESSDIALOG_NOCANCEL) do |prog| prog.total = @transactions.size - total_categorized + 120 prog.progress = 0 # stuff ... prog.progress += 10 # more stuff ... prog.progress += 10 # etc. etc. end When I click on the button, the code gets executed but I never see the progress dialog. What am I doing wrong? Thanks, Carl Youngblood |
From: Sander J. <sx...@cf...> - 2003-12-15 14:49:45
|
Probably not since Scrollframes (like a iconlist) have a default width of= 1. =09Sander On Monday 15 December 2003 12:04 am, Carl Youngblood wrote: > >What you probably want: > > > >Left Frame - needs to take up as much space as possible - > > >LAYOUT_FILL_X|LAYOUT_FILL_Y > > > >Right Frame - Only needs to take up space that it requires, though we = want > > to take as much height as there is -> LAYOUT_FILL_Y > > > >Now... the size of the right frame is determined by its contents. If y= ou > > don't put anything in there the width will be 1. So make sure if you = test > > it, you put something in there (like a button for example). > > I tested it with another frame inside the right frame, which had a list > control inside of it. Does this count? > > Thanks for the info. > > Carl |
From: Carl Y. <ca...@yo...> - 2003-12-15 06:04:05
|
>What you probably want: > >Left Frame - needs to take up as much space as possible - > >LAYOUT_FILL_X|LAYOUT_FILL_Y > >Right Frame - Only needs to take up space that it requires, though we want to >take as much height as there is -> LAYOUT_FILL_Y > >Now... the size of the right frame is determined by its contents. If you don't >put anything in there the width will be 1. So make sure if you test it, you >put something in there (like a button for example). > > > I tested it with another frame inside the right frame, which had a list control inside of it. Does this count? Thanks for the info. Carl |
From: Sander J. <sa...@kn...> - 2003-12-15 05:37:27
|
What you probably want: Left Frame - needs to take up as much space as possible - > LAYOUT_FILL_X|LAYOUT_FILL_Y Right Frame - Only needs to take up space that it requires, though we want to take as much height as there is -> LAYOUT_FILL_Y Now... the size of the right frame is determined by its contents. If you don't put anything in there the width will be 1. So make sure if you test it, you put something in there (like a button for example). If you really insist on having a fixed width (bad practice, fonts may change size and some things won't fit anymore), you have to pass the LAYOUT_FIX_WIDTH or LAYOUT_FIX_HEIGHT and pass the required size in the constructor of the widget (or later using setWidth or setHeight). Note, you can leave the LAYOUT_TOP and LAYOUT_LEFT since they don't influence anything here. Also read the documentation on layout managers: http://www.fox-toolkit.org/layout.html Hope this helps, Sander On Sunday 14 December 2003 10:55 pm, Carl Youngblood wrote: > I'm having a problem getting my application to space things the way I > want them. I basically have one horizontal frame that contains > everything. Inside that I have left and right vertical frames. The > left frame I want to contain an iconlist, and I want it take up most of > the space. The right frame will contain a basic list with some buttons > below it, and I only need it to be as wide as the widest item in the > list. So I want it to be fairly narrow. The following code makes the > right and left frames equal size, which scrunches the iconlist and gives > way too much room to the right-hand list. However, when I try to remove > the LAYOUT_FILL_X options from the right and left frames, the lists > occupy the opposite edges and are very narrow, leaving a huge gap of > nothing in the middle. > > I tried leaving the left frame set to LAYOUT_FILL_X and hard-coding the > width of the right frame, but it seems to completely ignore my size > settings and leave very little room for the right-hand frame. Any ideas? > > Thanks, > Carl > > Here is the code: > ---------------------------- > > contents = FXHorizontalFrame.new(self, > LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y, > 0, 0, 0, 0, 0, 0, 0, 0) > > leftframe = FXVerticalFrame.new(contents, > LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, > 0, 0, 0, 0, 0, 0, 0, 0) > FXLabel.new(leftpane, "Transactions", nil, LAYOUT_FILL_X) > > # Transaction view window > transframe = FXVerticalFrame.new(leftframe, > > FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_LEFT >, 0, 0, 0, 0, 0, 0, 0, 0) > > FXVerticalSeparator.new(contents, SEPARATOR_RIDGE|LAYOUT_FILL_Y) > > rightframe = FXVerticalFrame.new(contents, > LAYOUT_TOP|LAYOUT_RIGHT, > 0, 0, 150, 200, 0, 0, 0, 0) > FXLabel.new(rightframe, "Categories", nil, LAYOUT_FILL_X) > > catlistframe = FXVerticalFrame.new(rightframe, > FRAME_SUNKEN|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, > 0, 0, 0, 0, 0, 0, 0, 0) > > @catlist = FXList.new(catlistframe, 20, nil, 0, > LAYOUT_FILL_X|LAYOUT_FILL_Y|LIST_SINGLESELECT) > @catlist.appendItem("Text") > > @translist = FXIconList.new(transframe, nil, 0, > LAYOUT_FILL_X|LAYOUT_FILL_Y|ICONLIST_BROWSESELECT) > @translist.appendHeader("Date", nil, 75) > @translist.appendHeader("Check", nil, 50) > @translist.appendHeader("Amount", nil, 75) > @translist.appendHeader("Payee", nil, 250) > @translist.appendHeader("Category", nil, 150) > @translist.appendHeader("Result", nil, 150) -- "I've had a wonderful time, but this wasn't it." - Groucho Marx (1895-1977) |