Rebol runtime window control create and update - ide

In the video : REBOL VID demonstration - Nenad Rakocevic demonstrates what seems the basic code to compose a Rebol IDE at runtime.
Can someone provide a working Rebol example on how to create, update / modify faces (widget / control) within a View (window) at runtime.
So far the examples I found allow creating faces into a new window rather than update an existing one.
Thanks

The secret is to use "show" after changing what you want to change. And experiment a lot. There are nice scripts on rebol.org that use VID.
If you meant the interactive nature of the demo, that is (23.34) only 30 lines of 'cod'. I have tried to find that 'cod' but could not find it.
Good luck!
Arnold

Terse example on how to update a face :
rebol[]
view layout [
bx: box teal
btn "ShowTime" [
bx/text: now/time
bx/color: random white
show bx
]
]

Related

Documentation for Xcode Source Editor Extension

I'm looking for some documentation of the new Xcode Source Editor Extensions in Xcode 8.
As far as I can see there is only the "documentation" found in the header file for XcodeKit. Would be great to get something that's more detailed and more official.
Very preliminary XcodeKit reference documentation is now available.
Our WWDC 2016 presentation introducing Xcode Source Editor Extensions remains the best walkthrough.
The very shortest version, however, is: Because App Extensions need to be embedded in an application, you need to first create a new macOS Cocoa Application, and then add a new Xcode Source Editor Extension to that application. Then the XcodeKit reference should help some in implementing that.
Not really a documentation but a good reference also
https://developer.apple.com/videos/play/wwdc2016/414/
Extensions, at the moment, are poorly documented. There are a lot of assumptions made (for example, did you know that you can execute the container app? Yup, it’s really nice for settings GUI - see this How To Execute Container App - Second Answer)
At the moment, there are a lot of things missing: for example, there isn’t a structure that shows the corresponding lines with the data object - though this is quickly created with the following code:
var matches: [NSTextCheckingResult] = []
do {
let regex = try NSRegularExpression(pattern: "\n", options: [])
matches = regex.matches(in: completeBuffer,
options: [],
range: NSMakeRange(0, completeBuffer.count))
}
catch {
}
This gives you the location of all the \n’s - you should be able to fill out the rest to give you starting and ending positions which should match up to the lines.
All in all, there is a lot to like about the extension, but there are quite a few things missing as well.
Currently the only available documentation is in the headers; there's nothing "unofficial" about them. If you have specific questions, please ask.

CreateJs Range slider function

Trying to create a range slider
similar to:
http://foundation.zurb.com/docs/components/range_slider.html
it has to follow the mouse, so no onclick
and needs to output values between 0 (left side)
to 100 (right side) does anyone know the best way to go about this?
thanks
The EaselJS download actually includes a simple slider that is used by some of the examples. You could likely use that as a starting point and build on top of it.
https://github.com/CreateJS/EaselJS/blob/master/_assets/js/Slider.js
The Transform.html and Filters_input.html samples in the examples directory use it if you'd like to see it in action.
http://www.createjs.com/demos/easeljs/transform

How can I add an item in the World-menu of Pharo 4.0?

How can I add a new item - Workspace openLabel: 'Workspace' - to the World-menu of Pharo 4.0 ? (What can I say... I prefer Workspace over the new what's-it-called. :-)
I've looked at several menu-related items in the Browser, but couldn't really make head or tails of it. I also tried to find where the menu is stored (it must be somewhere, right?), but couldn't find it.
Also, how would I go about to add it to one of the existing sub-menues of World-menu, and how could I create a new sub-menu (in the World-menu) and add it there?
Add the following class method to any class you like. Best to make one especially for this purpose and load it to your new images:
WorkspaceWorldMenuItem class>>menuCommandOn: aBuilder
menuCommandOn: aBuilder
<worldMenu>
(aBuilder item: #'Workspace')
order: 0.1;
label: 'Workspace';
action: [ Workspace open ]
The interesting part is the <worldMenu> pragma. You usually put it directly after the selector (and comment) and before any other element in the method.
To have a look at example usage open Finder, choose the Pragmas mode and search for worldMenu (without the angle brackets).

How do you use modify the color definitions for a Google Calendar to allow custom colors for events?

I'm using the Google Calendar API to create new events. It appears the only method to assign a color to an event is with a colorID (1 to 11) that looks up the specific color from the table.
The default 11 color palette isn't exactly ideal for my needs so I would like to change it but I haven't been able to figure out how. The documentation explains how to obtain these lookup tables and but I can't figure out how to modify them. I assume they can be modified as there is a timestamp in the structure for the last time it was modified.
Anybody know how to modify the colorID table for events?
I know this thread is old, but the answer to the question is that you can't edit the set Event colors. The new custom colors in the new API only correlate with the Calendar color itself, not the Events contained within.
Why Google would only make some of the colors customizable, and not all beats me. Until they realize the desire for more colors it would appear we are stuck with good ol' 1-11.
Added detail from bounty:
I have the same question. I would like to be able to set a custom color for events that I post to the calendar, but don't want to be
limited by the 11 choices. I see in the docs they have added an
additional color setting method
(https://developers.google.com/google-apps/calendar/v3/whats-new#custom_colors_f‌​or_calendars).
But I'm unclear on the concept of how to go about it.
This part of the documentation demonstrates these properties directly: https://developers.google.com/google-apps/calendar/v3/reference/calendarList/insert
Which will let you add and modify your personal calendar as a demo (scroll to the bottom and try out the API Explorer). To do what you are asking on here, set colorRgbFormat=true then add the backgroundColor or foregroundColor properties with the specified color.
You end up with a request which looks like:
POST https://www.googleapis.com/calendar/v3/users/me/calendarList?colorRgbFormat=true&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer xxxx
X-JavaScript-User-Agent: Google APIs Explorer
{
"id": "SomeCalendarItem",
"backgroundColor": "#444444"
}
Note: I think this answers the bounty question - which is different from what the OP asked, but might be what the OP wanted - #Wescotte, please advise if this solves (or doesn't) your issue as well.

Changing interactive mode Edge Shape in JUNG

I am aware of the ability using an EdgeShapeTransformer to change the look of edges:
vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line()); // for example
However I am looking for how to change the way the line looks while dragging from one node to another to create an edge interactively. By default the 'hovering' edge which is not yet linked to another node is a large curved line. See the example here for what I mean.
CubicCurveEdgeEffects is where it is done. There is an EdgeEffects interface that can be implemented to do other things instead. It is used by the SimpleEdgeSupport class via the EditingGraphMousePlugin.
(Credit to Tom Nelson, offline communication.)