This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
178eece
commit b8f1942
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2019, The Gtk-rs Project Developers. | ||
// See the COPYRIGHT file at the top-level directory of this distribution. | ||
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> | ||
|
||
use glib::Cast; | ||
use glib::object::IsA; | ||
use glib::translate::*; | ||
use gtk_sys; | ||
use Entry; | ||
use EntryCompletion; | ||
use Widget; | ||
|
||
pub trait EntryCompletionExtManual: 'static { | ||
fn get_entry(&self) -> Option<Entry>; | ||
} | ||
|
||
impl<O: IsA<EntryCompletion>> EntryCompletionExtManual for O { | ||
fn get_entry(&self) -> Option<Entry> { | ||
let widget: Option<Widget> = unsafe { | ||
from_glib_none(gtk_sys::gtk_entry_completion_get_entry(self.as_ref().to_glib_none().0)) | ||
}; | ||
match widget { | ||
Some(w) => w.downcast().ok(), | ||
None => None, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters