Skip to content

Commit

Permalink
Update C extension examples in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thomthom committed Nov 18, 2020
1 parent 34c0ed7 commit 0e097c5
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions ruby-c-extension/sketchup-taskbarlist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,35 @@ that was introduced to Windows 7.
It is advised to read up on the interface for how to use it:
https://docs.microsoft.com/en-gb/windows/win32/api/shobjidl_core/nn-shobjidl_core-itaskbarlist3

## Visual Studio 2013
## Visual Studio 2019

The Ruby C Extension was created with Visual Studio 2019:
https://visualstudio.microsoft.com/downloads/

NOTE: The Ruby `config.h` had to be modified because it was originally intended
for Visual Studio 2010.

## Example
## Examples

```ruby
require 'sketchup.rb'
require 'taskbar_progress.rb'
require 'testup/taskbar_progress.rb'

model = Sketchup.active_model
entities = model.active_entities

TaskbarProgress.new.each(entities.to_a) { |entity|
entity.erase!
TestUp::TaskbarProgress.new.each(entities.to_a) { |entity|
entity.erase! if entity.valid?
}
```

```ruby
x = [1, 2, 3, 4, 5, 6]
progress = TestUp::TaskbarProgress.new
progress.each(x) { |entity|
p x
sleep(0.5)
}
```

```ruby
progress = TestUp::TaskbarProgress.new
progress.set_state(TestUp::TaskbarProgress::TBPF_INDETERMINATE)
```

0 comments on commit 0e097c5

Please sign in to comment.