•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Ruby section within the Web Development category of DaniWeb, a massive community of 332,788 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,972 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Ruby advertiser: SELL YOUR PRODUCT TODAY !
Okay, this introduces two new things into the widget. The first thing you need is a picture file (.jpg, .png, .bmp etc...). The new code makes the picture into the button with the text "Hello, World" on the side. In the parentheses next to File.open you would put the file name with its appropriate extension. On the next line you would say FX"filetype"Icon. This code snippet also includes another part called tipText. When you go ontot the button with the mouse it will say "exit". I saved the file I was using with the .rb file (I don't know if it has any effect on the program, you can try and post it in the coments if it does have any effect).
require 'fox' include Fox theApp = FXApp.new theMainWindow = FXMainWindow.new(theApp, "Hello, World") theButton = FXButton.new(theMainWindow, "Hello, World") theButton.tipText = "Exit!" iconFile = File.open("hwrb.png", "rb") theButton.icon = FXPNGIcon.new(theApp, iconFile.read) iconFile.close theButton.connect(SEL_COMMAND) {exit} FXTooltip.new(theApp) theApp.create theMainWindow.show theApp.run
Comments (Newest First)
bumsfeld | Practically a Posting Shark | Aug 6th, 2005
•
•
•
•
Right from the example code! Come on, you can do better!
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)