#[widget]
attribute: https://github.com/antoyo/relm/blob/f580d4597704d6d1e8d3654f1544851159b7cec8/relm-examples/tests/communication.rs#L182 . A more manual way is here:
emit()
on the component). The first two only bind a message to send another message.
Hi! I'm facing an issue with the view! macro :
view! {
gtk::ScrolledWindow(None::<>k::Adjustment>, None::<>k::Adjustment>) {
policy: PolicyType::Automatic, PolicyType::Automatic,
#[name="main_zone"]
gtk::FlowBox {
}
}
}
I'm trying to set up the policy for ScrolledWindow, but
error: expected curly braces
--> src/graphic/history_component.rs:28:65
|
28 | policy: PolicyType::Automatic, PolicyType::Automatic,
|
But adding curly braces after this line 28 also raises errors.
I've just tried to follow official documentation for ScrolledWindowExt : https://gtk-rs.org/docs/gtk/trait.ScrolledWindowExt.html#tymethod.set_policy.
(PolicyType::Automatic, PolicyType::Automatic)
hscroll_policy
and vscroll_policy
for your use case.
pack_start
, pack_end
from the view!
macro ? As I am trying to set a Ground
and a ScrolledWindow
side by side (horizontally), but the Ground
is always centered in my game zone, and the ScrolledWindow
has little room.
fn init_view(&mut self) {
let style = include_bytes!("./game_zone.css");
let provider = CssProvider::new();
provider
.load_from_data(style)
.expect("Failed to read css style for GameZone !");
self.history
.get_style_context()
.add_provider(&provider, STYLE_PROVIDER_PRIORITY_APPLICATION);
}
get_style_context()
<ListBox selection_mode=SelectionMode::None>
{
self.tasks.iter().enumerate().map(|(index, task)| task.render(index))
}
</ListBox>
mg
is something like girara (https://pwmt.org/projects/girara/): it basically gives you vim-like functionality (key bindings, modes, commands, settings, …). Where does it say it's in alpha? mg
is the library used by my web browser titanium. It's fairly stable, though I believe I introduce a bug in the last version.