[fxruby-users] Help widget: suggestion?

DeZonia, Barry bdezonia at wisc.edu
Mon Jan 10 12:10:12 EST 2005

I've made a very simple (and Spartan) help dialog using the following code:

  # sentences : an array of strings
  def displayHelp(sentences)
    w = 600
    h = 400
    centerX = self.x + (self.width/2)
    centerY = self.y + (self.height/2)
    originX = centerX-(w/2)
    originY = centerY-(h/2)
    dialog = FXDialogBox.new(@app,"Help",DECOR_ALL,originX,originY,w,h)
    #dialog.icon = @miniIcon
    outFrame = FXVerticalFrame.new(dialog,LAYOUT_FILL_X|LAYOUT_FILL_Y)
    topFrame = FXHorizontalFrame.new(outFrame,LAYOUT_FILL_X|LAYOUT_FILL_Y)
    bottomFrame = FXHorizontalFrame.new(outFrame,LAYOUT_CENTER_X)
    #list = FXList.new(topFrame,15,nil,0,LAYOUT_FILL_X)
    list = FXList.new(topFrame,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y)
    list.font = FXFont.new(@app, "helvetica", 10, FONTWEIGHT_DEMIBOLD)
    button= FXButton.new(bottomFrame,"OK",nil,dialog,FXDialogBox::ID_ACCEPT)
    sentences.each { | sentence | list.appendItem(sentence) }

-----Original Message-----
From: fxruby-users-bounces at rubyforge.org
[mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Riccardo
Sent: Monday, January 10, 2005 9:32 AM
To: fxruby-users at rubyforge.org
Subject: [fxruby-users] Help widget: suggestion?

Dear all FXRuby users

I'm writing to ask for a suggestion; I need to display some documentation  
in my FXRuby application for the user, nothing particularly complicate ..  
till now my solution was to generate HTML pages and than, from the GUI, to  
start a browser to load that HTML pages .. on windows this is quite easy  
('start doc\\index.html' or something like this), while on Linux I've  
found around some code (in the FOX community page) to guess the browser  
installed (Mozilla, Firefox, whatever) .. now, althought this is working,  
I'm wondering if I really need to start an external application for my  
user help .. I've seen in the examples of FXruby (the texteditor) that  
help is shown as a simple dialog with text inside .. just wondering is  
someone has worked on this and end up with some nice widgets and/or  
suggestions ..

Thanks to all, Riccardo :)

Riccardo Giannitrapani
Dipartimento di Fisica - Room L1-14-BE
Universita` di Udine - Via delle Scienze, 206  Udine (Italy)
Tel (Office): +39-0432-558209
Home Page: http://www.fisica.uniud.it/~riccardo
ICQ# 86590904
fxruby-users mailing list
fxruby-users at rubyforge.org

More information about the fxruby-users mailing list