Class: Fox::FXApp

Inherits:
FXObject show all
Defined in:
rdoc-sources/FXApp.rb,
lib/fox16/chore.rb,
lib/fox16/input.rb,
lib/fox16/signal.rb,
lib/fox16/thread.rb,
lib/fox16/timeout.rb,
lib/fox16/iterators.rb

Overview

Application Object

Events

The FXApp object itself doesn’t have a designated message target like other FOX objects, but it can send messages to objects for a few special events.

Timers

When a timeout event is registered with the application using the addTimeout method, a SEL_TIMEOUT message is sent to the message target.

Chores

When a chore event is registered with the application using the addChore method, a SEL_CHORE message is sent to the message target.

Inputs

When an input event is registered with the application using the addInput method, a SEL_IO_READ, SEL_IO_WRITE or SEL_IO_EXCEPT message may be sent to the message target.

Signals

When a signal handler object is registered with the application using the addSignal method, a SEL_SIGNAL message may be sent to the message target.

File input modes for #addInput

INPUT_NONE

inactive

INPUT_READ

read input fd

INPUT_WRITE

write input fd

INPUT_EXCEPT

except input fd

All ways of being modal

MODAL_FOR_NONE

Non modal event loop (dispatch normally)

MODAL_FOR_WINDOW

Modal dialog (beep if outside of modal dialog)

MODAL_FOR_POPUP

Modal for popup (always dispatch to popup)

Default cursors provided by the application

These constants symbolically represent the different cursor shapes used in FOX applications, and can be used as the which arguments for #getDefaultCursor and #setDefaultCursor.

DEF_ARROW_CURSOR

Arrow cursor

DEF_RARROW_CURSOR

Reverse arrow cursor

DEF_TEXT_CURSOR

Text cursor

DEF_HSPLIT_CURSOR

Horizontal split cursor

DEF_VSPLIT_CURSOR

Vertical split cursor

DEF_XSPLIT_CURSOR

Cross split cursor

DEF_SWATCH_CURSOR

Color swatch drag cursor

DEF_MOVE_CURSOR

Move cursor

DEF_DRAGH_CURSOR

Resize horizontal edge

DEF_DRAGV_CURSOR

Resize vertical edge

DEF_DRAGTL_CURSOR

Resize upper-leftcorner

DEF_DRAGBR_CURSOR

Resize bottom-right corner

DEF_DRAGTR_CURSOR

Resize upper-right corner

DEF_DRAGBL_CURSOR

Resize bottom-left corner

DEF_DNDSTOP_CURSOR

Drag and drop stop

DEF_DNDCOPY_CURSOR

Drag and drop copy

DEF_DNDMOVE_CURSOR

Drag and drop move

DEF_DNDLINK_CURSOR

Drag and drop link

DEF_CROSSHAIR_CURSOR

Cross hair cursor

DEF_CORNERNE_CURSOR

North-east cursor

DEF_CORNERNW_CURSOR

North-west cursor

DEF_CORNERSE_CURSOR

South-east cursor

DEF_CORNERSW_CURSOR

South-west cursor

DEF_HELP_CURSOR

Help arrow cursor

DEF_HAND_CURSOR

Hand cursor

DEF_ROTATE_CURSOR

Rotate cursor

DEF_WAIT_CURSOR

Wait cursor

Messages identifiers

ID_QUIT

Terminate the application normally

ID_DUMP

Dump the current widget tree

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(*args, &block) ⇒ FXApp

Construct application object; the appName and vendorName strings are used as keys into the registry database for this application’s settings. Only one single application object can be constructed.



283
284
# File 'rdoc-sources/FXApp.rb', line 283

def initialize(appName="Application", vendorName="FoxDefault") # :yields: theApp
end

Instance Attribute Details

#activeWindowObject (readonly)

The active top-level window, if any Fox::FXWindow



224
225
226
# File 'rdoc-sources/FXApp.rb', line 224

def activeWindow
  @activeWindow
end

#animSpeedObject

Animation speed, in milliseconds [Integer]



249
250
251
# File 'rdoc-sources/FXApp.rb', line 249

def animSpeed
  @animSpeed
end

#appNameObject (readonly)

Application name [String]



152
153
154
# File 'rdoc-sources/FXApp.rb', line 152

def appName
  @appName
end

#argcObject (readonly)

Argument count [Integer]



158
159
160
# File 'rdoc-sources/FXApp.rb', line 158

def argc
  @argc
end

#argvObject (readonly)

Argument vector [Array]



161
162
163
# File 'rdoc-sources/FXApp.rb', line 161

def argv
  @argv
end

#backColorObject

Default background color Fox::FXColor



179
180
181
# File 'rdoc-sources/FXApp.rb', line 179

def backColor
  @backColor
end

#baseColorObject

Background color of GUI controls Fox::FXColor



170
171
172
# File 'rdoc-sources/FXApp.rb', line 170

def baseColor
  @baseColor
end

#blinkSpeedObject

Blink speed, in milliseconds [Integer]



246
247
248
# File 'rdoc-sources/FXApp.rb', line 246

def blinkSpeed
  @blinkSpeed
end

#borderColorObject

Border color Fox::FXColor



167
168
169
# File 'rdoc-sources/FXApp.rb', line 167

def borderColor
  @borderColor
end

#clickSpeedObject

Click speed, in milliseconds [Integer]



237
238
239
# File 'rdoc-sources/FXApp.rb', line 237

def clickSpeed
  @clickSpeed
end

#cursorWindowObject (readonly)

The window under the cursor, if any Fox::FXWindow



218
219
220
# File 'rdoc-sources/FXApp.rb', line 218

def cursorWindow
  @cursorWindow
end

#defaultVisualObject

Default visual Fox::FXVisual



203
204
205
# File 'rdoc-sources/FXApp.rb', line 203

def defaultVisual
  @defaultVisual
end

#displayObject (readonly)

Display [Integer]



164
165
166
# File 'rdoc-sources/FXApp.rb', line 164

def display
  @display
end

#dragDeltaObject

Drag delta, in pixels [Integer]



261
262
263
# File 'rdoc-sources/FXApp.rb', line 261

def dragDelta
  @dragDelta
end

#focusWindowObject (readonly)

The window at the end of the focus chain, if any Fox::FXWindow



221
222
223
# File 'rdoc-sources/FXApp.rb', line 221

def focusWindow
  @focusWindow
end

#foreColorObject

Default foreground color Fox::FXColor



182
183
184
# File 'rdoc-sources/FXApp.rb', line 182

def foreColor
  @foreColor
end

#hiliteColorObject

Hilite color of GUI controls Fox::FXColor



173
174
175
# File 'rdoc-sources/FXApp.rb', line 173

def hiliteColor
  @hiliteColor
end

Menu pause, in milliseconds [Integer]



252
253
254
# File 'rdoc-sources/FXApp.rb', line 252

def menuPause
  @menuPause
end

#modalModalityObject (readonly)

Mode of current modal loop [Integer]



230
231
232
# File 'rdoc-sources/FXApp.rb', line 230

def modalModality
  @modalModality
end

The window of the current modal loop Fox::FXWindow



227
228
229
# File 'rdoc-sources/FXApp.rb', line 227

def modalWindow
  @modalWindow
end

#monoVisualObject (readonly)

Monochrome visual Fox::FXVisual



212
213
214
# File 'rdoc-sources/FXApp.rb', line 212

def monoVisual
  @monoVisual
end

#normalFontObject

Default font Fox::FXFont



206
207
208
# File 'rdoc-sources/FXApp.rb', line 206

def normalFont
  @normalFont
end

#rootWindowObject (readonly)

Root window Fox::FXRootWindow



215
216
217
# File 'rdoc-sources/FXApp.rb', line 215

def rootWindow
  @rootWindow
end

#scrollBarSizeObject

Scroll bar size [Integer]



267
268
269
# File 'rdoc-sources/FXApp.rb', line 267

def scrollBarSize
  @scrollBarSize
end

#scrollDelayObject

Scroll delay time, in milliseconds [Integer]



243
244
245
# File 'rdoc-sources/FXApp.rb', line 243

def scrollDelay
  @scrollDelay
end

#scrollSpeedObject

Scroll speed, in milliseconds [Integer]



240
241
242
# File 'rdoc-sources/FXApp.rb', line 240

def scrollSpeed
  @scrollSpeed
end

#selbackColorObject

Default background color for selected objects Fox::FXColor



188
189
190
# File 'rdoc-sources/FXApp.rb', line 188

def selbackColor
  @selbackColor
end

#selforeColorObject

Default foreground color for selected objects Fox::FXColor



185
186
187
# File 'rdoc-sources/FXApp.rb', line 185

def selforeColor
  @selforeColor
end

#selMenuBackColorObject

Default background color for selected menu items Fox::FXColor



200
201
202
# File 'rdoc-sources/FXApp.rb', line 200

def selMenuBackColor
  @selMenuBackColor
end

#selMenuTextColorObject

Default text color for selected menu items Fox::FXColor



197
198
199
# File 'rdoc-sources/FXApp.rb', line 197

def selMenuTextColor
  @selMenuTextColor
end

#shadowColorObject

Shadow color of GUI controls Fox::FXColor



176
177
178
# File 'rdoc-sources/FXApp.rb', line 176

def shadowColor
  @shadowColor
end

#sleepTimeObject

Amount of time (in milliseconds) to yield to Ruby’s thread scheduler [Integer]



270
271
272
# File 'rdoc-sources/FXApp.rb', line 270

def sleepTime
  @sleepTime
end

#tipbackColorObject

Default background color for tooltips Fox::FXColor



194
195
196
# File 'rdoc-sources/FXApp.rb', line 194

def tipbackColor
  @tipbackColor
end

#tipforeColorObject

Default foreground color for tooltips Fox::FXColor



191
192
193
# File 'rdoc-sources/FXApp.rb', line 191

def tipforeColor
  @tipforeColor
end

#tooltipPauseObject

Tooltip pause, in milliseconds [Integer]



255
256
257
# File 'rdoc-sources/FXApp.rb', line 255

def tooltipPause
  @tooltipPause
end

#tooltipTimeObject

Tooltip time, in milliseconds [Integer]



258
259
260
# File 'rdoc-sources/FXApp.rb', line 258

def tooltipTime
  @tooltipTime
end

#translatorObject

Message translator Fox::FXTranslator



273
274
275
# File 'rdoc-sources/FXApp.rb', line 273

def translator
  @translator
end

#typingSpeedObject

Typing speed used for the FXIconList, FXList and FXTreeList widgets’ lookup features, in milliseconds. Default value is 1000 milliseconds.



234
235
236
# File 'rdoc-sources/FXApp.rb', line 234

def typingSpeed
  @typingSpeed
end

#vendorNameObject (readonly)

Vendor name [String]



155
156
157
# File 'rdoc-sources/FXApp.rb', line 155

def vendorName
  @vendorName
end

#waitCursorObject

Wait cursor Fox::FXCursor



209
210
211
# File 'rdoc-sources/FXApp.rb', line 209

def waitCursor
  @waitCursor
end

#wheelLinesObject

Number of wheel lines [Integer]



264
265
266
# File 'rdoc-sources/FXApp.rb', line 264

def wheelLines
  @wheelLines
end

Class Method Details

Copyright notice for library



276
# File 'rdoc-sources/FXApp.rb', line 276

def FXApp.copyright() ; end

.instanceObject

Return application instance



463
# File 'rdoc-sources/FXApp.rb', line 463

def FXApp.instance(); end

Instance Method Details

#addChore(*args, &block) ⇒ Object

Add a idle processing message to be sent to a target object when the system becomes idle, i.e. when there are no more events to be processed. There are several forms for #addChore; the original form (from FOX) takes two arguments, a target object and a message identifier:

app.addChore(tgt, sel)

If a chore with the same target and message already exists, it will be rescheduled.

A second form takes a Method instance as its single argument:

app.addChore(mthd)

For this form, the method should have the standard argument list for a FOX message handler. That is, the method should take three arguments, for the message sender (an FXObject), the message selector, and the message data (if any).

The last form takes a block:

app.addChore() do |sender, sel, data|
    ... handle the chore ...
end

All of these return a reference to an opaque FXChore instance that can be passed to #removeChore if it is necessary to remove the chore before it fires.

For the last two forms, you can pass in the optional :repeat parameter to cause the chore to be re-registered after it fires, e.g.

chore = app.addChore(:repeat => true) do |sender, sel, data|
    ... handle the chore ...
    ... re-add the chore ...
end


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fox16/chore.rb', line 46

def addChore(*args, &block)
  params = {}
  params = args.pop if args.last.is_a? Hash
  tgt, sel = nil, 0
  if args.length > 0
    if args[0].respond_to? :call
      tgt = params[:target] || FXPseudoTarget.new
      tgt.pconnect(SEL_CHORE, args[0], params)
    else
      tgt, sel = args[0], args[1]
    end
  else
    tgt = params[:target] || FXPseudoTarget.new
    tgt.pconnect(SEL_CHORE, block, params)
  end
  addChoreOrig(tgt, sel)
  params[:target] = tgt
  params[:selector] = sel
  params
end

#addChoreOrigObject

:nodoc:



5
# File 'lib/fox16/chore.rb', line 5

alias addChoreOrig		addChore

#addInput(io, mode, *args, &block) ⇒ Object

Add an IO object as io to be watched for activity as determined by mode, where mode is a bitwise OR (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT). A message of type SEL_IO_READ, SEL_IO_WRITE, or SEL_IO_EXCEPT will be sent to the target when the specified activity is detected on the file descriptor.

On POSIX operating systems all kinds of file descriptors can be watched. It works for Socket.new, IO.popen, IO.pipe, IO.for_fd, File.open, etc. Windows provides level triggered events only for network sockets. So on Windows only socket IO objects like TCPSocket.new and TCPServer.new are currently supported to be watched.

There are several forms for #addInput; the original form (from FOX) takes four arguments:

anApp.addInput(fileDesc, mode, anObject, aMessageId)

A second form takes three arguments:

anApp.addInput(fileDesc, mode, aMethod)

For this form, aMethod should have the standard argument list for a FOX message handler. That is, the method should take three arguments, for the message sender (an FXObject), the message selector, and the message data (if any).

The last form of #addInput takes a block:

anApp.addInput(fileDesc, mode) { |sender, sel, data|
  ... handle the I/O event ...
}


36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fox16/input.rb', line 36

def addInput(io, mode, *args, &block)
  params = {}
  params = args.pop if args.last.is_a? Hash
  tgt, sel = nil, 0
  if args.length > 0
    if args[0].respond_to? :call
      tgt = FXPseudoTarget.new
      tgt.pconnect(SEL_IO_READ, args[0], params)
      tgt.pconnect(SEL_IO_WRITE, args[0], params)
      tgt.pconnect(SEL_IO_EXCEPT, args[0], params)
    else # it's some other kind of object
      tgt = args[0]
      sel = args[1]
    end
  else
    tgt = FXPseudoTarget.new
    tgt.pconnect(SEL_IO_READ, block, params)
    tgt.pconnect(SEL_IO_WRITE, block, params)
    tgt.pconnect(SEL_IO_EXCEPT, block, params)
  end
  addInputOrig(io, mode, tgt, sel)
end

#addInputOrigObject

:nodoc:



5
# File 'lib/fox16/input.rb', line 5

alias addInputOrig addInput

#addSignal(sig, *args, &block) ⇒ Object

Register a signal processing message to be sent to target object when the specified signal is raised.

There are several forms for #addSignal; the original form (from FOX) takes (up to) five arguments:

anApp.addSignal(aSignal, anObject, aMessageId, sendImmediately=false, flags=0)

Here, aSignal is a string indicating the operating system signal of interest (such as “SIGINT”). The second and third arguments are the target object and message identifier for the message to be sent when this signal is raised. If sendImmediately is true, the message will be sent to the target right away; this should be used with extreme care as the application is interrupted at an unknown point in its execution. The flags are to be set as per POSIX definitions.

A second form of #addSignal takes a Method instance as its second argument:

anApp.addSignal(aSignal, aMethod, sendImmediately=false, flags=0)

For this form, the method should have the standard argument list for a FOX message handler. That is, the method should take three arguments, for the message sender (an FXObject), the message selector, and the message data (if any).

The last form of #addSignal takes a block:

anApp.addSignal(aSignal, sendImmediately=false, flags=0) { |sender, sel, data|
  ... handle the signal ...
}


312
# File 'rdoc-sources/FXApp.rb', line 312

def addSignal(sig, tgt, sel, immediate=false, flags=0) ; end

#addSignalOrigObject

Add signal processing message to be sent to target object when the signal sig is raised; flags are to be set as per POSIX definitions. When immediate is true, the message will be sent to the target right away; this should be used with extreme care as the application is interrupted at an unknown point in its execution. :nodoc:



5
# File 'lib/fox16/signal.rb', line 5

def addSignal(sig, tgt, sel, immediate=false, flags=0) ; end

#addTimeout(ms, *args, &block) ⇒ Object

Add a timeout message to be sent to target object in ms milliseconds. By default, the timer fires only once after the interval expires. The last argument is optional user data which will be passed along as the ptr argument of the message handler. If a timer with the same target and message already exists, it will be rescheduled.

There are several forms for #addTimeout; the original form (from FOX) takes three arguments:

timeout = app.addTimeout(delay, tgt, sel)

Here, delay is the time interval (in milliseconds) to wait before firing this timeout. The second and third arguments are the target object and message identifier for the message to be sent when this timeout fires.

A second form of #addTimeout takes a Method instance as its single argument:

timeout = app.addTimeout(delay, mthd)

For this form, the method should have the standard argument list for a FOX message handler. That is, the method should take three arguments, for the message sender (an FXObject), the message selector, and the message data (if any).

The last form of #addTimeout takes a block:

timeout = app.addTimeout(delay) do |sender, sel, data|
    ... handle the timeout ...
end

All of these return a reference to an opaque object (actually, a hash) that can be passed to #removeTimeout if it is necessary to remove the timeout before it fires.

For the last two forms, you can pass in the optional :repeat parameter to cause the timeout to be re-registered after it fires, e.g.

timeout = app.addTimeout(delay, :repeat => true) do |sender, sel, data|
    ... handle the timeout ...
    ... re-add the timeout with the same delay ...
end


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/fox16/timeout.rb', line 54

def addTimeout(ms, *args, &block)
  params = {}
  params = args.pop if args.last.is_a? Hash
  params[:delay] = ms
  tgt, sel = nil, 0
  if args.length > 0
    if args[0].respond_to? :call
      tgt = params[:target] || FXPseudoTarget.new
      tgt.pconnect(SEL_TIMEOUT, args[0], params)
    else # it's some other kind of object
      tgt = args[0]
      sel = args[1]
    end
  else
    tgt = params[:target] || FXPseudoTarget.new
    tgt.pconnect(SEL_TIMEOUT, block, params)
  end
  addTimeoutOrig(tgt, sel, ms)
  params[:target] = tgt
  params[:selector] = sel
  params
end

#addTimeoutOrigObject

:nodoc:



5
# File 'lib/fox16/timeout.rb', line 5

alias addTimeoutOrig	addTimeout

#beepObject

Beep



460
# File 'rdoc-sources/FXApp.rb', line 460

def beep(); end

#beginWaitCursorObject

Changes the default application cursor to an hourglass shape, to provide a visual cue to the user that it’s time to wait. To revert the default application cursor to its normal shape, call the #endWaitCursor method. For example,

getApp().beginWaitCursor()
  ... time-consuming operation ...
getApp().endWaitCursor()

Invocations of #beginWaitCursor may be nested, and if so, the call to #endWaitCursor is matched with the most recent call to #beginWaitCursor.

If an optional code block is provided, #endWaitCursor is automatically called after the block terminates, e.g.

getApp().beginWaitCursor() {
          ... time-consuming operation ...
  ... endWaitCursor() is called automatically ...
}


366
367
368
369
370
371
372
373
374
375
# File 'lib/fox16/iterators.rb', line 366

def beginWaitCursor
  beginWaitCursor0
  if block_given?
    begin
  	  yield
  	ensure
  	  endWaitCursor
  	end
  end
end

#beginWaitCursor0Object

:nodoc:



342
# File 'lib/fox16/iterators.rb', line 342

alias beginWaitCursor0 beginWaitCursor

#closeDisplayObject

Close connection to the display



292
# File 'rdoc-sources/FXApp.rb', line 292

def closeDisplay() ; end

#createObject

Create application’s windows



326
# File 'rdoc-sources/FXApp.rb', line 326

def create() ; end

#destroyObject

Destroy application’s windows



329
# File 'rdoc-sources/FXApp.rb', line 329

def destroy() ; end

#detachObject

Detach application’s windows



332
# File 'rdoc-sources/FXApp.rb', line 332

def detach() ; end

#disableThreadsObject

Disable support for multithreaded applications



537
# File 'rdoc-sources/FXApp.rb', line 537

def disableThreads(); end

#dumpWidgetsObject

Dump widget information



528
# File 'rdoc-sources/FXApp.rb', line 528

def dumpWidgets() ; end

#enableThreadsObject

Enable support for multithreaded applications



534
# File 'rdoc-sources/FXApp.rb', line 534

def enableThreads(); end

#endWaitCursorObject

End the most deeply nested wait-cursor block. See also #beginWaitCursor.



467
# File 'rdoc-sources/FXApp.rb', line 467

def endWaitCursor(); end

#exit(code = 0) ⇒ Object

Exit application. Closes the display and writes the registry.



437
# File 'rdoc-sources/FXApp.rb', line 437

def exit(code=0); end

#flush(sync = false) ⇒ Object

Flush pending repaints



416
# File 'rdoc-sources/FXApp.rb', line 416

def flush(sync=false); end

#forceRefreshObject

Force GUI refresh



410
# File 'rdoc-sources/FXApp.rb', line 410

def forceRefresh(); end

#getDefaultCursor(which) ⇒ Object

Return a reference to one of the default application cursors (an FXCursor instance), where which is one of the default cursor identifiers listed above, e.g.

rotateCursor = app.getDefaultCursor(DEF_ROTATE_CURSOR)

See also #setDefaultCursor.



478
# File 'rdoc-sources/FXApp.rb', line 478

def getDefaultCursor(which) ; end

#getDragTypeName(dragType) ⇒ Object

Return the name of a previously registered drag type, e.g.

dragTypeName = app.getDragTypeName(yamlDragType)

See also #registerDragType.



457
# File 'rdoc-sources/FXApp.rb', line 457

def getDragTypeName(dragType) ; end

#getKeyState(keysym) ⇒ Object

Return key state (either true or false) for keysym.



337
# File 'rdoc-sources/FXApp.rb', line 337

def getKeyState(keysym); end

#handleTimeoutsObject

Process any timeouts due at this time.



303
# File 'rdoc-sources/FXApp.rb', line 303

def handleTimeouts(); end

#hasChore?(*args) ⇒ Boolean

Return true if given chore has been set, otherwise return false.

For example, you might set up a chore at some point in the execution:

chore = app.addChore { ... }

but decide that you want to “cancel” that chore later (before it’s had a chance to run):

if app.hasChore?(chore)
  app.removeChore(chore)
end

Returns:

  • (Boolean)


94
95
96
97
98
99
100
101
# File 'lib/fox16/chore.rb', line 94

def hasChore?(*args)
  if args.length == 2
    hasChoreOrig?(args[0], args[1])
  else
    hsh = args[0]
    hasChoreOrig?(hsh[:target], hsh[:selector])
  end
end

#hasChoreOrig?Object

:nodoc:



7
# File 'lib/fox16/chore.rb', line 7

alias hasChoreOrig?		hasChore?

#hasInputMethod?Boolean

Return true if input methods are supported.

Returns:

  • (Boolean)


298
# File 'rdoc-sources/FXApp.rb', line 298

def hasInputMethod?; end

#hasTimeout?(*args) ⇒ Boolean

Return true if given timeout has been set, otherwise return false.

For example, suppose you set up a timeout event to run ten seconds from now:

timeout = app.addTimeout(10*1000, ...)

but in the meantime, you decide that you want to cancel it if it hasn’t run yet:

if app.hasTimeout?(timeout)
  app.removeTimeout(timeout)
end

Returns:

  • (Boolean)


106
107
108
109
110
111
112
113
# File 'lib/fox16/timeout.rb', line 106

def hasTimeout?(*args)
  if args.length == 2
    hasTimeoutOrig?(args[0], args[1])
  else
    hsh = args[0]
    hasTimeoutOrig?(hsh[:target], hsh[:selector])
  end
end

#hasTimeoutOrig?Object

:nodoc:



7
# File 'lib/fox16/timeout.rb', line 7

alias hasTimeoutOrig?	hasTimeout?

#init(argv, connect = true) ⇒ Object

Initialize application. Parses and removes common command line arguments, reads the registry. Finally, if connect is true, it opens the display.



433
# File 'rdoc-sources/FXApp.rb', line 433

def init(argv, connect=true) ; end

#initialize_before_threadFXApp

Construct application object; the appName and vendorName strings are used as keys into the registry database for this application’s settings. Only one single application object can be constructed. :nodoc:

Returns:

  • (FXApp)

    a new instance of FXApp



7
8
# File 'lib/fox16/thread.rb', line 7

def initialize(appName="Application", vendorName="FoxDefault") # :yields: theApp
end

#initialized?Boolean

Return true if the application has been initialized.

Returns:

  • (Boolean)


295
# File 'rdoc-sources/FXApp.rb', line 295

def initialized?; end

#modal?(window) ⇒ Boolean

Returns true if the window is modal

Returns:

  • (Boolean)


391
# File 'rdoc-sources/FXApp.rb', line 391

def modal?(window) ; end

#mutexObject

Return a reference to the application-wide mutex (an FXMutex instance). Normally, the main user interface thread holds this mutex, insuring that no other threads are modifying data during the processing of user interface messages. However, whenever the main user interface thread blocks for messages, it releases this mutex, to allow other threads to modify the same data. When a new message becomes available, the main user interface thread regains the mutex prior to dispatching the message. Other threads should hold this mutex only for short durations, so as to not starve the main user interface thread.



525
# File 'rdoc-sources/FXApp.rb', line 525

def mutex(); end

#openDisplay(dpyname = nil) ⇒ Object

Open connection to display; this is called by #init.



289
# File 'rdoc-sources/FXApp.rb', line 289

def openDisplay(dpyname=nil) ; end

#peekEventObject

Peek to determine if there’s an event.



342
# File 'rdoc-sources/FXApp.rb', line 342

def peekEvent(); end

#readWindow(store, father, owner) ⇒ Object

Read a window and its children from the stream store, and append it under father; note it is initially not created yet. Return a reference to the new window.

Parameters:

store

Fox::FXStream

father

Fox::FXWindow

owner

Fox::FXWindow



511
# File 'rdoc-sources/FXApp.rb', line 511

def readWindow(store, father, owner); end

#refreshObject

Schedule a refresh



413
# File 'rdoc-sources/FXApp.rb', line 413

def refresh(); end

#regObject

Return a reference to the registry (an FXRegistry instance). The registry keeps settings and configuration information for an application, which are automatically loaded when the application starts up, and saved when the application terminates.



428
# File 'rdoc-sources/FXApp.rb', line 428

def reg; end

#registerDragType(name) ⇒ Object

Register a drag type with the given name and return the drag drag type. If this drag type has already been registered, this method will return the previously returned drag type. For example,

yamlDragType = app.registerDragType("application/x-yaml")

See also #getDragTypeName.



448
# File 'rdoc-sources/FXApp.rb', line 448

def registerDragType(name) ; end

#remainingTimeout(*args) ⇒ Object

Return the time remaining (in milliseconds) until the given timer fires. If the timer is past due, zero is returned. If there is no such timer, infinity (UINT_MAX) is returned.

For example:

timeout = app.addTimeout(ms, ...)
time_left = app.remainingTimeout(timeout)


125
126
127
128
129
130
131
132
# File 'lib/fox16/timeout.rb', line 125

def remainingTimeout(*args)
  if args.length == 2
    remainingTimeoutOrig(args[0], args[1])
  else
    hsh = args[0]
    remainingTimeoutOrig(hsh[:target], hsh[:selector])
  end
end

#remainingTimeoutOrigObject

:nodoc:



8
# File 'lib/fox16/timeout.rb', line 8

alias remainingTimeoutOrig	remainingTimeout

#removeChore(*args) ⇒ Object

Remove idle processing message identified by tgt and sel. See the documentation for #hasChore? for an example of how to use the #removeChore method.



72
73
74
75
76
77
78
79
# File 'lib/fox16/chore.rb', line 72

def removeChore(*args)
  if args.length == 2
    removeChoreOrig(args[0], args[1])
  else
    params = args[0]
    removeChoreOrig(params[:target], params[:selector])
  end
end

#removeChoreOrigObject

:nodoc:



6
# File 'lib/fox16/chore.rb', line 6

alias removeChoreOrig	removeChore

#removeInput(fd, mode) ⇒ Object

Remove input message and target object for the specified file descriptor and mode, which is a bitwise OR of (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).



323
# File 'rdoc-sources/FXApp.rb', line 323

def removeInput(fd, mode) ; end

#removeSignal(sig) ⇒ Object

Remove signal message for signal sig.



317
# File 'rdoc-sources/FXApp.rb', line 317

def removeSignal(sig) ; end

#removeTimeout(*args) ⇒ Object

Remove timeout previously registered using #addTimeout; returns nil. For an example of how to use #removeTimeout, see the documentation for the #hasTimeout? method.



82
83
84
85
86
87
88
89
# File 'lib/fox16/timeout.rb', line 82

def removeTimeout(*args)
  if args.length == 2
    removeTimeoutOrig(args[0], args[1])
  else
    params = args[0]
    removeTimeoutOrig(params[:target], params[:selector])
  end
end

#removeTimeoutOrigObject

:nodoc:



6
# File 'lib/fox16/timeout.rb', line 6

alias removeTimeoutOrig	removeTimeout

#repaintObject

Paint all windows marked for repainting. On return all the applications windows have been painted.



420
# File 'rdoc-sources/FXApp.rb', line 420

def repaint(); end

#runObject

Run the main application event loop until #stop is called, and return the exit code passed as argument to #stop.



349
# File 'rdoc-sources/FXApp.rb', line 349

def run(); end

#runModalObject

Run modal event loop, blocking keyboard and mouse events to all windows until #stopModal is called.



374
# File 'rdoc-sources/FXApp.rb', line 374

def runModal(); end

#runModalFor(window) ⇒ Object

Run a modal event loop for the given window, until #stop or #stopModal is called. Except for the modal window and its children, user input to all windows is blocked; if the modal window is nil all user input is blocked.



379
# File 'rdoc-sources/FXApp.rb', line 379

def runModalFor(window); end

#runModalWhileEvents(window = nil) ⇒ Object

Run event loop while there are events are available in the queue. Returns 1 when all events in the queue have been handled, and 0 when the event loop was terminated due to #stop or #stopModal. Except for the modal window and its children, user input to all windows is blocked; if the modal window is nil, all user input is blocked.



370
# File 'rdoc-sources/FXApp.rb', line 370

def runModalWhileEvents(window=nil); end

#runModalWhileShown(window) ⇒ Object

Run modal while window is shown, or until #stop or #stopModal is called. Except for the modal window and its children, user input to all windows is blocked; if the modal window is nil all user input is blocked.



384
# File 'rdoc-sources/FXApp.rb', line 384

def runModalWhileShown(window); end

#runOneEvent(blocking = true) ⇒ Object

Perform one event dispatch; return true if event was dispatched.



345
# File 'rdoc-sources/FXApp.rb', line 345

def runOneEvent(blocking=true); end

#runOnUiThread(&block) ⇒ Object

Runs the specified block on the UI thread.

The block is posted to the event queue of the UI thread.



545
# File 'rdoc-sources/FXApp.rb', line 545

def runOnUiThread(&block); end

#runPopup(window) ⇒ Object

Run popup menu while shown, until #stop or #stopModal is called. Also returns when entering previous cascading popup menu.



388
# File 'rdoc-sources/FXApp.rb', line 388

def runPopup(window); end

#runUntil(condition) ⇒ Object

Run an event loop till some flag becomes non-zero, and then return.



355
# File 'rdoc-sources/FXApp.rb', line 355

def runUntil(condition); end

#runWhileEventsObject

Run event loop while events are available, non-modally. Return when no more events, timers, or chores are outstanding.



361
# File 'rdoc-sources/FXApp.rb', line 361

def runWhileEvents(); end

#setDefaultCursor(which, cursor) ⇒ Object

Replace one of the default application cursors with cursor; e.g

app.setDefaultCursor(DEF_ROTATE_CURSOR, myRotateCursor)

See also #getDefaultCursor.



487
# File 'rdoc-sources/FXApp.rb', line 487

def setDefaultCursor(which, cursor); end

#stop(value = 0) ⇒ Object

Terminate the outermost event loop, and all inner modal loops; All more deeper nested event loops will be terminated with code equal to 0, while the outermost event loop will return code equal to value.



396
# File 'rdoc-sources/FXApp.rb', line 396

def stop(value=0); end

#stopModal(value = 0) ⇒ Object

Break out of the innermost modal loop, returning code equal to value.



402
# File 'rdoc-sources/FXApp.rb', line 402

def stopModal(window, value=0); end

#threadsEnabled?Boolean

Check to see if multithreaded applications are supported

Returns:

  • (Boolean)


540
# File 'rdoc-sources/FXApp.rb', line 540

def threadsEnabled?(); end

#windowCountObject

Return the number of existing windows.



531
# File 'rdoc-sources/FXApp.rb', line 531

def windowCount; end

#writeWindow(store, window) ⇒ Object

Write a window and its children, and all resources reachable from this window, into the stream store (an FXStream instance).

Parameters:

store

Fox::FXStream

window

Fox::FXWindow



498
# File 'rdoc-sources/FXApp.rb', line 498

def writeWindow(store, window); end