Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions druid/examples/anim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
//! rest of the app. If this is something the rest of your widgets should know
//! about, you could put it in the `data`.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use std::f64::consts::PI;

use druid::kurbo::{Circle, Line};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/async_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
//! takes a long time but don't want to block the main thread
//! (waiting on an http request, some cpu intensive work etc.)

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use instant::Instant;
use std::thread;
use std::time::Duration;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/blocking_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//! the other thread some data and then we also pass some data back
//! to the main thread using commands.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use std::{thread, time};

use druid::widget::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/calc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! Simple calculator.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::{
theme, AppLauncher, Color, Data, Lens, LocalizedString, RenderContext, Widget, WidgetExt,
WindowDesc,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
//! open so we have to work around that. When we receive the
//! `WindowConnected` command we initiate the cursor.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::{
AppLauncher, Color, Cursor, CursorDesc, Data, Env, ImageBuf, Lens, LocalizedString, WidgetExt,
WindowDesc,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/custom_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! An example of a custom drawing widget.
//! We draw an image, some text, a shape, and a curve.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::kurbo::BezPath;
use druid::piet::{FontFamily, ImageFormat, InterpolationMode, Text, TextLayoutBuilder};
use druid::widget::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/disabled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
//! respond. Pressing Tab should only focus widgets not marked as disabled. If a widget
//! is focused while getting disabled it should resign the focus.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{
Button, Checkbox, CrossAxisAlignment, Flex, Label, Slider, Stepper, Switch, TextBox,
};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//! This is a very simple example, it uses a bool to determine
//! which widget gets shown.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::prelude::*;
use druid::widget::{Checkbox, Either, Flex, Label, Slider};
use druid::{AppLauncher, Data, Lens, WidgetExt, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/event_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! An application that accepts keyboard and mouse input, and displays
//! information about received events.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::prelude::*;
use druid::widget::{Controller, CrossAxisAlignment, Flex, Label, List, Scroll, SizedBox, TextBox};
use druid::{
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/flex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
//! knobs to change all the parameters. 99% of the time you will want to
//! hard-code these parameters, which will simplify your code considerably.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::text::ParseFormatter;
use druid::widget::prelude::*;
use druid::widget::{
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! This is an example of how you would implement the game of life with druid.
//! This example doesnt showcase anything specific in druid.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use std::ops::{Index, IndexMut};
use std::time::{Duration, Instant};

Expand Down
3 changes: 3 additions & 0 deletions druid/examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! This is a very small example of how to setup a druid application.
//! It does the almost bare minimum while still being useful.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::prelude::*;
use druid::widget::{Flex, Label, TextBox};
use druid::{AppLauncher, Data, Lens, UnitPoint, WidgetExt, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
//! other circumstances where widgets may need to communicate with specific
//! other widgets, and identity is a useful mechanism in those cases.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::prelude::*;
use druid::widget::{Button, Controller, Flex, Label, WidgetId};
use druid::{AppLauncher, Data, Lens, Selector, WidgetExt, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//! propperties. You can change the parameters in the GUI to see how
//! everything behaves.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::piet::InterpolationMode;
use druid::text::ParseFormatter;
use druid::widget::{prelude::*, FillStrat, Image};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/invalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! Demonstrates how to debug invalidation regions, and also shows the
//! invalidation behavior of several build-in widgets.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::im::Vector;
use druid::kurbo::{self, Shape};
use druid::widget::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! This example shows how to construct a basic layout,
//! using columns, rows, and loops, for repeated Widgets.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{AspectRatioBox, Button, Flex, Label, LineBreaking};
use druid::{AppLauncher, Color, Widget, WidgetExt, WindowDesc};

Expand Down
3 changes: 3 additions & 0 deletions druid/examples/lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! This example shows basic usage of Lens

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::Slider;
use druid::widget::{CrossAxisAlignment, Flex, Label, TextBox};
use druid::{AppLauncher, Data, Env, Lens, LocalizedString, Widget, WidgetExt, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! Demos basic list widget and list manipulations.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::im::{vector, Vector};
use druid::lens::{self, LensExt};
use druid::widget::{Button, CrossAxisAlignment, Flex, Label, List, Scroll};
Expand Down
5 changes: 4 additions & 1 deletion druid/examples/markdown_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! An example of live markdown preview

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use pulldown_cmark::{Event as ParseEvent, Parser, Tag};

use druid::text::{AttributesAdder, RichText, RichTextBuilder};
Expand All @@ -34,7 +37,7 @@ const TEXT: &str = "*Hello* ***world***! This is a `TextBox` where you can \
If you're curious about Druid, a good place to ask questions \
and discuss development work is our [Zulip chat instance], \
in the #druid-help and #druid channels, respectively.\n\n\n\

[Zulip chat instance]: https://xi.zulipchat.com";

const SPACER_SIZE: f64 = 8.0;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/multiwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! Opening and closing windows and using window and context menus.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::prelude::*;
use druid::widget::{
Align, BackgroundBrush, Button, Controller, ControllerHost, Flex, Label, Padding,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/open_save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! Usage of file open and saving.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{Align, Button, Flex, TextBox};
use druid::{
commands, AppDelegate, AppLauncher, Command, DelegateCtx, Env, FileDialogOptions, FileSpec,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/panels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! This example shows how to construct a basic layout.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::kurbo::Circle;
use druid::widget::{Flex, Label, Painter};
use druid::{
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! Shows a scroll widget, and also demonstrates how widgets that paint
//! outside their bounds can specify their paint region.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::kurbo::Circle;
use druid::piet::RadialGradient;
use druid::widget::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/scroll_colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! This example allows to play with scroll bars over different color tones.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{Container, Flex, Scroll, SizedBox};
use druid::{AppLauncher, Color, LocalizedString, Widget, WindowDesc};

Expand Down
3 changes: 3 additions & 0 deletions druid/examples/split_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! This example demonstrates the `Split` widget

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::piet::Color;
use druid::widget::{Align, Container, Label, Padding, Split};
use druid::{AppLauncher, LocalizedString, Widget, WindowDesc};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/styled_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! Example of dynamic text styling

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{
Checkbox, CrossAxisAlignment, Flex, Label, LensWrap, MainAxisAlignment, Painter, Parse, Scroll,
Stepper, TextBox,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/sub_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::commands::CLOSE_WINDOW;
use druid::lens::Unit;
use druid::widget::{
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! This example shows how to draw an SVG.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use tracing::error;

use druid::{
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/switches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{
Checkbox, Flex, Label, LensWrap, MainAxisAlignment, Padding, Parse, Stepper, Switch, TextBox,
WidgetExt,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::im::Vector;
use druid::widget::{
Axis, Button, CrossAxisAlignment, Flex, Label, MainAxisAlignment, RadioGroup, Split, TabInfo,
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! An example of various text layout features.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::piet::{PietTextLayoutBuilder, TextStorage as PietTextStorage};
use druid::text::{Attribute, RichText, TextStorage};
use druid::widget::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/textbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
//! I would like to make this a bit fancier (like the flex demo) but for now
//! lets keep it simple.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use std::sync::Arc;

use druid::widget::{Flex, Label, TextBox};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! An example of a timer.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use std::time::Duration;

use druid::widget::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/transparency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! An example of a transparent window background.
//! Useful for dropdowns, tooltips and other overlay windows.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::kurbo::Circle;
use druid::widget::prelude::*;
use druid::widget::{Flex, Label, Painter, TextBox, WidgetExt};
Expand Down
3 changes: 3 additions & 0 deletions druid/examples/value_formatting/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

mod formatters;
mod widgets;

Expand Down
3 changes: 3 additions & 0 deletions druid/examples/view_switcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! This example demonstrates the `ViewSwitcher` widget

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::widget::{Button, Flex, Label, Split, TextBox, ViewSwitcher};
use druid::{AppLauncher, Data, Env, Lens, LocalizedString, Widget, WidgetExt, WindowDesc};

Expand Down
3 changes: 3 additions & 0 deletions druid/examples/widget_gallery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// On Windows platform, don't show a console when opening the app.
#![windows_subsystem = "windows"]

use druid::{
im,
kurbo::{Affine, BezPath, Circle, Point},
Expand Down
6 changes: 6 additions & 0 deletions druid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@
//! features = ["im", "svg", "image"]
//! ```
//!
//! # Note for Windows apps
//!
//! By default, Windows will open a console with your application's window. If you don't want
//! the console to be shown, use `#![windows_subsystem = "windows"]` at the beginning of your
//! crate.
//!
//! [`Widget`]: trait.Widget.html
//! [`Data`]: trait.Data.html
//! [`Lens`]: trait.Lens.html
Expand Down